bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk


From: Eli Zaretskii
Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk
Date: Wed, 20 Apr 2016 17:55:07 +0300

> Date: Sun, 10 Apr 2016 16:02:59 +0900 (JST)
> From: Tino Calancha <address@hidden>
> 
> 1) An user submit several hundred of jobs to a batch server.
> 
> 2) The output consist of just log files (1 per job) which are written
>    under the submission directory until the jobs succeded of fail.
>    When the job fails, the logfile contains the word 'aborting'.
> 
> 3) To resubmit the failed jobs, the user may put all logfiles together in a
>    dired buffer using `find-name-dired'.  From time to time, he/she call
>    `dired-mark-files-containing-regexp' using 'aborting' as regexp: from this,
>    he/she obtain directly the list of failed jobs...
> 
> 4) ...But if the user has opened some of the logfiles from failed jobs, the 
> word
>    'aborting' may not be in the buffer (the user need to revert it first), so 
> the
>    list of failed jobs at 3) will not be exhaustive.  This behaviour is not
>    consistent with the doc. string of the function:

Making the doc string more explicit about this aspect is indeed a good
idea.  I've just did it on the emacs-25 branch.

As for your scenario: when you work with logfiles, or any other kind
of files that get updated regularly behind Emacs's back, you should
turn on auto-revert-mode or auto-revert-tail-mode in the buffers of
those files.  Then the buffer's contents will be synchronized with the
relevant files on disk, and the problem you describe would not exist.

Bottom line, I don't think I agree with permanently changing the
implementation along the lines you suggest, as that would be against
the general principles (AFAIK them) of Dired's design, and actually
also against the general principles of Emacs design vis-a-vis files
and buffers that visit them: we don't automatically sync a buffer with
the file it visits, and we don't automatically look on disk when the
file's buffer differs from what's on disk.

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.  Another alternative is to have an optional feature
that would ask whether to revert a buffer if Emacs finds that it was
changed on disk since last visited.

Thanks.





reply via email to

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