GNU bug report logs - #78391
30.0.92; remapped command's docstring still claims to have menu invocation

Previous Next

Package: emacs;

Reported by: Jake <jforst.mailman <at> gmail.com>

Date: Mon, 12 May 2025 12:21:02 UTC

Severity: normal

Found in version 30.0.92

Done: Eli Zaretskii <eliz <at> gnu.org>

To reply to this bug, email your comments to 78391 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#78391; Package emacs. (Mon, 12 May 2025 12:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jake <jforst.mailman <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 12 May 2025 12:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jake <jforst.mailman <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.92;
 remapped command's docstring still claims to have menu invocation
Date: Mon, 12 May 2025 12:19:33 +0000
[Message part 1 (text/plain, inline)]
Hello

From emacs -Q, evaluate
  (keymap-global-set "<remap> <list-buffers>" #'ibuffer)
then C-h f list-buffers RET

The docstring includes:

"Its keys are remapped to ‘ibuffer’.  Without this remapping, it would
be bound to C-x C-b.
It can also be invoked from the menu: Buffers → List All Buffers"

It cannot be invoked from the menu as the menu item is also remapped.

Thanks
Jake


In GNU Emacs 30.0.92 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.43, cairo version 1.18.2)
Windowing system distributor 'The X.Org Foundation', version 11.0.12101015
System Description: Guix System

Configured using:
 'configure
 CONFIG_SHELL=/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal-5.1.16/bin/bash
 SHELL=/gnu/store/m0xdsa8cfq6mq1kxgxmpmpg71la4f0b9-bash-minimal-5.1.16/bin/bash
 --prefix=/gnu/store/11m3qxg9dc02qm0hv4qsnwdppxic196c-emacs-next-30.0.92-0.881d593
 --enable-fast-install --with-cairo --with-modules
 --with-native-compilation=aot --disable-build-details'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $EMACSLOADPATH:
/home/jake/.guix-profile/share/emacs/site-lisp:/gnu/store/11m3qxg9dc02qm0hv4qsnwdppxic196c-emacs-next-30.0.92-0.881d593/share/emacs/30.0.92/lisp
  value of $LANG: en_AU.utf8
  locale-coding-system: utf-8-unix
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78391; Package emacs. (Mon, 12 May 2025 12:43:01 GMT) Full text and rfc822 format available.

Message #8 received at 78391 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jake <jforst.mailman <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 78391 <at> debbugs.gnu.org
Subject: Re: bug#78391: 30.0.92;
 remapped command's docstring still claims to have menu invocation
Date: Mon, 12 May 2025 15:42:01 +0300
> From: Jake <jforst.mailman <at> gmail.com>
> Date: Mon, 12 May 2025 12:19:33 +0000
> 
> From emacs -Q, evaluate
>   (keymap-global-set "<remap> <list-buffers>" #'ibuffer)
> then C-h f list-buffers RET
> 
> The docstring includes:
> 
> "Its keys are remapped to ‘ibuffer’.  Without this remapping, it would
> be bound to C-x C-b.
> It can also be invoked from the menu: Buffers → List All Buffers"
> 
> It cannot be invoked from the menu as the menu item is also remapped.

Thanks.  Does the patch below give good results?

Stefan, any comments?

diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index e7bbd25..aacdcc5 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -624,8 +624,11 @@ help-fns--key-bindings
               (let ((start (point)))
                 (help-fns--insert-menu-bindings
                  menus
-                 (concat "It can " (and keys "also ")
-                         "be invoked from the menu: "))
+                 (if remapped
+                     (concat "Without the remapping, it could "
+                             (and keys "also ") "be invoked from the menu: ")
+                   (concat "It can " (and keys "also ")
+                           "be invoked from the menu: ")))
                 (fill-region-as-paragraph start (point))))
             (ensure-empty-lines)))))))
 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78391; Package emacs. (Mon, 12 May 2025 14:51:01 GMT) Full text and rfc822 format available.

Message #11 received at 78391 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Jake <jforst.mailman <at> gmail.com>, 78391 <at> debbugs.gnu.org
Subject: Re: bug#78391: 30.0.92; remapped command's docstring still claims
 to have menu invocation
