GNU bug report logs -
#75626
31.0.50; Dired misses or double-processes files when auto-revert-mode is enabled
Previous Next
Reported by: Tassilo Horn <tsdh <at> gnu.org>
Date: Fri, 17 Jan 2025 07:43:01 UTC
Severity: normal
Found in version 31.0.50
Done: Tassilo Horn <tsdh <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 75626 <at> debbugs.gnu.org
> Date: Mon, 20 Jan 2025 02:51:17 +0100
>
> Tassilo Horn <tsdh <at> gnu.org> writes:
>
> > Good idea. I've tried this simple patch and it fixes the issue for me.
> >
> > diff --git a/lisp/dired.el b/lisp/dired.el
> > index bab5e833a76..1152d85f149 100644
> > --- a/lisp/dired.el
> > +++ b/lisp/dired.el
> > @@ -1289,6 +1289,10 @@ dired-buffer-stale-p
> > ;; Do not auto-revert when the dired buffer can be currently
> > ;; written by the user as in `wdired-mode'.
> > buffer-read-only
> > + ;; When a dired operation using dired-map-over-marks is in
> > + ;; progress, inhibit-read-only is set and we must not
>
> Better say "bound" please.
>
> > + ;; auto-revert.
> > + (null inhibit-read-only)
>
> And use `not' here, since we are testing a boolean valued flag.
>
> > (dired-directory-changed-p dirname))))
> >
> > (defcustom dired-auto-revert-buffer nil
> >
> > Probably testing inhibit-read-only is not TRT but the expansion of
> > dired-map-over-marks should explicitly let-bind some new
> > dired--map-over-marks-in-progress variable to make it more explicit...
>
> Yes. OTOH it's not bad either. `inhibit-read-only' bound (together
> with buffer-read-only which we already have) is a good indicator for
> that some operation is running and we should not auto revert.
>
> Unless I'm missing something I would prefer this solution.
But inhibit-read-only is also nil in WDired. Do we want to disable
auto-revert in that case?
Why don't you prefer the new dired--map-over-marks-in-progress
variable idea? Or Drew's suggestion to bind revert-buffer-function to
'ignore while dired-map-over-marks runs? Both sound cleaner to me
than relying on inhibit-read-only, which is used in gazillion places.
This bug report was last modified 196 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.