mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
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:
parent
e776df2a3e
commit
500f5da5fb
1 changed files with 2 additions and 1 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue