GNU bug report logs -
#71429
Inconsistent y-or-n-p prompt behavior in Emacs Lisp
Previous Next
Full log
View this message in rfc822 format
> From: Stephen Berman <stephen.berman <at> gmx.net>
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, gabriele <at> medialab.sissa.it,
> stefankangas <at> gmail.com, 71429 <at> debbugs.gnu.org
> Date: Sat, 08 Jun 2024 17:47:04 +0200
>
> On Sat, 08 Jun 2024 17:58:17 +0300 Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> >> Without the backslashes the cond-clause in substitute-command-keys
> >> handling sequences starting with "\" is skipped, so "y" and "n" do not
> >> get the help-key-binding face property.
> >
> > This should be explained in a comment in y-or-n-p.
>
> Since this effect of using a backslash is part of what
> substitute-command-keys does (and it's commented there: ";; 1C. \`f' is
> replaced with a fontified f."), would adding a comment to y-or-n-p be an
> exception or would all callers of substitute-command-keys that use this
> handling of the backslash also need to have such a comment?
Not necessarily all the callers, but some definitely. This is an
unusual convention, which is mentioned in the doc string of
substitute-command-keys, but not in the ELisp manual, and is used in
our tree not too many times. The fact that I didn't know about it
should already speak volumes. And in this case, how can the reader
guess that `y' and `n' are meant as key bindings, not as simple
characters?
This bug report was last modified 1 year and 44 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.