Subject: bug#71264: 30.0.50; Dired deletion moves point under auto-revert

From: Eli Zaretskii <[email-masked]>
Date: Tue, 04 Jun 2024 17:26:50 +0300

> From: Manuel Giraud <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Mon, 03 Jun 2024 22:00:47 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> [...]
> 
> >> This I'm not sure and I have to check.  But it seems that dired keeps
> >> the information of « what is the current file name » and go there after
> >> having reverted the content.  If it is not found, the point stays at
> >> BOB.
> >
> > So how does Dired DTRT when you simply delete a file at point?  Why
> > doesn't it go to BOB in that case?
> 
> Because the dired buffer is not reverted (it does not re-read the ls
> output in this case).  If I'm not mistaken, this takes place in
> `dired-remove-entry' which removes the buffer line of the file that was
> just deleted.

AFAIR, when the Dired buffer is reverted, Dired attempts to preserve
important information, like markers etc.  So I think the problem could
be that the revert happens before Dired had time to record that
information, in which case rearranging some code should be a way
forward.