From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: grep-command: Ignore case if case-fold-search is non-nil Date: Sun, 18 Sep 2016 20:09:03 +0900 (JST) Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Trace: blaine.gmane.org 1474197056 23964 195.159.176.226 (18 Sep 2016 11:10:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 18 Sep 2016 11:10:56 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: Dmitry Gutov , Emacs developers , Tino Calancha To: Richard Copley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 18 13:10:52 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blZzl-0005O9-7v for ged-emacs-devel@m.gmane.org; Sun, 18 Sep 2016 13:10:49 +0200 Original-Received: from localhost ([::1]:49561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blZzj-0004Jb-HL for ged-emacs-devel@m.gmane.org; Sun, 18 Sep 2016 07:10:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blZzC-0004J4-Ko for emacs-devel@gnu.org; Sun, 18 Sep 2016 07:10:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1blZz6-0002IL-JI for emacs-devel@gnu.org; Sun, 18 Sep 2016 07:10:13 -0400 Original-Received: from mail-pa0-f49.google.com ([209.85.220.49]:36811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blZz6-0002Gx-Dw for emacs-devel@gnu.org; Sun, 18 Sep 2016 07:10:08 -0400 Original-Received: by mail-pa0-f49.google.com with SMTP id id6so39428084pad.3 for ; Sun, 18 Sep 2016 04:10:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=5+Kecwd5XlOglCwcmH5rQQ1D1jtkKnb7gFrQ5C83t6k=; b=OLwAP/jjTmT46if/GWr0lh3scQwuio1IyEQvprYHaBT6QDjLI8duwnYF/CtcGRn8S4 zktCl2eCrxXqLs/biBqf3lh+CQILTWMAp8v1kgfNkYlzUrgvWzHdn9tVzRa8uC/R/J7c y4lFNaijZ9fntiw4MemiDERGRbmkrn3j191GxcE9ujy5BT3wQyAvT3z+Tnho/HFPjRYO SggYI8crTg/GZBRB46lE2xF+m93J4hHDPWZERtElUUVCSGoZ/3HSWvg9zCc+hYSOJr8c iYuc3FPiCP4RIHppBEpd9f+QS0yPC8LERH53gJnnVHGd2pAz5TDyEMrJfMxoo2oiPozl qwOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=5+Kecwd5XlOglCwcmH5rQQ1D1jtkKnb7gFrQ5C83t6k=; b=YCKONZaeS/gA8KiOi0A8bqHiyb2R1mqdPbeIfxmi0DGJjjsRduE1fGwJdqUovY6sDE J30WNm+ILS9Z0ZURF1XnfqQbeiSt7FtRU7ZJkCur4ntG1QAoOQ+nbUYzUMtt6FwhlEC6 jw4W7bXkm5S7QjDLFSBbBwk+VrJZs5AQbLf2Jz/R0TuEG+Ou0mrN4E0HimOT1tmmqo9l t2ZoUMQq0mgwiDO1YtgEiGUMYT0DuiU2jBLUaqSXBpaguEk+467xjt0nWsBqdYRr3hxd RCKcPP0SoY7wTPd7hFM1D2SzdqhB6IqMkeOM6CoSqlC0EXYqnJVe4qaRDHoERgeucbk7 pcVQ== X-Gm-Message-State: AE9vXwPORdxK0bo6x7wn7jFB/olyb1FZ3cVu1VITu4ltGNVNQSIy5yJUPyz4Fgubx5lQEg== X-Received: by 10.66.253.7 with SMTP id zw7mr37915901pac.25.1474196947887; Sun, 18 Sep 2016 04:09:07 -0700 (PDT) Original-Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id t21sm63913808pfa.71.2016.09.18.04.09.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Sep 2016 04:09:07 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.49 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207538 Archived-At: On Sun, 18 Sep 2016, Richard Copley wrote: > On 18 September 2016 at 11:30, Tino Calancha wrote: >> >> >> 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? Hi Richard, > What if the user toggles case-fold-search between invocations of > grep-find? Will the argument be updated? > > If not, and if the user doesn't know about `grep-compute-defaults' (an > undocumented non-interactive function) then the argument depends on > the state of case-fold-search at the time of the first use of > grep-find, which seems awkward. AFICT, if the user changes case-fold-search, `rgrep' and `lgrep' will follow that change, but `grep-find' seems keep unchanged. I guess the behaviour of `grep-find' should be similar as the other 2 commands. Then, if a user want to keep his/her `grep-command' constant, s?he just need to customize it.