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.devel Subject: Re: master 5a8a5e3d: Input fontification for M-x shell Date: Sat, 10 Sep 2022 18:46:45 +0300 Message-ID: <83mtb79qqi.fsf@gnu.org> References: <83mtb8bbdl.fsf@gnu.org> <87r10j2pkg.fsf@miha-pc> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17773"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: miha@kamnitnik.top Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 10 17:49:52 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oX2ju-0004Jv-4L for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Sep 2022 17:49:50 +0200 Original-Received: from localhost ([::1]:47998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oX2jt-0002iL-1M for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Sep 2022 11:49:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41450) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX2hF-0001nS-G1 for emacs-devel@gnu.org; Sat, 10 Sep 2022 11:47:05 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX2hE-0000kM-M4; Sat, 10 Sep 2022 11:47:04 -0400 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=WDzX3Y4SrfbZVSxo9APSZL9mF1H4EaLrPm458t7ETc0=; b=kbavmDoUJeom EsW0QsldUvZffoHNoGxUVlrLdL1OO4yqHMxKzE255X6gCmuouYO1REXfl27TVkri14AStebNRHbOU +inqwNWeN1KLdjatOB4bG78yNMXbUqqCJcV5heW6oDvfMsDHSAkmyRQKjtpMh0mcvFgMSP2U3mGnU G9gpAwI4lalQsN9LQ6Z0uPkh+oZ0/ekjvL4ZxIWY/X8F0aV0XFeJnm/YiaSjvYQDswAljrqEkx9FO SJieonJACgHyI6pWo22aG/AA7uws/Sbl9GerNI7SlHoLNt7eZ4xa063UjfKeeKaEH7PGpFkgV4laz a1oEtx2THJ2Y9Dx1JPYg1g==; Original-Received: from [87.69.77.57] (port=2228 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 1oX2hE-0002Zn-68; Sat, 10 Sep 2022 11:47:04 -0400 In-Reply-To: <87r10j2pkg.fsf@miha-pc> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:295136 Archived-At: > From: > Cc: Lars Ingebrigtsen , emacs-devel@gnu.org > Date: Sat, 10 Sep 2022 17:53:51 +0200 > > > It is not useful to have customizable user options whose doc string > > doesn't explain their purpose. It makes discovery and use of such > > options much harder. Imagine a user who upgrades to Emacs 29 and runs > > "M-x customize-changed" to learn about new options in the new version: > > what will such user understand by reading the doc string of this > > option? There's no explanation what are indirect shell fontification > > buffers, nor how and for what purpose they are used. Without that, it > > is impossible to understand when and how this hook could be useful. > > > > Could you please augment the doc string with the above in mind? > > > > The same goes for several other hooks in your changes installed today. > > Thanks. Will something like this be good? I also tried to address your > other e-mail. It is much better, thanks. > (defcustom comint-indirect-setup-hook nil > - "Hook run after setting up an indirect comint fontification buffer. > -It is run after the indirect buffer is set up for fontification > -of input regions." > + "Hook run in an indirect buffer for input fontification. > +If input fontification or indentation is enabled, create an > +indirect buffer and set up its major mode and syntax You say "create an indirect buffer and set up...", but isn't that done by some of the other code you submitted? If so, instead of "create...and set up...", which implies that the user of this variable must do so, the doc string should say something like If input fontification or indentation is enabled, function `so-and-so' creates an indirect buffer and sets up its major mode and syntax highlighting. This hook is useful for running in that indirect buffer when its major mode is turned on. > -(defun shell-highlight-undef-reset-mode () > - "If `shell-highlight-undef-mode' is on, turn it off and on." > +(defun shell-highlight-undef-mode-restart () > + "If `shell-highlight-undef-mode' is on, restart it. > +`shell-highlight-undef-mode' performs its set-up differently > +depending on `comint-fl-mode'. It's useful to call this function > +when switching `comint-fl-mode' in order to make > +`shell-highlight-undef-mode' redo its setup." Ah, now this makes sense. Thanks.