Escape dash in xref rgrep regexp
* lisp/progmodes/xref.el (xref-collect-matches): Escape dash in REGEXP if it's the first character.
This commit is contained in:
parent
52feecd3c7
commit
8ba236e772
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue