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

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

[elpa] externals/marginalia 7a0c2c6 173/241: marginalia-cycle: remove mi


From: Stefan Monnier
Subject: [elpa] externals/marginalia 7a0c2c6 173/241: marginalia-cycle: remove minibuffer local behavior
Date: Fri, 28 May 2021 20:49:21 -0400 (EDT)

branch: externals/marginalia
commit 7a0c2c61c6c2898f351bfd6a31767ff05e444da9
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    marginalia-cycle: remove minibuffer local behavior
    
    * Simply change the annotations globally
    * The local behavior is confusing and unnecessary
    * It does not work well with annotate-consult-multi
---
 marginalia.el | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 245a057..106c438 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -712,20 +712,10 @@ Remember `this-command' for 
`marginalia-classify-by-command-name'."
 ;; the discussion in https://github.com/minad/marginalia/issues/10 for 
reference.
 ;;;###autoload
 (defun marginalia-cycle ()
-  "Cycle between annotators in `marginalia-annotators'.
-If called from the minibuffer the annotator cycling is local,
-that it is, it does not affect subsequent minibuffers.  When called
-from a regular buffer the effect is global."
+  "Cycle between annotators in `marginalia-annotators'."
   (interactive)
-  ;; If `marginalia-cycle' has been invoked from inside the minibuffer, only 
change the annotators
-  ;; locally. This is useful if the command is used as an action. If the 
command is not triggered
-  ;; from inside the minibuffer, cycle the annotator globally. Hopefully this 
is not too confusing.
-  (if-let* ((win (active-minibuffer-window))
-            (buf (window-buffer win)))
-      (let ((a (buffer-local-value 'marginalia-annotators buf)))
-        (setf (buffer-local-value 'marginalia-annotators buf) (append (cdr a) 
(list (car a)))))
-    (let ((a marginalia-annotators))
-      (setq marginalia-annotators (append (cdr a) (list (car a)))))))
+  (setq marginalia-annotators (append (cdr marginalia-annotators)
+                                      (list (car marginalia-annotators)))))
 
 (provide 'marginalia)
 ;;; marginalia.el ends here



reply via email to

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