unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: miha@kamnitnik.top
Cc: larsi@gnus.org, emacs-devel@gnu.org
Subject: Re: master 5a8a5e3d: Input fontification for M-x shell
Date: Sat, 10 Sep 2022 18:46:45 +0300	[thread overview]
Message-ID: <83mtb79qqi.fsf@gnu.org> (raw)
In-Reply-To: <87r10j2pkg.fsf@miha-pc>

> From: <miha@kamnitnik.top>
> Cc: Lars Ingebrigtsen <larsi@gnus.org>, 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.



  reply	other threads:[~2022-09-10 15:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 19:23 master 5a8a5e3d: Input fontification for M-x shell Eli Zaretskii
2022-09-10 15:53 ` miha
2022-09-10 15:46   ` Eli Zaretskii [this message]
2022-09-11 11:06     ` miha
2022-09-11 10:59       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mtb79qqi.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=miha@kamnitnik.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).