[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult 54e2f1845d 2/3: Fix consult--join-regexps-permu
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult 54e2f1845d 2/3: Fix consult--join-regexps-permutations |
Date: |
Wed, 22 Mar 2023 08:57:38 -0400 (EDT) |
branch: externals/consult
commit 54e2f1845d8ae129c0c4b0efd6832fc53ec12fca
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@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 "|")))))