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

[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: Wed, 23 Feb 2022 19:53:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>> But still 'dired-revert' fails to update the Dired buffer in
>> window configurations saved in tabs, or in winner.el, or
>> in 'C-x r w' (window-configuration-to-register), etc.
>
> As a first step we could try to do that for window states.

But window states don't contain pointers to windows.
So it's impossible to find e.g. '(selected-window)'
in a window state returned by '(window-state-get)'.

> (Note in this context: We traditionally say in the Elisp manual that "As
> a special exception, the window configuration does not record the value
> of point in the selected window for the current buffer." which is not
> precise IIUC.  It does record the value but 'set-window-configuration'
> does not or not necessarily restore it.)

Then we could save additional context information the same way as
currently this special exceptional value of point is saved, e.g.
in 'tab-bar--tab':

      (wc . ,(current-window-configuration))
      (wc-point . ,(point-marker))

where 'point-marker' is saved separately from 'current-window-configuration'.
And then it's restored in 'tab-bar-select-tab':

            ;; set-window-configuration does not restore the value of
            ;; point in the current buffer, so restore it separately.
            (when (and (markerp wc-point)
                       (marker-buffer wc-point)
                       ;; FIXME: After dired-revert, marker relocates to 1.
                       ;; window-configuration restores point to global point
                       ;; in this dired buffer, not to its window point,
                       ;; but this is slightly better than 1.
                       ;; Maybe better to save dired-filename in each window?
                       (not (eq 1 (marker-position wc-point))))
              (goto-char wc-point))

Please note that this bug report is related to FIXME above.

So a possible solution is also to save more context information
like dired-filename, and then restore it using dired-goto-file.





reply via email to

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