emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/marginalia e863b6c 007/241: Show key bindings from mini


From: Stefan Monnier
Subject: [elpa] externals/marginalia e863b6c 007/241: Show key bindings from minibuffer-selected-window
Date: Fri, 28 May 2021 20:48:46 -0400 (EDT)

branch: externals/marginalia
commit e863b6cc855a1c5af3ac2594cb002d7e69b81a50
Author: Omar Antolín <omar.antolin@gmail.com>
Commit: Omar Antolín <omar.antolin@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)))



reply via email to

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