From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk Date: Sat, 09 Jul 2016 14:07:57 +0300 Message-ID: <83furjgjci.fsf@gnu.org> References: <83twiw72k4.fsf@gnu.org> <83lh487036.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1468062570 4614 80.91.229.3 (9 Jul 2016 11:09:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jul 2016 11:09:30 +0000 (UTC) Cc: 22694@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 09 13:09:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bLq8M-0004VW-56 for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jul 2016 13:09:18 +0200 Original-Received: from localhost ([::1]:49817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLq8L-0007Nr-1p for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jul 2016 07:09:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLq8C-0007M2-8r for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2016 07:09:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLq86-0002HH-8F for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2016 07:09:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLq86-0002HC-4G for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2016 07:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bLq85-0002xc-Ud for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2016 07:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jul 2016 11:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22694-submit@debbugs.gnu.org id=B22694.146806250311333 (code B ref 22694); Sat, 09 Jul 2016 11:09:01 +0000 Original-Received: (at 22694) by debbugs.gnu.org; 9 Jul 2016 11:08:23 +0000 Original-Received: from localhost ([127.0.0.1]:43262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLq7T-0002wj-Gw for submit@debbugs.gnu.org; Sat, 09 Jul 2016 07:08:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLq7R-0002wX-QK for 22694@debbugs.gnu.org; Sat, 09 Jul 2016 07:08:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLq7H-00028q-HV for 22694@debbugs.gnu.org; Sat, 09 Jul 2016 07:08:16 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38377) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLq7H-00028l-EO; Sat, 09 Jul 2016 07:08:11 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1529 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bLq7D-00031Z-Vw; Sat, 09 Jul 2016 07:08:08 -0400 In-reply-to: (message from Tino Calancha on Mon, 27 Jun 2016 00:32:18 +0900 (JST)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120670 Archived-At: > From: Tino Calancha > Date: Mon, 27 Jun 2016 00:32:18 +0900 (JST) > cc: Tino Calancha , 22694@debbugs.gnu.org > > >I guess we could have an option to switch to the behavior you would > >like to see, but such an option, if we introduce it, IMO should not be > >specific to this command, it should affect all the Dired commands > >which might produce different results when buffers are not > >auto-reverted. > > I have only found another Dired command which might require the new > option: > `dired-do-query-replace-regexp'. > But it seems unnecessary because this command already alert the user > if the file has being modified 'externally': > > ./emacs -Q -eval '(progn (with-temp-file "/tmp/foo" (insert "foobar")) (find-file "/tmp/foo") (dired "/tmp"))' > % g \`foobar$ RET > M-! echo foo > foo > M-x dired-do-query-replace-regexp RET \`foobar$ RET bar RET > ;; File foo changed on disk. Reread from disk? (yes or no) > > ;;; > So i propose a patch which: > 1) Adds a new option `dired-always-read-filesystem' (default value nil). > 2) Use it just in `dired-mark-files-containing-regexp'. Thanks, please push to master, after taking care of the following issues: > --- a/doc/emacs/dired.texi > +++ b/doc/emacs/dired.texi > @@ -550,13 +550,16 @@ Marks vs Flags > the regular expression @var{regexp} > (@code{dired-mark-files-containing-regexp}). This command is like > @kbd{% m}, except that it searches the file contents instead of the file > -name. Note that if a file is visited in an Emacs buffer, this command > +name. Note that if a file is visited in an Emacs buffer, > +and @code{dired-always-read-filesystem} evaluates @code{nil}, this Our usual style for what you want to say in the last sentence is like this: Note that if a file is visited in an Emacs buffer, and @code{dired-always-read-filesystem} is @code{nil} (the default), ... > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -198,6 +198,9 @@ questions, with a handy way to display help texts. > ** Dired > > +++ > +*** New option 'dired-always-read-filesystem'. Please tell in a sentence or 2 what does this option do. > +(defcustom dired-always-read-filesystem nil > + "Non-nil means commands like `dired-mark-files-containing-regexp' which > +may use a buffer visiting the file or read the file on disk, always > +read the file system. Otherwise, if do exist a buffer visiting the file, > +then use that buffer." The first line of the doc string must be a complete sentence. So I suggest the following alternative wording (which also clarifies the text in other places): "Non-nil means revert buffers visiting files before searching them. By default, commands like `dired-mark-files-containing-regexp' will search any buffers visiting the marked files without reverting them, even if they were changed on disk. When this option is non-nil, such buffers are always reverted before searching them." > +Note that if a file is visited in an Emacs buffer, and > +`dired-always-read-filesystem' evaluates nil, this command will ^^^^^^^^^^^^^ "is nil" Thanks. How about a test for this functionality?