[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 6c721af9c8e 2/2: Allow 'help-quick' to use a non-global keymap
From: |
Philip Kaludercic |
Subject: |
master 6c721af9c8e 2/2: Allow 'help-quick' to use a non-global keymap |
Date: |
Sat, 13 Apr 2024 04:33:27 -0400 (EDT) |
branch: master
commit 6c721af9c8ee2229af57491cc2833f6743c8ddab
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Allow 'help-quick' to use a non-global keymap
* lisp/help.el (help-quick-sections): Mention
'help-quick-use-map' in docstring.
(help-quick-use-map): Add new variable, defaulting to the
global-map.
(help-quick): Use new variable.
---
lisp/help.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/lisp/help.el b/lisp/help.el
index e23dd8ce0ae..d4e39f04e53 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -171,9 +171,15 @@ Value should be a list of elements, each element should of
the form
(GROUP-NAME (COMMAND . DESCRIPTION) (COMMAND . DESCRIPTION)...)
-where GROUP-NAME is the name of the group of the commands,
-COMMAND is the symbol of a command and DESCRIPTION is its short
-description, 10 to 15 characters at most.")
+where GROUP-NAME is the name of the group of the commands, COMMAND is
+the symbol of a command and DESCRIPTION is its short description, 10 to
+15 characters at most. The bindings for COMMAND are looked up from the
+keymap specified in `help-quick-use-map'.")
+
+(defvar help-quick-use-map global-map
+ "Keymap that `help-quick' should use to lookup bindings.
+Avoid changing the global value of this variable. Instead bind a
+different map dynamically.")
(declare-function prop-match-value "text-property-search" (match))
@@ -193,7 +199,7 @@ the documentation of the command bound to that key
sequence."
(let ((max-key-len 0) (max-cmd-len 0) keys)
(dolist (ent (reverse (cdr section)))
(catch 'skip
- (let* ((bind (where-is-internal (car ent) nil t))
+ (let* ((bind (where-is-internal (car ent) help-quick-use-map t))
(key (if bind
(propertize
(key-description bind)