branch: externals/marginalia commit e863b6cc855a1c5af3ac2594cb002d7e69b81a50 Author: Omar Antolín <omar.anto...@gmail.com> Commit: Omar Antolín <omar.anto...@gmail.com>
Show key bindings from minibuffer-selected-window After a discussion on Github we decided it was better to show the key bindings active in: (window-buffer (minibuffer-selected-window)) rather than: (window-buffer (next-window)) These should agree most of the time, but if the annotation function somehow gets called from outside the minibuffer the first expression should reduce to the current: (minibuffer-selected-window) returns nil and then window-buffer gives you the buffer of (selected-window). --- marginalia.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marginalia.el b/marginalia.el index f05c919..3ee86c4 100644 --- a/marginalia.el +++ b/marginalia.el @@ -123,7 +123,7 @@ Annotations are only shown if `marginalia-mode' is enabled." "Annotate command CAND with keybinding." ;; Taken from Emacs 28, read-extended-command--annotation (when-let* ((binding - (with-current-buffer (window-buffer (next-window)) + (with-current-buffer (window-buffer (minibuffer-selected-window)) (where-is-internal (intern cand) overriding-local-map t))) (desc (and (not (stringp binding)) (key-description binding)))) (propertize (format " (%s)" desc) 'face 'marginalia-key)))