GNU bug report logs - #33871
27.0.50; Revert Dired window saved in window configuration

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Tue, 25 Dec 2018 21:43:01 UTC

Severity: minor

Found in version 27.0.50

Fixed in version 30.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 33871 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 33871 <at> debbugs.gnu.org
Subject: Re: bug#33871: 27.0.50;
 Revert Dired window saved in window configuration
Date: Sun, 30 Dec 2018 01:21:05 +0200
>> So the revert function doesn't use markers?  Maybe then
>> set-window-configuration should not use markers too?
>
> 'dired-revert' is special.  There's nothing we can conclude from it.

image-revert is another special, as indicated by bug#33631

>>>> 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)))
>>>
>>> In every non-selected window.  Try with as many windows as you want.
>>> Only the selected window is handled separately.
>>
>> A bug?

Do you know why it currently moves point to the end of the buffer
in non-selected windows.  I don't understand what causes this behavior.

> As I suggested earlier we can use the position of the buffer's point
> in every window regardless of whether it currently shows the buffer or
> we later switch to the buffer in it.  But this is not what we usually
> want when using multiple windows: We usually want them to show
> different portions of the same buffer.

Yes, better to keep every window's own point.  Since usually I save
the selected window's point along with the window configuration, in e.g.

((window-configuration-1 selected-window-point)
 (window-configuration-2 selected-window-point)
 ...)

this could be extended to save a mapping of all windows points, e.g.

((window-configuration-1 ((window-a point-a) (window-b point-b) ...))
 (window-configuration-2 ...)
 ...)


But it's not a general solution.  A general solution would be to save
such metadata in the window configuration itself.




This bug report was last modified 1 year and 102 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.