[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult 05089f0 2/5: Add lookahead wrapper only if ther
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult 05089f0 2/5: Add lookahead wrapper only if there is more than one regular expression |
Date: |
Thu, 5 Aug 2021 15:57:09 -0400 (EDT) |
branch: externals/consult
commit 05089f0f8e3d7fd0493700076d021c30afb6a582
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Add lookahead wrapper only if there is more than one regular expression
---
consult.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/consult.el b/consult.el
index 3a8adfc..5744308 100644
--- a/consult.el
+++ b/consult.el
@@ -581,10 +581,11 @@ This function only changes the escaping of parentheses,
braces and pipes."
(defun consult--join-regexp (str type)
"Compile STR to a regexp joined from multiple regexps of TYPE."
(setq str (consult--compile-regexp str type))
- (pcase-exhaustive type
- ((or 'basic 'emacs 'extended) (string-join str ".*"))
- ('pcre (concat "^" (mapconcat (lambda (x) (format "(?=.*%s)" x))
- str "")))))
+ ;; Add lookahead wrapper only if there is more than one regular expression
+ (if (and (eq type 'pcre) (cdr str))
+ (concat "^" (mapconcat (lambda (x) (format "(?=.*%s)" x))
+ str ""))
+ (string-join str ".*")))
(defun consult--valid-regexp-p (re)
"Return t if regexp RE is valid."
- [elpa] externals/consult updated (f31ac4d -> bf598c8), ELPA Syncer, 2021/08/05
- [elpa] externals/consult 1d50745 1/5: Update comment, ELPA Syncer, 2021/08/05
- [elpa] externals/consult 05089f0 2/5: Add lookahead wrapper only if there is more than one regular expression,
ELPA Syncer <=
- [elpa] externals/consult 95dadd9 4/5: Ripgrep regular expressions are perl-style, but without lookahead, ELPA Syncer, 2021/08/05
- [elpa] externals/consult ddc67f1 3/5: consult--convert-regexp: Use \z instead of \Z, ELPA Syncer, 2021/08/05
- [elpa] externals/consult bf598c8 5/5: Always treat \` and \' as ^ and $ respectively, ELPA Syncer, 2021/08/05