bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33458: 27.0.50; dired loses position when reverted from outside plac


From: Juri Linkov
Subject: bug#33458: 27.0.50; dired loses position when reverted from outside place
Date: Thu, 13 Dec 2018 01:29:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> I think we should run a hook when a buffer appears in the window,
>> either by e.g. 'C-x <left>' (previous-buffer) or by 'window-state-put',
>> then a buffer-local hook in Dired will move its point to the right file.
>
> The problem with 'dired' is that we have to make any amendments at the
> time the buffer is reverted.  It's already too late when switching to
> the buffer afterwards.
>
> The only thing we can do at the time of switching to a buffer is to go
> to the buffer's point (which should work when the buffer was displayed
> only in one window before).

For example, saveplace.el uses dired-initial-position-hook to set
Dired buffer's point initially to a remembered dired-filename.

A switch-to-buffer hook could do the same to move point to a dired-filename
previously displayed in that window, by getting the filename from e.g.
a buffer-local mapping from windows to filenames.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]