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

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

[elpa] externals/vertico 1049ae1 2/2: Improve orderless support


From: Protesilaos Stavrou
Subject: [elpa] externals/vertico 1049ae1 2/2: Improve orderless support
Date: Fri, 7 May 2021 07:18:16 -0400 (EDT)

branch: externals/vertico
commit 1049ae18a9c6359ecfedeb7a20d4ee26d7b89585
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Improve orderless support
    
    Precompile the regular expressions in order to handle local overrides of
    orderless-matching-styles etc.
---
 vertico.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vertico.el b/vertico.el
index 2e27c1f..597b062 100644
--- a/vertico.el
+++ b/vertico.el
@@ -224,6 +224,7 @@
 ;; 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 vertico--all-completions (&rest args)
   "Compute all completions for ARGS with deferred highlighting."
@@ -247,7 +248,8 @@
                 cands))
              ((symbol-function #'orderless-highlight-matches)
               (lambda (pattern cands)
-                (setq hl (lambda (x) (orderless-highlight-matches pattern x)))
+                (let ((regexps (orderless-pattern-compiler pattern)))
+                  (setq hl (lambda (x) (orderless-highlight-matches regexps 
x))))
                 cands)))
     (cons (apply #'completion-all-completions args) hl)))
 



reply via email to

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