Subject: Re: bug#33458: 27.0.50; dired loses position when reverted from outside place

From: martin rudalics <[email-masked]>
Date: Fri, 23 Nov 2018 20:03:02 +0100

> Typo. Should be:
 >
 > M-: (previous-buffer) OR closing DIR-B buffer.
 >
 > Note: "closing" is `kill-buffer' or `bury-buffer'.

Aha.  So after your

   4. Let's check position: M-: (with-current-buffer "DIR-A" (point)) ;=> 225, so cursor in the right place.

evaluate

M-: (window-prev-buffers)

You should find your DIR-A together with two markers, the second of
them should be 225.  Correct?  Now do your

   5. Revert original buffer: M-: (with-current-buffer "DIR-A" (dired-revert))

and evaluate

M-: (window-prev-buffers)

again.  The second marker will be at 1 because reverting DIR-A just
nuked it.

The only solution I can think of is to have 'dired-restore-positions'
scan 'window-prev-buffers' for each window and if it finds the buffer
that was reverted there, update the associated point position to the
position of the buffer's point it calculated itself.  If you want to
give it a try I can tell you everything you need to know.

A more generic solution might be wanted for other auto-revert clients
as well.  But that's more hairy and not of much use for dired anyway.

martin