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

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

[elpa] externals/corfu e6e8fa6684 2/2: Revert "Simplify the definition o


From: ELPA Syncer
Subject: [elpa] externals/corfu e6e8fa6684 2/2: Revert "Simplify the definition of the minor-mode (#243)"
Date: Tue, 8 Nov 2022 03:57:32 -0500 (EST)

branch: externals/corfu
commit e6e8fa6684396e6efe1c29c4413657f0bb76ce03
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Revert "Simplify the definition of the minor-mode (#243)"
    
    This reverts commit 4ea3f80957194358ad9fe56d91e8a594a6ab7562.
---
 extensions/corfu-indexed.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/extensions/corfu-indexed.el b/extensions/corfu-indexed.el
index 3bdbf396f7..a50773eb07 100644
--- a/extensions/corfu-indexed.el
+++ b/extensions/corfu-indexed.el
@@ -94,14 +94,15 @@
 (define-minor-mode corfu-indexed-mode
   "Prefix candidates with indices."
   :global t :group 'corfu
-  (if corfu-indexed-mode
-      (progn
-        (advice-add #'corfu--affixate :filter-return #'corfu-indexed--affixate)
-        (dolist (cmd corfu-indexed--commands)
-          (advice-add cmd :around #'corfu-indexed--handle-prefix)))
+  (cond
+   (corfu-indexed-mode
+    (advice-add #'corfu--affixate :filter-return #'corfu-indexed--affixate)
+    (dolist (cmd corfu-indexed--commands)
+      (advice-add cmd :around #'corfu-indexed--handle-prefix)))
+   (t
     (advice-remove #'corfu--affixate #'corfu-indexed--affixate)
     (dolist (cmd corfu-indexed--commands)
-      (advice-remove cmd #'corfu-indexed--handle-prefix))))
+      (advice-remove cmd #'corfu-indexed--handle-prefix)))))
 
 (provide 'corfu-indexed)
 ;;; corfu-indexed.el ends here



reply via email to

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