[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu cc757e3: More robust deferred highlighting for or
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu cc757e3: More robust deferred highlighting for orderless |
Date: |
Sat, 26 Jun 2021 08:57:07 -0400 (EDT) |
branch: externals/corfu
commit cc757e3ae900125c762306f37efc72b1e95794e1
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
More robust deferred highlighting for orderless
---
corfu.el | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/corfu.el b/corfu.el
index c088f5f..e123bf4 100644
--- a/corfu.el
+++ b/corfu.el
@@ -349,9 +349,6 @@ filter string with spaces is allowed."
;; bug#47711: Deferred highlighting for `completion-all-completions'
;; XXX There is one complication: `completion--twq-all' already adds
`completions-common-part'.
-(declare-function orderless-highlight-matches "ext:orderless")
-(declare-function orderless-pattern-compiler "ext:orderless")
-(require 'orderless nil 'noerror)
(defun corfu--all-completions (&rest args)
"Compute all completions for ARGS with deferred highlighting."
(cl-letf* ((orig-pcm (symbol-function #'completion-pcm--hilit-commonality))
@@ -376,13 +373,16 @@ filter string with spaces is allowed."
(condition-case nil
(completion-pcm--hilit-commonality pattern x)
(t x))))
- cands))
- ((symbol-function #'orderless-highlight-matches)
- (lambda (pattern cands)
- (let ((regexps (orderless-pattern-compiler pattern)))
- (setq hl (lambda (x) (orderless-highlight-matches regexps
x))))
cands)))
- (cons (apply #'completion-all-completions args) hl)))
+ ;; Only advise orderless after it has been loaded to avoid load order
issues
+ (if (and (fboundp 'orderless-highlight-matches) (fboundp
'orderless-pattern-compiler))
+ (cl-letf (((symbol-function 'orderless-highlight-matches)
+ (lambda (pattern cands)
+ (let ((regexps (orderless-pattern-compiler pattern)))
+ (setq hl (lambda (x) (orderless-highlight-matches
regexps x))))
+ cands)))
+ (cons (apply #'completion-all-completions args) hl))
+ (cons (apply #'completion-all-completions args) hl))))
(defun corfu--sort-predicate (x y)
"Sorting predicate which compares X and Y."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/corfu cc757e3: More robust deferred highlighting for orderless,
ELPA Syncer <=