Date: Mon, 12 May 2025 10:50:26 -0400
> Thanks.  Does the patch below give good results?
>
> Stefan, any comments?
>
> diff --git a/lisp/help-fns.el b/lisp/help-fns.el
> index e7bbd25..aacdcc5 100644
> --- a/lisp/help-fns.el
> +++ b/lisp/help-fns.el
> @@ -624,8 +624,11 @@ help-fns--key-bindings
>                (let ((start (point)))
>                  (help-fns--insert-menu-bindings
>                   menus
> -                 (concat "It can " (and keys "also ")
> -                         "be invoked from the menu: "))
> +                 (if remapped
> +                     (concat "Without the remapping, it could "
> +                             (and keys "also ") "be invoked from the menu: ")
> +                   (concat "It can " (and keys "also ")
> +                           "be invoked from the menu: ")))
>                  (fill-region-as-paragraph start (point))))
>              (ensure-empty-lines)))))))
>  

It gives a rather redundant text since the same "Without the remapping"
is used just above for the key bindings.  As a user I'd prefer it
integrated into that previous sentence to end up with a text along the
lines of:

    Its keys are remapped to ‘ibuffer’.
    Without this remapping, it would be bound to C-x C-b
    and to the menu entry Buffers → List All Buffers


- Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78391; Package emacs. (Mon, 12 May 2025 15:01:02 GMT) Full text and rfc822 format available.

Message #14 received at 78391 <at> debbugs.gnu.org (full text, mbox):

From: Jake <jforst.mailman <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 78391 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#78391: 30.0.92; remapped command's docstring still claims to
 have menu invocation
Date: Tue, 13 May 2025 00:30:18 +0930
[Message part 1 (text/plain, inline)]
How about:

Its keys and menu entry are remapped to ‘ibuffer’.
    Without this remapping, it would be bound to C-x C-b
    and to the menu entry Buffers → List All Buffers


On Tue, 13 May 2025 at 12:20 am, Stefan Monnier <monnier <at> iro.umontreal.ca>
wrote:

> > Thanks.  Does the patch below give good results?
> >
> > Stefan, any comments?
> >
> > diff --git a/lisp/help-fns.el b/lisp/help-fns.el
> > index e7bbd25..aacdcc5 100644
> > --- a/lisp/help-fns.el
> > +++ b/lisp/help-fns.el
> > @@ -624,8 +624,11 @@ help-fns--key-bindings
> >                (let ((start (point)))
> >                  (help-fns--insert-menu-bindings
> >                   menus
> > -                 (concat "It can " (and keys "also ")
> > -                         "be invoked from the menu: "))
> > +                 (if remapped
> > +                     (concat "Without the remapping, it could "
> > +                             (and keys "also ") "be invoked from the
> menu: ")
> > +                   (concat "It can " (and keys "also ")
> > +                           "be invoked from the menu: ")))
> >                  (fill-region-as-paragraph start (point))))
> >              (ensure-empty-lines)))))))
> >
>
> It gives a rather redundant text since the same "Without the remapping"
> is used just above for the key bindings.  As a user I'd prefer it
> integrated into that previous sentence to end up with a text along the
> lines of:
>
>     Its keys are remapped to ‘ibuffer’.
>     Without this remapping, it would be bound to C-x C-b
>     and to the menu entry Buffers → List All Buffers
>
>
> - Stefan
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78391; Package emacs. (Mon, 12 May 2025 16:02:02 GMT) Full text and rfc822 format available.

Message #17 received at 78391 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: jforst.mailman <at> gmail.com, 78391 <at> debbugs.gnu.org
Subject: Re: bug#78391: 30.0.92; remapped command's docstring still claims
 to have menu invocation
Date: Mon, 12 May 2025 19:01:05 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Jake <jforst.mailman <at> gmail.com>,  78391 <at> debbugs.gnu.org
> Date: Mon, 12 May 2025 10:50:26 -0400
> 
> > Thanks.  Does the patch below give good results?
> >
> > Stefan, any comments?
> >
> > diff --git a/lisp/help-fns.el b/lisp/help-fns.el
> > index e7bbd25..aacdcc5 100644
> > --- a/lisp/help-fns.el
> > +++ b/lisp/help-fns.el
> > @@ -624,8 +624,11 @@ help-fns--key-bindings
> >                (let ((start (point)))
> >                  (help-fns--insert-menu-bindings
> >                   menus
> > -                 (concat "It can " (and keys "also ")
> > -                         "be invoked from the menu: "))
> > +                 (if remapped
> > +                     (concat "Without the remapping, it could "
> > +                             (and keys "also ") "be invoked from the menu: ")
> > +                   (concat "It can " (and keys "also ")
> > +                           "be invoked from the menu: ")))
> >                  (fill-region-as-paragraph start (point))))
> >              (ensure-empty-lines)))))))
> >  
> 
> It gives a rather redundant text since the same "Without the remapping"
> is used just above for the key bindings.  As a user I'd prefer it
> integrated into that previous sentence to end up with a text along the
> lines of:
> 
>     Its keys are remapped to ‘ibuffer’.
>     Without this remapping, it would be bound to C-x C-b
>     and to the menu entry Buffers → List All Buffers

