Simplify xref regular expression with rx
* lisp/progmodes/xref.el (xref--regexp-to-extended): switch to rx regular expression for legibility
This commit is contained in:
@@ -2076,7 +2076,8 @@ directory, used as the root of the ignore globs."
|
||||
(replace-regexp-in-string
|
||||
;; FIXME: Add tests. Move to subr.el, make a public function.
|
||||
;; Maybe error on Emacs-only constructs.
|
||||
"\\(?:\\\\\\\\\\)*\\(?:\\\\[][]\\)?\\(?:\\[.+?\\]\\|\\(\\\\?[(){}|]\\)\\)"
|
||||
(rx (zero-or-more "\\\\") (opt "\\" (any "[]"))
|
||||
(or (seq "[" (+? nonl) "]") (group (opt "\\") (any "(){|}"))))
|
||||
(lambda (str)
|
||||
(cond
|
||||
((not (match-beginning 1))
|
||||
|
||||
Reference in New Issue
Block a user