[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult bf598c8 5/5: Always treat \` and \' as ^ and $
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult bf598c8 5/5: Always treat \` and \' as ^ and $ respectively |
Date: |
Thu, 5 Aug 2021 15:57:10 -0400 (EDT) |
branch: externals/consult
commit bf598c8552613cf747746cee2a302701e9b2beff
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Always treat \` and \' as ^ and $ respectively
---
consult.el | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/consult.el b/consult.el
index 904c8c3..2940e57 100644
--- a/consult.el
+++ b/consult.el
@@ -562,12 +562,14 @@ This function only changes the escaping of parentheses,
braces and pipes."
(let ((swap '(("\\|" . "|")
("\\(" . "(") ("\\)" . ")")
("\\{" . "{") ("\\}" . "}")))
- (subst (if (memq type '(pcre rust))
- ;; \z matches at the end, \Z matches at the end and
before the last \n
- '(("\\`" . "\\A") ("\\'" . "\\z")
- ("\\<" . "\\b") ("\\>" . "\\b")
- ("\\_<" . "\\b") ("\\_>" . "\\b"))
- '(("\\_<" . "\\<") ("\\_>" . "\\>")))))
+ (subst (append
+ ;; Treat \` and \' as beginning and end of line. This is more
+ ;; widely supported and makes sense for line-based commands.
+ '(("\\`" . "^") ("\\'" . "$"))
+ (if (memq type '(pcre rust))
+ '(("\\<" . "\\b") ("\\>" . "\\b")
+ ("\\_<" . "\\b") ("\\_>" . "\\b"))
+ '(("\\_<" . "\\<") ("\\_>" . "\\>"))))))
(replace-regexp-in-string
"\\\\\\\\\\|\\\\?[(){}|]\\|\\\\[`'<>]\\|\\\\_[<>]"
(lambda (x)
@@ -4069,7 +4071,7 @@ INITIAL is inital input."
(with-temp-buffer
(insert "xaxbx")
(eq 0 (apply #'call-process-region (point-min) (point-max)
- (car cmd) nil nil nil `(,@cmd "^(?=.*b)(?=.*a)")))))
+ (car cmd) nil nil nil `(,@(cdr cmd) "^(?=.*b)(?=.*a)")))))
(defvar consult--grep-regexp-type nil)
(defun consult--grep-regexp-type ()
- [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, 2021/08/05
- [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 <=