Commit 8ba236e7 authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

Escape dash in xref rgrep regexp

* lisp/progmodes/xref.el (xref-collect-matches): Escape dash
in REGEXP if it's the first character.
parent 52feecd3
......@@ -918,6 +918,10 @@ IGNORES is a list of glob patterns."
(grep-compute-defaults)
(defvar grep-find-template)
(defvar grep-highlight-matches)
;; 'grep -E -foo' results in 'grep: oo: No such file or directory'.
;; while 'grep -e -foo' inexplicably doesn't.
(when (eq (aref regexp 0) ?-)
(setq regexp (concat "\\" regexp)))
(let* ((grep-find-template (replace-regexp-in-string "-e " "-E "
grep-find-template t t))
(grep-highlight-matches nil)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment