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

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

[elpa] externals/vertico 487fa022df 3/4: Minor cleanup


From: ELPA Syncer
Subject: [elpa] externals/vertico 487fa022df 3/4: Minor cleanup
Date: Sun, 26 Dec 2021 08:57:51 -0500 (EST)

branch: externals/vertico
commit 487fa022dfd157f043c018a0fd3442221f2d4330
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Minor cleanup
---
 extensions/vertico-multiform.el | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/extensions/vertico-multiform.el b/extensions/vertico-multiform.el
index ef76a78860..c2c7df6bd7 100644
--- a/extensions/vertico-multiform.el
+++ b/extensions/vertico-multiform.el
@@ -100,18 +100,14 @@ APP is the original function call."
                                   (if (fboundp v) v m)))
                               (or (and cat (alist-get cat 
vertico-multiform-category-modes))
                                   (alist-get this-command 
vertico-multiform-command-modes))))))
-            (cond
-             ((= depth (recursion-depth))
-              (mapc (lambda (f) (funcall f 1)) modes))
-             ((= (1+ depth) (recursion-depth))
-              (mapc (lambda (f) (funcall f -1)) modes)))))
+            (pcase (- (recursion-depth) depth)
+              (0 (mapc (lambda (f) (funcall f 1)) modes))
+              (1 (mapc (lambda (f) (funcall f -1)) modes)))))
     (fset exit
           (lambda ()
-            (cond
-             ((= depth (recursion-depth))
-              (mapc (lambda (f) (funcall f -1)) modes))
-             ((= (1+ depth) (recursion-depth))
-              (mapc (lambda (f) (funcall f 1)) modes)))))
+            (pcase (- (recursion-depth) depth)
+              (0 (mapc (lambda (f) (funcall f -1)) modes))
+              (1 (mapc (lambda (f) (funcall f 1)) modes)))))
     ;; NOTE: The setup/exit nesting is only correct for shallow recursions.
     ;; Hopefully nobody is crazy enough to work at recursion level 99.
     (add-hook 'minibuffer-setup-hook setup (+ -99 depth))



reply via email to

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