[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/orderless d6eb575714 165/204: Merge pull request #44 fr
From: |
ELPA Syncer |
Subject: |
[elpa] externals/orderless d6eb575714 165/204: Merge pull request #44 from minad/invalid-regexp |
Date: |
Tue, 11 Jan 2022 12:58:27 -0500 (EST) |
branch: externals/orderless
commit d6eb575714f2d86ec7b0d5c42f9acb23ac439a02
Merge: 150155ce3c e5cb3f7b57
Author: Omar AntolĂn Camarena <omar.antolin@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #44 from minad/invalid-regexp
Minor invalid regexp improvements
---
README.org | 10 +++-------
orderless.el | 32 ++++++++++++++++----------------
2 files changed, 19 insertions(+), 23 deletions(-)
diff --git a/README.org b/README.org
index 5d809d3342..e0680a9dc2 100644
--- a/README.org
+++ b/README.org
@@ -100,11 +100,8 @@ define new matching styles. The predefined ones are:
- orderless-regexp :: the component is treated as a regexp that must
match somewhere in the candidate.
- If the component is not a valid regexp, it matches literally.
- (Having the component be invalid is actually pretty common while you
- are typing, so be prepared for the results to be a little funny
- before you close a bracket or parentheses, etc.)
-
+ If the component is not a valid regexp, it is ignored.
+
- orderless-literal :: the component is treated as a literal string
that must occur in the candidate.
@@ -117,7 +114,7 @@ define new matching styles. The predefined ones are:
probably don't want to use this style directly in
=orderless-matching-styles= but with a style dispatcher instead. There
is an example in the section on style dispatchers.
-
+
- orderless-prefixes :: the component is split at word endings and
each piece must match at a word boundary in the candidate, occurring
in that order.
@@ -406,4 +403,3 @@ you get out of order matching!
- Ivy has =ivy-restrict-to-matches=, bound to =S-SPC=, so you can get the
effect of out of order matching without using =ivy--regex-ignore-order=.
-
diff --git a/orderless.el b/orderless.el
index 5be0a12193..921fa0931c 100644
--- a/orderless.el
+++ b/orderless.el
@@ -187,10 +187,10 @@ is determined by the values of `completion-ignore-case',
;;; Matching styles
(defun orderless-regexp (component)
- "Match a component as a regexp."
+ "Match COMPONENT as a regexp."
(condition-case nil
(progn (string-match-p component "") component)
- (invalid-regexp (regexp-quote component))))
+ (invalid-regexp nil)))
(defalias 'orderless-literal #'regexp-quote
"Match a component as a literal string.
@@ -397,7 +397,9 @@ compilers."
(rx-to-string
`(or
,@(cl-loop for style in newstyles
- collect `(regexp ,(funcall style newcomp))))))))
+ for result = (funcall style newcomp)
+ if result
+ collect `(regexp ,result)))))))
;;; Completion style implementation
@@ -411,19 +413,17 @@ The predicate PRED is used to constrain the entries in
TABLE."
(defun orderless-filter (string table &optional pred)
"Split STRING into components and find entries TABLE matching all.
The predicate PRED is used to constrain the entries in TABLE."
- (condition-case nil
- (save-match-data
- (pcase-let* ((`(,prefix . ,pattern)
- (orderless--prefix+pattern string table pred))
- (completion-regexp-list
- (funcall orderless-pattern-compiler pattern))
- (completion-ignore-case
- (if orderless-smart-case
- (cl-loop for regexp in completion-regexp-list
- always (isearch-no-upper-case-p regexp t))
- completion-ignore-case)))
- (all-completions prefix table pred)))
- (invalid-regexp nil)))
+ (save-match-data
+ (pcase-let* ((`(,prefix . ,pattern)
+ (orderless--prefix+pattern string table pred))
+ (completion-regexp-list
+ (funcall orderless-pattern-compiler pattern))
+ (completion-ignore-case
+ (if orderless-smart-case
+ (cl-loop for regexp in completion-regexp-list
+ always (isearch-no-upper-case-p regexp t))
+ completion-ignore-case)))
+ (all-completions prefix table pred))))
;;;###autoload
(defun orderless-all-completions (string table pred _point)
- [elpa] externals/orderless 5897841be4 094/204: Rename default pattern compiler, (continued)
- [elpa] externals/orderless 5897841be4 094/204: Rename default pattern compiler, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 830976770b 102/204: Put integration before related packages in README, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 68e592055c 113/204: The transient variables should not be customizable, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 5b292ac136 118/204: Document custom splitter option, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 1d62307cce 125/204: Add badge., ELPA Syncer, 2022/01/11
- [elpa] externals/orderless cbc0109eac 136/204: Merge pull request #28 from b3n/patch-1, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless d1c0cbf87b 137/204: Add matching style and dispatcher per category overrides (fix #31), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 5dcf4a6f2b 135/204: Corrected broken link, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 701b6a07c8 156/204: orderless-try-completions: Remove _metadata argument, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless a609004d5f 159/204: Document that orderless-regexp matches invalid regexps literally, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless d6eb575714 165/204: Merge pull request #44 from minad/invalid-regexp,
ELPA Syncer <=
- [elpa] externals/orderless 87ab7e47e3 168/204: Merge pull request #46 from minad/remove-pattern-compiler-variable, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless d2891b807b 174/204: orderless+initialism example requires Marginalia (see #54), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless e4c38efcd6 176/204: README: Add variable category to orderless+initialism sample, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 871eb1d0f0 178/204: Use add-face-text-property, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless df4f29a4f4 183/204: Use minibuffer customization group, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 62f71c34ba 191/204: Extend prefix optimization to anchored quoted regexps (fix #81), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 75d3398056 192/204: Have orderless-try-completion return t for exact match (fix #95), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless c8731aacfa 197/204: Merge pull request #98 from minad/fix-try, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless f22789f358 202/204: Merge pull request #94 from minad/strict-initialism, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 855255eb01 198/204: Mention Corfu and consult-completion-in-region (fix #99), ELPA Syncer, 2022/01/11