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

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

[elpa] externals/orderless 9e810f43f0 21/25: Simplify orderless--compile


From: ELPA Syncer
Subject: [elpa] externals/orderless 9e810f43f0 21/25: Simplify orderless--compile-component
Date: Wed, 21 Feb 2024 12:58:52 -0500 (EST)

branch: externals/orderless
commit 9e810f43f0152148f34ab5c84ab311da6bfc8762
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Simplify orderless--compile-component
---
 orderless.el | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/orderless.el b/orderless.el
index 98e4080aca..395f1f28f6 100644
--- a/orderless.el
+++ b/orderless.el
@@ -383,21 +383,19 @@ DEFAULT as the list of styles."
 
 (defun orderless--compile-component (component idx total styles dispatchers)
   "Compile COMPONENT at IDX of TOTAL components with STYLES and DISPATCHERS."
-  (pcase-let ((`(,newsty . ,newcomp) (orderless--dispatch dispatchers styles 
component idx total)))
-    (when (functionp newsty)
-      (setq newsty (list newsty)))
-    (cl-loop
-     with pred = nil
-     for style in newsty
-     for res = (condition-case nil
-                   (funcall style newcomp)
-                 (wrong-number-of-arguments
-                  (when-let ((res (orderless--compile-component newcomp idx 
total styles dispatchers)))
-                    (funcall style (car res) (cdr res)))))
-     if (functionp res) do (cl-callf orderless--predicate-and pred res)
-     else if res collect (if (stringp res) `(regexp ,res) res) into regexps
-     finally return
-     (and (or pred regexps) (cons pred (and regexps (rx-to-string `(or 
,@(delete-dups regexps)))))))))
+  (cl-loop
+   with pred = nil
+   with (newsty . newcomp) = (orderless--dispatch dispatchers styles component 
idx total)
+   for style in (if (functionp newsty) (list newsty) newsty)
+   for res = (condition-case nil
+                 (funcall style newcomp)
+               (wrong-number-of-arguments
+                (when-let ((res (orderless--compile-component newcomp idx 
total styles dispatchers)))
+                  (funcall style (car res) (cdr res)))))
+   if (functionp res) do (cl-callf orderless--predicate-and pred res)
+   else if res collect (if (stringp res) `(regexp ,res) res) into regexps
+   finally return
+   (and (or pred regexps) (cons pred (and regexps (rx-to-string `(or 
,@(delete-dups regexps))))))))
 
 (defun orderless-compile (pattern &optional styles dispatchers)
   "Build regexps to match the components of PATTERN.



reply via email to

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