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
Tassilo Horn <tsdh <at> gnu.org> writes:
> That doesn't work when the command switches to some other buffer. Then
> that other buffer's post-command-hook is run meaning the dired buffer
> stays in dired--inhibit-auto-revert state forever. :-|
Hmm.
If the approach makes sense in general we will find a way. How about
checking `this-command' and `current-minibuffer-command'? When any of
these is non-nil, we may want to prevent autorevert.
But this alone is too general - we should know if the are processing a
dired command. If the current buffer is a dired mode buffer, this is
ok. But the case with the popups is tricky, it seems we can't know in
which buffer a command had really been envoked. Also
`minibuffer--original-buffer' is not usable - it's only bound by
`completing-read'. Hmm.
How about saving the result of (buffer-chars-modified-tick) in the local
pre-command-hook and post-command-hook, into a local variable? If
`dired-buffer-stale-p' finds a different current value we know that the
current command has modified the buffer, and we should not auto-revert.
Though, this will still fail if a command first changes the buffer
contents and then the current buffer...
Maybe it is really easier to go through the commands...or use a
heuristic, like looking whether `this-command',
`current-minibuffer-command' match "dired". Using the global binding of
`pre-command-hook' and `post-command-hook' would probably also work
reliably but I would not want to clutter those with a function only for
the sake of this detail.
Michael.
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.