GNU bug report logs - #51384
28.0.60; substitute-command-keys finds global binding for undo instead of in specified keymap

Previous Next

Package: emacs;

Reported by: Robert Pluim <rpluim <at> gmail.com>

Date: Mon, 25 Oct 2021 09:58:01 UTC

Severity: normal

Tags: fixed

Found in version 28.0.60

Fixed in version 29.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Robert Pluim <rpluim <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 51384 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>, Juri Linkov <juri <at> linkov.net>
Subject: bug#51384: 28.0.60; substitute-command-keys finds global binding for undo instead of in specified keymap
Date: Thu, 15 Sep 2022 09:39:43 +0200
>>>>> On Wed, 14 Sep 2022 20:29:52 +0200, Lars Ingebrigtsen <larsi <at> gnus.org> said:

    Lars> Robert Pluim <rpluim <at> gmail.com> writes:
    >> I have a change that will cause the lookups to happen in the specified
    >> map first, but I still need to audit the 50 or so uses of a command
    >> with an advertised binding in a docstring in the Emacs sources before
    >> I can declare it safe.

I donʼt think any of the advertised bindings caused a problem, but
Iʼll double check.

    Lars> This was more than half a year ago -- did you get any further here?  (I
    Lars> agree that the explicitly specified keymap should take precedence over
    Lars> :advertised-key-binding.)

The patch has shrunk in the meantime, somebody simplified the code ;-)

Robert

diff --git a/lisp/help.el b/lisp/help.el
index 15ab3192ad..263775e64e 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1204,7 +1204,8 @@ substitute-command-keys
                 (delete-char 2)
                 (let* ((fun (intern (buffer-substring (point) (1- end-point))))
                        (key (with-current-buffer orig-buf
-                              (where-is-internal fun keymap t))))
+                                 (where-is-internal fun (ensure-list keymap) t)))
+
                   (if (not key)
                       ;; Function is not on any key.
                       (let ((op (point)))




This bug report was last modified 2 years and 244 days ago.

Previous Next


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