Subject: Re: bug#75626: 31.0.50; Dired misses or double-processes files when auto-revert-mode is enabled

From: Michael Albinus <[email-masked]>
Date: Mon, 27 Jan 2025 09:27:55 +0100

Tassilo Horn <[email-masked]> writes:

Hi everybody,

Sorry for being late to the party, but last week I wasn't in the mood
for any party. And honestly, it isn't much better now. But so what.

> Could be.  One would need to look at each command.  Basically, the issue
> of the two bugs can occur when auto-revert may happen which is when
> Emacs is waiting for a process to finish (like in this bug) or when
> waiting for user-input (like the confirmation prompt in bug#71264).

Auto-revert is triggered either by timers (polling) or by events (file
notification). So yes, it is applied when either timers or event reading
is in place.

I believe it is good to have a mechanism like inhibit-auto-revert or
dired--inhibit-auto-revert, in order to suppress auto-reverting
temporarily. The problem is, that as now they have a nil-or-t value,
which means that other auto-reverts are blocked also during this time,
although they are not related. No problem in case of polling (the next
poll will do the auto-revert), but in case of file notifications the
information is lost.

My proposal is, that we give the variable a list of buffers instead,
which are excluded from auto-revert. Then the autorevert for this buffer
can be suppressed in auto-revert-buffer by a simple check. And
auto-revert clients need only to add/remove the buffer in question to
*inhibit-auto-revert, without thinking about filtering.

With this approach, it is preferred to have a global variable
inhibit-auto-revert. The mechanism wouldn't be restricted to dired buffers.

> Bye,
> Tassilo

Best regards, Michael.