[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 120ade62cd 2/2: Allow keymap to override advertised-binding in do
From: |
Robert Pluim |
Subject: |
master 120ade62cd 2/2: Allow keymap to override advertised-binding in docstrings |
Date: |
Tue, 20 Sep 2022 11:45:56 -0400 (EDT) |
branch: master
commit 120ade62cd26dd502f1ae3784079e4cd88607a0b
Author: Robert Pluim <rpluim@gmail.com>
Commit: Robert Pluim <rpluim@gmail.com>
Allow keymap to override advertised-binding in docstrings
Previously
(substitute-command-keys "\\<undo-repeat-map>\\[undo]")
would use the global advertised-binding for `undo', even though
there's a binding in `undo-repeat-map', which is highly
counter-intuitive. Now the binding is looked up in the specified
keymap first.
* lisp/help.el (substitute-command-keys): Restrict the initial key
lookup to the specified keymap (if there is one). (Bug#51384)
---
lisp/help.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lisp/help.el b/lisp/help.el
index 92b87cf799..0ec5b9c85b 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1204,7 +1204,10 @@ Otherwise, return a new string."
(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
+ (and keymap
+ (list keymap))
+ t))))
(if (not key)
;; Function is not on any key.
(let ((op (point)))