From: Visuwesh Date: Fri, 13 May 2022 07:39:55 +0000 (+0530) Subject: describe-keymap: Suggest symbol at point X-Git-Tag: emacs-29.0.90~1910^2~682 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9ac40fb9803acd57b15ef4b93ea9c8c72199ea23;p=emacs.git 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'. --- diff --git a/etc/NEWS b/etc/NEWS index f8f6d93cc26..4651977e610 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 f2b469c1493..1ff47bcb496 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