about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-08-11 22:05:43 -0500
committerCase Duckworth2021-08-11 22:05:43 -0500
commit7936875a2f21a3b0952c732016ab3e0e8a632205 (patch)
tree1ab174df10923137294fd02030afa3940655e4ab
parentUse consult-rg BEFORE consult-git-grep (diff)
downloademacs-7936875a2f21a3b0952c732016ab3e0e8a632205.tar.gz
emacs-7936875a2f21a3b0952c732016ab3e0e8a632205.zip
Use Orderless Regexp Compiler for consult
-rw-r--r--init.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/init.el b/init.el index 8feab77..9aa18a4 100644 --- a/init.el +++ b/init.el
@@ -911,6 +911,15 @@ if ripgrep is installed, otherwise `consult-grep'."
911 (cond ((executable-find "locate") (call-interactively #'consult-locate)) 911 (cond ((executable-find "locate") (call-interactively #'consult-locate))
912 (t (call-interactively #'consult-find)))) 912 (t (call-interactively #'consult-find))))
913 913
914 ;; Orderless Regexp Compiler! -- from Consult Wiki
915 (defun consult--orderless-regexp-compiler (input type)
916 (setq input (orderless-pattern-compiler input))
917 (cons
918 (mapcar (lambda (r) (consult--convert-regexp r type)) input)
919 (lambda (str) (orderless--highlight input str))))
920
921 (setq consult--regexp-compiler #'consult--orderless-regexp-compiler)
922
914 ;; Bindings 923 ;; Bindings
915 (:global 924 (:global
916 ;; C-c bindings (`mode-specific-map') 925 ;; C-c bindings (`mode-specific-map')