The problem with this is that there could be additional text
in-between, in which case the sentence would become a mouthful:

          (if (and (eq function 'self-insert-command)
                   (vectorp (car-safe keys))
                   (consp (aref (car keys) 0)))
              (princ "It is bound to many ordinary text characters.\n")
            ;; Which non-control non-meta keys run this command?
            (dolist (key keys)
              (if (member (event-modifiers (aref key 0)) '(nil (shift)))
                  (push key non-modified-keys)))
            (when remapped
              (princ "Its keys are remapped to ")
              (princ (if (symbolp remapped)
                         (format-message "`%s'" remapped)
		       "an anonymous command"))
              (princ ".\n"))

            (when keys
              (princ (if remapped
                         "Without this remapping, it would be bound to "
                       "It is bound to "))
              ;; If lots of ordinary text characters run this command,
              ;; don't mention them one by one.
              (if (< (length non-modified-keys) 10)
                  (with-current-buffer standard-output
                    (help-fns--insert-bindings keys))
                (dolist (key non-modified-keys)
                  (setq keys (delq key keys)))
                (if keys
                    (with-current-buffer standard-output
                      (help-fns--insert-bindings keys)
                      (insert ", and many ordinary text characters"))
                  (princ "many ordinary text characters."))))
            (when (or remapped keys non-modified-keys)
              (princ ".")
              (terpri)))

          (with-current-buffer standard-output
            (fill-region-as-paragraph pt2 (point))
            (unless (bolp)
              (insert "\n"))
            (when menus
              (let ((start (point)))
                (help-fns--insert-menu-bindings
                 menus
                 (concat "It can " (and keys "also ")
                         "be invoked from the menu: "))
                (fill-region-as-paragraph start (point))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78391; Package emacs. (Mon, 12 May 2025 17:23:01 GMT) Full text and rfc822 format available.

Message #20 received at 78391 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: jforst.mailman <at> gmail.com, 78391 <at> debbugs.gnu.org
Subject: Re: bug#78391: 30.0.92; remapped command's docstring still claims
 to have menu invocation
Date: Mon, 12 May 2025 13:21:58 -0400
>> It gives a rather redundant text since the same "Without the remapping"
>> is used just above for the key bindings.  As a user I'd prefer it
>> integrated into that previous sentence to end up with a text along the
>> lines of:
>>
>>     Its keys are remapped to ‘ibuffer’.
>>     Without this remapping, it would be bound to C-x C-b
>>     and to the menu entry Buffers → List All Buffers
>
> The problem with this is that there could be additional text
> in-between, in which case the sentence would become a mouthful:

Maybe take the "Without this remapping" out of the two sentences
into a separate prefixed note, as in:

    Its keys are remapped to ‘ibuffer’; if it weren't for this remapping:
    It would be bound to C-x C-b ...
    It could also be invoked from the menu: ...

Or maybe:

    It is bound to C-x C-b ...
    It can also be invoked from the menu: ...
    Note: these bindings do not actually run this command because the
    command's bindings are remapped to ‘ibuffer’.

Since I'm no fan of using actual sentences in such things, tho
I understand this is the tradition in Emacs (it reminds me of the odd
habit in North America of using road signs with text whereas European
road signs prefer symbols and pictograms instead), I'd actually prefer
something more ... dry like:

    Key bindings: C-x C-b ...
    Menu bindings: ...
    Remapped to: ‘ibuffer’


- Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78391; Package emacs. (Tue, 13 May 2025 15:56:02 GMT) Full text and rfc822 format available.

Message #23 received at 78391 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: jforst.mailman <at> gmail.com, 78391 <at> debbugs.gnu.org
Subject: Re: bug#78391: 30.0.92; remapped command's docstring still claims
 to have menu invocation
Date: Tue, 13 May 2025 18:55:37 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: jforst.mailman <at> gmail.com,  78391 <at> debbugs.gnu.org
> Date: Mon, 12 May 2025 13:21:58 -0400
> 
> >> It gives a rather redundant text since the same "Without the remapping"
> >> is used just above for the key bindings.  As a user I'd prefer it
> >> integrated into that previous sentence to end up with a text along the
> >> lines of:
> >>
> >>     Its keys are remapped to ‘ibuffer’.
> >>     Without this remapping, it would be bound to C-x C-b
> >>     and to the menu entry Buffers → List All Buffers
> >
> > The problem with this is that there could be additional text
> > in-between, in which case the sentence would become a mouthful:
> 
> Maybe take the "Without this remapping" out of the two sentences
> into a separate prefixed note, as in:
> 
>     Its keys are remapped to ‘ibuffer’; if it weren't for this remapping:
>     It would be bound to C-x C-b ...
>     It could also be invoked from the menu: ...
> 
> Or maybe:
> 
>     It is bound to C-x C-b ...
>     It can also be invoked from the menu: ...
>     Note: these bindings do not actually run this command because the
>     command's bindings are remapped to ‘ibuffer’.
> 
> Since I'm no fan of using actual sentences in such things, tho
> I understand this is the tradition in Emacs (it reminds me of the odd
> habit in North America of using road signs with text whereas European
> road signs prefer symbols and pictograms instead), I'd actually prefer
> something more ... dry like:
> 
>     Key bindings: C-x C-b ...
>     Menu bindings: ...
>     Remapped to: ‘ibuffer’

Thanks for the ideas.  They were not trivial to implement without some
major reshuffling of this delicate code, so I went for something
simpler:

  Its keys are remapped to ‘ibuffer’.  Without this remapping, it would
  be bound to C-x C-b.
  It could also be invoked from the menu: Buffers → List All Buffers,
  but that was remapped to ‘ibuffer’as well.

I hope this is good enough.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 24 May 2025 09:09:02 GMT) Full text and rfc822 format available.

Notification sent to Jake <jforst.mailman <at> gmail.com>:
bug acknowledged by developer. (Sat, 24 May 2025 09:09:02 GMT) Full text and rfc822 format available.

Message #28 received at 78391-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: monnier <at> iro.umontreal.ca, jforst.mailman <at> gmail.com
Cc: 78391-done <at> debbugs.gnu.org
Subject: Re: bug#78391: 30.0.92;
 remapped command's docstring still claims to have menu invocation
Date: Sat, 24 May 2025 12:08:33 +0300
> Cc: jforst.mailman <at> gmail.com, 78391 <at> debbugs.gnu.org
> Date: Tue, 13 May 2025 18:55:37 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> > Cc: jforst.mailman <at> gmail.com,  78391 <at> debbugs.gnu.org
> > Date: Mon, 12 May 2025 13:21:58 -0400
> > 
> > >> It gives a rather redundant text since the same "Without the remapping"
> > >> is used just above for the key bindings.  As a user I'd prefer it
> > >> integrated into that previous sentence to end up with a text along the
> > >> lines of:
> > >>
> > >>     Its keys are remapped to ‘ibuffer’.
> > >>     Without this remapping, it would be bound to C-x C-b
> > >>     and to the menu entry Buffers → List All Buffers
> > >
> > > The problem with this is that there could be additional text
> > > in-between, in which case the sentence would become a mouthful:
> > 
> > Maybe take the "Without this remapping" out of the two sentences
> > into a separate prefixed note, as in:
> > 
> >     Its keys are remapped to ‘ibuffer’; if it weren't for this remapping:
> >     It would be bound to C-x C-b ...
> >     It could also be invoked from the menu: ...
> > 
> > Or maybe:
> > 
> >     It is bound to C-x C-b ...
> >     It can also be invoked from the menu: ...
> >     Note: these bindings do not actually run this command because the
> >     command's bindings are remapped to ‘ibuffer’.
> > 
> > Since I'm no fan of using actual sentences in such things, tho
> > I understand this is the tradition in Emacs (it reminds me of the odd
> > habit in North America of using road signs with text whereas European
> > road signs prefer symbols and pictograms instead), I'd actually prefer
> > something more ... dry like:
> > 
> >     Key bindings: C-x C-b ...
> >     Menu bindings: ...
> >     Remapped to: ‘ibuffer’
> 
> Thanks for the ideas.  They were not trivial to implement without some
> major reshuffling of this delicate code, so I went for something
> simpler:
> 
>   Its keys are remapped to ‘ibuffer’.  Without this remapping, it would
>   be bound to C-x C-b.
>   It could also be invoked from the menu: Buffers → List All Buffers,
>   but that was remapped to ‘ibuffer’as well.
> 
> I hope this is good enough.

No further comments, so I'm now closing this bug.




This bug report was last modified 27 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.