]> git.eshelyaron.com Git - emacs.git/commitdiff
describe-keymap: Suggest symbol at point
authorVisuwesh <visuweshm@gmail.com>
Fri, 13 May 2022 07:39:55 +0000 (13:09 +0530)
committerEli Zaretskii <eliz@gnu.org>
Sun, 15 May 2022 05:23:05 +0000 (08:23 +0300)
* 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
lisp/help-fns.el

index f8f6d93cc26f6de8c5f5acde312b5d5b04ed7dca..4651977e610c60e3d81191e8cbe7c518a38874c9 100644 (file)
--- 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
 
 +++
index f2b469c14931472cb796742f8e1315c01039b233..1ff47bcb496b2842df3fd4f89139c9feb1dcaf64 100644 (file)
@@ -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