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

From: Eli Zaretskii <[email-masked]>
Date: Fri, 17 Jan 2025 10:32:50 +0200

> From: Tassilo Horn <[email-masked]>
> Date: Fri, 17 Jan 2025 08:42:42 +0100
> 
> 
> I have a directory test/ with files foobar.N for N in 0 to 99 and do:
> 
> emacs -Q test
> M-x auto-revert-mode RET
> % m .* RET               ; mark all files
> Z                        ; compress them all
> Z                        ; uncompress them all again
> Z                        ; again and again...
> ...
> 
> I always wait until the (un)compress operations are all done before
> pressing Z again.  But even though, at some Z you will notice that your
> directory doesn't contain only gz or only non-gz files but a mix of
> both!
> 
> It seems the reason is that auto-revert-mode at some point reverts the
> buffer at random points in time while dired is still (un)compressing and
> that changes the order of files so that it either misses files or
> processes some files twice.

What happens if you set auto-revert-use-notify to the nil value?

In any case, if you stop pressing 'Z', doesn't the list of files
eventually become up-to-date?  And if it does, why is this considered
a bug?  The fact that auto-revert-mode catching the directory in some
intermediate state from time, when files in the directory are being
created and deleted, to time should not come as a surprise, I think.
Or what am I missing?