unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [Emacs-diffs] master 8ba236e 2/2: Escape dash in xref rgrep regexp
@ 2017-02-01  1:40 npostavs
  2017-02-03  1:12 ` Dmitry Gutov
  0 siblings, 1 reply; 2+ messages in thread
From: npostavs @ 2017-02-01  1:40 UTC (permalink / raw)
  To: emacs-devel, dgutov

> +  ;; '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.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Emacs-diffs] master 8ba236e 2/2: Escape dash in xref rgrep regexp
  2017-02-01  1:40 [Emacs-diffs] master 8ba236e 2/2: Escape dash in xref rgrep regexp npostavs
@ 2017-02-03  1:12 ` Dmitry Gutov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Gutov @ 2017-02-03  1:12 UTC (permalink / raw)
  To: npostavs, emacs-devel

On 01.02.2017 03:40, npostavs@users.sourceforge.net wrote:

> 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.

Great suggestion. Thanks!



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-03  1:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-01  1:40 [Emacs-diffs] master 8ba236e 2/2: Escape dash in xref rgrep regexp npostavs
2017-02-03  1:12 ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).