[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult 7927a8b 3/4: Use rx syntax
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult 7927a8b 3/4: Use rx syntax |
Date: |
Thu, 5 Aug 2021 17:57:07 -0400 (EDT) |
branch: externals/consult
commit 7927a8b81057cd6fa136611d0a39e96489344a71
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Use rx syntax
---
consult.el | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/consult.el b/consult.el
index be6bdb0..f803fb5 100644
--- a/consult.el
+++ b/consult.el
@@ -581,14 +581,12 @@ This function only changes the escaping of parentheses,
braces and pipes."
("\\_<" . "\\b") ("\\_>" . "\\b"))
'(("\\_<" . "\\<") ("\\_>" . "\\>"))))))
(replace-regexp-in-string
- (string-join
- '("\\\\\\(?:(\\|(\\?:\\||\\)[+*]" ;; (+ or (?:* etc
- "\\`[+*]" ;; + or * at the beginning
- "\\\\\\\\" ;; backslash
- "\\\\?[(){}|]" ;; parentheses/braces/pipe, escaped
and unescaped
- "\\\\[`'<>]" ;; special escapes
- "\\\\_[<>]") ;; beginning/end of symbol
- "\\|")
+ (rx (or (seq "\\" (or "(?:" "(" "|") (any "*+")) ;; (+ or (?:* etc
+ (seq bos (any "*+")) ;; + or * at the
beginning
+ "\\\\" ;; backslash
+ (seq (opt "\\") (any "(){|}")) ;; parens/braces/pipe
+ (seq "\\" (any "'<>`")) ;; special escapes
+ (seq "\\_" (any "<>")))) ;; beginning/end of
symbol
(lambda (x) (or (cdr (assoc x subst)) x))
regexp 'fixedcase 'literal))))