[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/orderless 8cea82b6d3 194/204: Merge pull request #97 fr
From: |
ELPA Syncer |
Subject: |
[elpa] externals/orderless 8cea82b6d3 194/204: Merge pull request #97 from minad/optimize-try |
Date: |
Tue, 11 Jan 2022 12:58:30 -0500 (EST) |
branch: externals/orderless
commit 8cea82b6d395078d0105f4957d4a95206dc9c7ba
Merge: 75d3398056 9c1b276fe4
Author: Omar AntolĂn Camarena <omar.antolin@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #97 from minad/optimize-try
Optimize orderless-try-completion
---
orderless.el | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/orderless.el b/orderless.el
index a458f329d5..9250756688 100644
--- a/orderless.el
+++ b/orderless.el
@@ -458,17 +458,24 @@ match, it completes to that match. If there are no
matches, it
returns nil. In any other case it \"completes\" STRING to
itself, without moving POINT.
This function is part of the `orderless' completion style."
- (let ((all (orderless-filter string table pred)))
- (cond
- ((null all) nil)
- ((null (cdr all))
- (if (equal string (car all))
- t ; unique exact match
- (let ((full (concat
- (car (orderless--prefix+pattern string table pred))
- (car all))))
- (cons full (length full)))))
- (t (cons string point)))))
+ (catch 'orderless--many
+ (let (one)
+ ;; Abuse all-completions/orderless-filter as a fast search loop.
+ ;; Should be more or less allocation-free since our "predicate"
+ ;; always returns nil.
+ (orderless-filter string table
+ (lambda (str)
+ (when (or (not pred) (funcall pred str))
+ (when one
+ (throw 'orderless--many (cons string point)))
+ (setq one str))
+ nil))
+ (when one
+ (if (equal string one)
+ t ;; unique exact match
+ (setq one (concat (car (orderless--prefix+pattern string table pred))
+ one))
+ (cons one (length one)))))))
;;;###autoload
(add-to-list 'completion-styles-alist
- [elpa] externals/orderless f6394f19f3 163/204: orderless-default-pattern-compiler: Ignore nil components, (continued)
- [elpa] externals/orderless f6394f19f3 163/204: orderless-default-pattern-compiler: Ignore nil components, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 3440b5aa33 162/204: orderless-regexp: Return "null matcher" if regexp is invalid, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 818af9e6f0 167/204: Remove pattern compiler variable, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 9637d7fd59 177/204: Merge pull request #56 from minad/readme-fix, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 2646dad28c 182/204: Update manual to mention Vertico, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless f7be0fb8ee 180/204: Make strict initialism independent of syntax tables (fix #60), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 1e84120a28 184/204: Merge pull request #70 from minad/group, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 268e56d436 186/204: Fix orderless-escapable-split-on-space, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 665ade9984 187/204: Merge pull request #76 from minad/fix-split, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 1a7011ac9c 189/204: Merge pull request #77 from minad/fix-split2, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 8cea82b6d3 194/204: Merge pull request #97 from minad/optimize-try,
ELPA Syncer <=
- [elpa] externals/orderless c615334c79 196/204: Simplify, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 1e59cf2b9c 195/204: Fix orderless-try-completion for hash tables and alists, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 4e4774474c 201/204: Remove strict initialism code by @noctuid, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 1ccf74ffdb 200/204: Fix small bug in the alist case of try-completion, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 0f674253a8 199/204: Reword sentence for clarity, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 3678f84606 204/204: Add "This file is part of GNU Emacs", ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 5af63c1217 058/204: Merge remote-tracking branch 'github/master', ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 60e70aa53b 062/204: Add autoloads, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless b0913a9c56 044/204: Placate checkdoc again, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless f2ccc538ef 061/204: Refactor to provide reusable filtering and highlightinf functions, ELPA Syncer, 2022/01/11