From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#51940: 29.0.50; [PATCH] Fontification and indentation in M-x shell and ielm Date: Thu, 25 Nov 2021 12:42:42 +0200 Message-ID: <8335nk7bz1.fsf@gnu.org> References: <87sfvteqx2.fsf@miha-pc> <83ee7dyar2.fsf@gnu.org> <87pmqxeghn.fsf@miha-pc> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38037"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51940@debbugs.gnu.org To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 25 11:43:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mqCDd-0009fz-Fj for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Nov 2021 11:43:09 +0100 Original-Received: from localhost ([::1]:52948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqCDb-0007uE-6D for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Nov 2021 05:43:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqCDW-0007u3-DM for bug-gnu-emacs@gnu.org; Thu, 25 Nov 2021 05:43:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqCDW-00012q-4y for bug-gnu-emacs@gnu.org; Thu, 25 Nov 2021 05:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mqCDV-0000tz-Qz for bug-gnu-emacs@gnu.org; Thu, 25 Nov 2021 05:43:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Nov 2021 10:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51940 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51940-submit@debbugs.gnu.org id=B51940.16378369693449 (code B ref 51940); Thu, 25 Nov 2021 10:43:01 +0000 Original-Received: (at 51940) by debbugs.gnu.org; 25 Nov 2021 10:42:49 +0000 Original-Received: from localhost ([127.0.0.1]:55883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqCDJ-0000tZ-Eg for submit@debbugs.gnu.org; Thu, 25 Nov 2021 05:42:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqCDH-0000tN-Q0 for 51940@debbugs.gnu.org; Thu, 25 Nov 2021 05:42:48 -0500 Original-Received: from [2001:470:142:3::e] (port=36058 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqCDC-0000zA-5R; Thu, 25 Nov 2021 05:42:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=9jhR0niW83PxNtOZeTDXIYWWa4O31T9SXWJZYfoLf9U=; b=TbM1kv1vP5DY cV9iPbPfeDxWXfTssrjNnNUW32RwcbEqr0EZAViv3/TF+ct/U8TwDvOM92grxNk1KOYfRnOYb+beA +NiUveR0FRbScFBKThxDfnCo4T1viJK3FD0qqY5LOiMmC3GsNvgMuJsBo6mQPfE9zb2JXLe6ROi/M hdwmOJuBt+jN9xFbXja1GvCn6SF2orDTMHaiCrDYZowQiOZjULoSTACalbvYxH8qGhRME7lCnUW4E Y2F323Y1fTsrGmcsLIn+3t21CyKa9YHqO1TnWnPc5q+ZijpSRFQJm1EHpcApPorfR+3fkmMquzSzJ OhtfhEAcN3A3sUPYVAoNVg==; Original-Received: from [87.69.77.57] (port=4738 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqCDB-0002zg-EK; Thu, 25 Nov 2021 05:42:41 -0500 In-Reply-To: <87pmqxeghn.fsf@miha-pc> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:220808 Archived-At: > From: > Cc: 51940@debbugs.gnu.org > Date: Thu, 18 Nov 2021 14:32:52 +0100 > > Eli Zaretskii writes: > > >> Date: Thu, 18 Nov 2021 10:47:37 +0100 > >> From: miha--- via "Bug reports for GNU Emacs, > >> the Swiss army knife of text editors" > >> > >> Please find the attached patches which enable fontification and > >> indentation in M-x shell and ielm. The main fontification and > >> indentation machinery is implemented in comint.el and should be general > >> enough for use by other comint derived modes. It works by making an > >> indirect buffer, putting it in a suitable major mode (sh-mode in > >> M-x shell buffers, for example) and fontifying and indenting user input > >> that buffer. > > > > Thanks. > > > > One general comment about the doc strings: > > > >> +(defvar-local comint-indirect-setup-function nil > >> + "Function to set up an indirect buffer. > > > > here and elsewhere in the changes, please modify the first sentence of > > the doc strings so that they don't sound too general. "Set up an > > indirect buffer" doesn't hint on the fact that this is for comint > > buffers, not in general about indirect buffers. The same problem > > exists with many doc strings in these patches. > > Okay, attached are revised patches with improved doc strings and a fixed > commit message. The doc strings are still not specific enough, sorry for being unclear in what I meant. Let's take an example: > +(define-minor-mode comint-fl-mode > + "Enable input fontification. The first line should say something like Enable input fontification in comint buffers. > +(defun comint--fl-off () > + "Disable input fontification for the current buffer." Similarly here: Disable input fontification in the current comint buffer. > +(defun comint--fl-fontify-region (fun beg end verbose) > + "Around advice for `font-lock-fontify-region-function'. Likewise here: mention comint in the first line. > +(defcustom shell-highlight-undef-aliases nil > + "List of commands to highlight as a command alias." Here, the doc string should mention shell command aliases, otherwise it's too general ("command alias" doesn't necessarily imply a shell). Please go over the doc strings with this criterion in mind, and see what else needs to be fixed in the same way. Also, would people who use these modes a lot please try the feature and provide feedback? Thanks.