emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 8ba236e 2/2: Escape dash in xref rgrep regexp


From: npostavs
Subject: [Emacs-diffs] master 8ba236e 2/2: Escape dash in xref rgrep regexp
Date: Tue, 31 Jan 2017 20:40:05 -0500

> +  ;; 'grep -E -foo' results in 'grep: oo: No such file or directory'.
> +  ;; while 'grep -e -foo' inexplicably doesn't.

"-E" says to use extended regexp syntax for patterns.  "-e" says the
next argument is a pattern.

> +  (when (eq (aref regexp 0) ?-)
> +    (setq regexp (concat "\\" regexp)))
>    (let* ((grep-find-template (replace-regexp-in-string "-e " "-E "
>                                                         grep-find-template t 
> t))

So they're not interchangeable, and I don't see why we're replacing "-e"
with "-E".  I guess (replace-regexp-in-string "<C>" "<C> -E"
grep-find-template t t) would make more sense.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]