[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#33871: 27.0.50; Revert Dired window saved in window configuration
From: |
Juri Linkov |
Subject: |
bug#33871: 27.0.50; Revert Dired window saved in window configuration |
Date: |
Thu, 27 Dec 2018 02:01:57 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
>> Try to eval in emacs -Q in *scratch*:
>>
>> (progn (dired "/tmp") (dired-next-line 1)
>> (split-window) (other-window 1)
>> (dired "/tmp") (dired-next-line 2)
>> (let ((w-c (current-window-configuration))
>> (p-m (point-marker)))
>> (view-emacs-todo) (delete-other-windows)
>> (with-current-buffer (get-buffer "tmp")
>> (revert-buffer))
>> (set-window-configuration w-c)
>> (goto-char p-m)))
>>
>> Result:
>> - point in the selected Dired window moves to point-min
>> - point in the non-selected Dired window moves to point-max
>
> You're obfuscating the underlying behavior with the 'dired-next-line'
> and 'goto-char' calls but the final points are different without that.
>
> Without your explicit moves, `dired' moves to the first file name in
> the lower directory here. So 'dired-move-to-filename' was called when
> reverting the buffer and the 'set-window-configuration' "restores" the
> lower window's point from the buffer's point because that window is
> the selected one.
I see that without `goto-char' it moves to the first file name in the
selected window. I don't understand how 'set-window-configuration' restores
the selected window's point.
> To confirm, try with the upper window selected instead.
Here is when the upper window is selected, but still it moves to (point-max)
in non-selected window:
(progn (dired "/tmp")
(dired-other-window "/tmp") (other-window 1)
(let ((w-c (current-window-configuration))
(p-m (point-marker)))
(view-emacs-todo) (delete-other-windows)
(with-current-buffer (get-buffer "tmp")
(revert-buffer))
(set-window-configuration w-c)))
- bug#33871: 27.0.50; Revert Dired window saved in window configuration, Juri Linkov, 2018/12/25
- bug#33871: 27.0.50; Revert Dired window saved in window configuration, martin rudalics, 2018/12/26
- bug#33871: 27.0.50; Revert Dired window saved in window configuration,
Juri Linkov <=
- bug#33871: 27.0.50; Revert Dired window saved in window configuration, martin rudalics, 2018/12/27
- bug#33871: 27.0.50; Revert Dired window saved in window configuration, Juri Linkov, 2018/12/27
- bug#33871: 27.0.50; Revert Dired window saved in window configuration, martin rudalics, 2018/12/28
- bug#33871: 27.0.50; Revert Dired window saved in window configuration, Markus Triska, 2018/12/29
- bug#33871: 27.0.50; Revert Dired window saved in window configuration, martin rudalics, 2018/12/29
- bug#33871: 27.0.50; Revert Dired window saved in window configuration, Juri Linkov, 2018/12/29
- bug#33871: 27.0.50; Revert Dired window saved in window configuration, martin rudalics, 2018/12/30
- bug#33871: 27.0.50; Revert Dired window saved in window configuration, martin rudalics, 2018/12/30
- bug#33871: 27.0.50; Revert Dired window saved in window configuration, Juri Linkov, 2018/12/30