branch: externals/consult commit 54e2f1845d8ae129c0c4b0efd6832fc53ec12fca Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Fix consult--join-regexps-permutations --- consult.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/consult.el b/consult.el index 31647cddb9..0d84d60cd5 100644 --- a/consult.el +++ b/consult.el @@ -1181,19 +1181,18 @@ matches case insensitively." (message "Too many regexps, %S ignored. Use post-filtering!" (string-join (seq-drop regexps 3) " ")) (setq regexps (seq-take regexps 3))) - (consult--regexp-join-permutations regexps (and (eq type 'emacs) "\\"))))) + (consult--join-regexps-permutations regexps (and (eq type 'emacs) "\\"))))) -(defun consult--regexp-join-permutations (regexps esc) +(defun consult--join-regexps-permutations (regexps esc) "Join all permutations of REGEXPS. ESC is the escaping string for choice and groups." (pcase regexps ('nil "") (`(,r) r) - (`(,r1 ,r2) (concat r1 ".*" r2 esc "|" r2 ".*" r1)) (_ (mapconcat (lambda (r) - (concat r ".*" esc "(" - (consult--regexp-join-permutations (remove r regexps) esc) + (concat esc "(" r esc ").*" esc "(" + (consult--join-regexps-permutations (remove r regexps) esc) esc ")")) regexps (concat esc "|")))))