unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: <miha@kamnitnik.top>
Cc: 51940@debbugs.gnu.org
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	[thread overview]
Message-ID: <8335nk7bz1.fsf@gnu.org> (raw)
In-Reply-To: <87pmqxeghn.fsf@miha-pc>

> From: <miha@kamnitnik.top>
> Cc: 51940@debbugs.gnu.org
> Date: Thu, 18 Nov 2021 14:32:52 +0100
> 
> Eli Zaretskii <eliz@gnu.org> 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" <bug-gnu-emacs@gnu.org>
> >> 
> >> 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.





  reply	other threads:[~2021-11-25 10:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18  9:47 bug#51940: 29.0.50; [PATCH] Fontification and indentation in M-x shell and ielm miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-18 11:16 ` Eli Zaretskii
2021-11-18 13:32   ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-25 10:42     ` Eli Zaretskii [this message]
2021-11-28 12:20       ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-09 18:14         ` 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=8335nk7bz1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=51940@debbugs.gnu.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).