[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.
- [elpa] externals/orderless updated (61aed3e622 -> 91df48c8e1), ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 41a9d218e6 06/25: orderless-pattern-compiler: Simplify slightly, remove variable pred, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 3e8f2c6616 07/25: Add orderless--component-compiler and use it in orderless-without/annotation, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless dc89fdfa01 08/25: Rename orderless-dispatch to orderless--dispatch, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 604c05f436 09/25: Rename orderless-pattern-compiler to orderless-compile, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless a89ac17b41 10/25: orderless-affix-dispatch: Ignore single dispatcher character, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 61815c7ed9 16/25: Alternative approach: Add COMPILE arg to orderless-annotation/without, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 87640f7061 12/25: orderless-without: orderless--compile-component can return nil, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 45d5d457b2 20/25: Update commentary, recommend (setq completion-styles '(orderless basic)), ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 7af2ee23d8 22/25: orderless-compile: Expand docstring, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 9e810f43f0 21/25: Simplify orderless--compile-component,
ELPA Syncer <=
- [elpa] externals/orderless 91df48c8e1 25/25: Merge pull request #162 from minad/annotation-matching, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 71a4557269 19/25: Rename orderless-without to orderless-not, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless c1def76024 01/25: Pattern compiler: Compile to regexps and a predicate function, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless b770a4de47 05/25: Remove orderless--predicate-or, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 10bce1bcde 02/25: orderless-annotation, orderless-without-regexp: Check validity, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 0e9fe2e902 03/25: orderless-annotation: Also check completion-extra-properties, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 7c99212dd3 17/25: Alternative 2: Compile component before passing it to orderless-annotation, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless b56db3eea4 18/25: Turn orderless-annotation/without into a "pattern transformer", ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 37c0083736 14/25: orderless--dispatch: Explicitly specify the arguments, ELPA Syncer, 2024/02/21
- [elpa] externals/orderless 766a194b90 13/25: Use orderless--dispatch in orderless--compile-component, ELPA Syncer, 2024/02/21