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

From: Tassilo Horn <[email-masked]>
Date: Mon, 03 Feb 2025 07:12:14 +0100

Michael Albinus <[email-masked]> writes:

> Thanks. I'll polish the patch, and if nobody objects, I'll push it to
> master in a couple of days.

No objections from me.  You are the master of auto-revert. ;-)

I'd argue that we also remove the buffer-read-only check from
dired-buffer-stale-p and use the new inhibit-auto-revert-buffers for
activating and deactivating wdired-mode but that can come afterwards.

>> Side-note: at first, it did not work after applying the patch and
>> running "make" in the emacs directory (reproducibly!), a problem I've
>> had before somewhere up the thread.  The original bug was there
>> again.  I placed a watch on inhibit-auto-revert-buffers which
>> revealed that it was set by the computation for all marked files in
>> order to present them at the yes-or-no-p prompt.  But it was not set
>> during the actual processing!  I had to manually delete the dired and
>> autorevert ELC files and "make" again.
>>
>> Does anyone have a clue why?  Does a recompile of a changed file with
>> existing ELC not produce it from scratch?
>
> Usually, this is due to macro-expansion. If you change a macro, you
> must also recompile the file(s) using the macro. IOW, removing
> dired.elc prior compiling would have been sufficient.

Ah, now I understand.  dired.el was changed and recompiled but
dired-do-compress lives in dired-aux.el which hasn't been changed but
needed recompiling because it uses the dired macro dired-map-over-marks.
So in fact, deleting dired-aux.elc was what has been needed.

Thanks,
Tassilo