all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tino Calancha <f92capac@gmail.com>
Cc: 22694@debbugs.gnu.org
Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk
Date: Sat, 09 Jul 2016 14:07:57 +0300	[thread overview]
Message-ID: <83furjgjci.fsf@gnu.org> (raw)
In-Reply-To: <alpine.DEB.2.20.1606270031030.25377@calancha-pc> (message from Tino Calancha on Mon, 27 Jun 2016 00:32:18 +0900 (JST))

> From: Tino Calancha <f92capac@gmail.com>
> Date: Mon, 27 Jun 2016 00:32:18 +0900 (JST)
> cc: Tino Calancha <f92capac@gmail.com>, 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?





  reply	other threads:[~2016-07-09 11:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 12:47 bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk Tino Calancha
2016-02-16 16:05 ` Eli Zaretskii
2016-02-17 14:07   ` Tino Calancha
2016-02-24  9:31 ` Tino Calancha
2016-04-10  7:02 ` Tino Calancha
2016-04-20 14:55   ` Eli Zaretskii
2016-04-20 15:31     ` Tino Calancha
2016-04-20 15:48       ` Eli Zaretskii
2016-06-26 15:32         ` Tino Calancha
2016-07-09 11:07           ` Eli Zaretskii [this message]
2016-07-11  5:48             ` Tino Calancha
2016-07-11  5:49 ` bug#22694: (no subject) Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83furjgjci.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=22694@debbugs.gnu.org \
    --cc=f92capac@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.