aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRobert Pluim2022-09-21 09:12:53 +0200
committerRobert Pluim2022-09-21 09:15:47 +0200
commitcee9a2cbe0cd2cb1af602077727c03f2ae62fa90 (patch)
treef61fde18b86fa47ae9a49694529442bca2746d1f /test
parent5fbf93d918ba85afa8506569328dfc9c510cee42 (diff)
downloademacs-cee9a2cbe0cd2cb1af602077727c03f2ae62fa90.tar.gz
emacs-cee9a2cbe0cd2cb1af602077727c03f2ae62fa90.zip
Fix substitute-command-keys for global binding lookup
The previous change forgot to account for the (rare) case of doing a lookup for a global binding when a specific keymap is in force. * lisp/help.el (substitute-command-keys): Redo lookup in global map if lookup in specific map fails. * test/lisp/help-tests.el (help-tests-substitute-command-keys/keymap-change): Add testcase for specific map overriding advertised-binding.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/help-tests.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el
index 6f1dcfa5b6b..0fcaacb6443 100644
--- a/test/lisp/help-tests.el
+++ b/test/lisp/help-tests.el
@@ -181,8 +181,12 @@ M-g M-c switch-to-completions
181 181
182(ert-deftest help-tests-substitute-command-keys/keymap-change () 182(ert-deftest help-tests-substitute-command-keys/keymap-change ()
183 (with-substitute-command-keys-test 183 (with-substitute-command-keys-test
184 ;; Global binding should be found even if specifying a specific map
184 (test "\\<minibuffer-local-must-match-map>\\[abort-recursive-edit]" "C-]") 185 (test "\\<minibuffer-local-must-match-map>\\[abort-recursive-edit]" "C-]")
185 (test "\\<emacs-lisp-mode-map>\\[eval-defun]" "C-M-x"))) 186 (test "\\<emacs-lisp-mode-map>\\[eval-defun]" "C-M-x")
187 ;; Specific map overrides advertised-binding
188 (test "\\<undo-repeat-map>\\[undo]" "u")
189 (test "\\[undo]" "C-x u")))
186 190
187(defvar-keymap help-tests-remap-map 191(defvar-keymap help-tests-remap-map
188 :full t 192 :full t