emacs-devel
[Top][All Lists]
Advanced

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

Re: grep-command: Ignore case if case-fold-search is non-nil


From: Tino Calancha
Subject: Re: grep-command: Ignore case if case-fold-search is non-nil
Date: Sun, 18 Sep 2016 19:30:20 +0900 (JST)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)



On Sun, 18 Sep 2016, Dmitry Gutov wrote:

On 18.09.2016 12:31, Tino Calancha wrote:

Do you think `grep-compute-defaults' should add '-i', i.e., ignore case,
in the default `grep-command' when `case-fold-search' is non-nil?
Option '-i' is specified by POSIX, do we need to check if `grep-program'
support it?

grep-options is used in both grep-template and grep-find-template.

And they both get "-i" inserted into later, in grep-expand-template.
Thank you.
Tha's right: `rgrep' and `lgrep' default to case _insensitive_ search; but `grep-find' defaults to case _sensitive_ search.

emacs -Q
M-: (dired (concat source-directory "/lisp")) RET
M-x: lgrep RET undid RET replace.el RET RET
;; Found a match (same for rgrep)
M-x: grep-find RET
;; show a case sensitive default command as follows:
find . -type f -exec grep --color -nH -e  \{\} +

I would suggest to be instead:
find . -type f -exec grep --color -nHi -e  \{\} +

that would be consistent with defaults for `rgrep' and `lgrep'.
What do you think?

Tino



reply via email to

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