branch: externals/vertico commit 1049ae18a9c6359ecfedeb7a20d4ee26d7b89585 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@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)))