all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* grep-command: Ignore case if case-fold-search is non-nil
@ 2016-09-18  9:31 Tino Calancha
  2016-09-18  9:57 ` Dmitry Gutov
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Tino Calancha @ 2016-09-18  9:31 UTC (permalink / raw)
  To: Emacs developers; +Cc: tino.calancha


Hi,

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?

Regards,
Tino
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 5220d4858475f0825c01926456a8932079e3d0d7 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha@gmail.com>
Date: Sun, 18 Sep 2016 18:19:52 +0900
Subject: [PATCH] grep-compute-defaults: Ignore case if case-fold-search is
  non-nil

* lisp/progmodes/grep.el (grep-compute-defaults): Use option '-i'.
---
  lisp/progmodes/grep.el | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index f7f097b..ac871a1 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -590,7 +590,8 @@ grep-compute-defaults
      (unless (and grep-command grep-find-command
  		 grep-template grep-find-template)
        (let ((grep-options
-	     (concat (if grep-use-null-device "-n" "-nH")
+	     (concat (if grep-use-null-device "-n"
+                       (if case-fold-search "-nHi" "-nH"))
  		     (if (grep-probe grep-program
  				     `(nil nil nil "-e" "foo" 
,null-device)
  				     nil 1)
-- 
2.9.3

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



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

end of thread, other threads:[~2016-09-18 18:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-18  9:31 grep-command: Ignore case if case-fold-search is non-nil Tino Calancha
2016-09-18  9:57 ` Dmitry Gutov
2016-09-18 10:30   ` Tino Calancha
2016-09-18 10:52     ` Richard Copley
2016-09-18 11:09       ` Tino Calancha
2016-09-18 11:55         ` Dmitry Gutov
2016-09-18 14:45 ` Eli Zaretskii
2016-09-18 15:10   ` Tino Calancha
2016-09-18 16:52     ` Andreas Schwab
2016-09-18 18:03   ` Paul Eggert
2016-09-18 15:05 ` Drew Adams
2016-09-18 15:14   ` Tino Calancha
2016-09-18 15:39     ` Eli Zaretskii
2016-09-18 17:55     ` Drew Adams
2016-09-18 18:05       ` Tino Calancha
2016-09-18 18:16         ` Drew Adams

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.