aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Colascione2024-10-05 22:07:11 -0400
committerDaniel Colascione2024-10-05 22:40:23 -0400
commit500f5da5fb62cd0bbded8df754d93e3147d1d847 (patch)
treec3e54d1e0dc2f07a24c6f7a443970791edbede4e
parente776df2a3eae0454ea85287e15ebba649bf8e918 (diff)
downloademacs-500f5da5fb62cd0bbded8df754d93e3147d1d847.tar.gz
emacs-500f5da5fb62cd0bbded8df754d93e3147d1d847.zip
Simplify xref regular expression with rx
* lisp/progmodes/xref.el (xref--regexp-to-extended): switch to rx regular expression for legibility
-rw-r--r--lisp/progmodes/xref.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index b841dc1d179..28bd42aebde 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -2076,7 +2076,8 @@ directory, used as the root of the ignore globs."
2076 (replace-regexp-in-string 2076 (replace-regexp-in-string
2077 ;; FIXME: Add tests. Move to subr.el, make a public function. 2077 ;; FIXME: Add tests. Move to subr.el, make a public function.
2078 ;; Maybe error on Emacs-only constructs. 2078 ;; Maybe error on Emacs-only constructs.
2079 "\\(?:\\\\\\\\\\)*\\(?:\\\\[][]\\)?\\(?:\\[.+?\\]\\|\\(\\\\?[(){}|]\\)\\)" 2079 (rx (zero-or-more "\\\\") (opt "\\" (any "[]"))
2080 (or (seq "[" (+? nonl) "]") (group (opt "\\") (any "(){|}"))))
2080 (lambda (str) 2081 (lambda (str)
2081 (cond 2082 (cond
2082 ((not (match-beginning 1)) 2083 ((not (match-beginning 1))