emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 9ac40fb980: describe-keymap: Suggest symbol at point


From: Eli Zaretskii
Subject: master 9ac40fb980: describe-keymap: Suggest symbol at point
Date: Sun, 15 May 2022 01:24:44 -0400 (EDT)

branch: master
commit 9ac40fb9803acd57b15ef4b93ea9c8c72199ea23
Author: Visuwesh <visuweshm@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>

    describe-keymap: Suggest symbol at point
    
    * lisp/help-fns.el (describe-keymap): Suggest symbol at point
    if it is a keymap.  (Bug#55393)
    * etc/NEWS: Announce change in behavior of 'describe-keymap'.
---
 etc/NEWS         | 5 +++++
 lisp/help-fns.el | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index f8f6d93cc2..4651977e61 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -562,6 +562,11 @@ minor modes are listed after the major mode.
 The apropos commands will now select the apropos window if
 'help-window-select' is non-nil.
 
+---
+*** 'describe-keymap' now considers the symbol at point.
+If the symbol at point is a keymap, 'describe-keymap' suggests it as
+the default candidate.
+
 ** Outline Mode
 
 +++
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index f2b469c149..1ff47bcb49 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1922,7 +1922,10 @@ in `describe-keymap'.  See also `Searching the Active 
Keymaps'."
 When called interactively, prompt for a variable that has a
 keymap value."
   (interactive
-   (let* ((km (help-fns--most-relevant-active-keymap))
+   (let* ((sym (symbol-at-point))
+          (km (or (and (keymapp (ignore-errors (symbol-value sym)))
+                       sym)
+                  (help-fns--most-relevant-active-keymap)))
           (val (completing-read
                 (format-prompt "Keymap" km)
                 obarray



reply via email to

[Prev in Thread] Current Thread [Next in Thread]