Subject: bug#32850: 27.0.50; window-swap-states doesn't swap window prev/next-buffers

From: martin rudalics <[email-masked]>
Date: Sun, 30 Sep 2018 10:00:38 +0200

> Actually not to change the course of history, but keep it together with
 > its window, or rather an imaginary window - when using window-swap-states,
 > it looks like windows are swapped: since window's buffer is moved
 > to a new location, the feeling is that the whole window is moved to
 > a new place, because what defines a window is its state more than
 > a location on the screen, so to not break the history of buffers
 > in the window, prev/next buffers should be swapped as well, to
 > keep the chain of buffers: prev-buffers - current buffer - next-buffer,
 > so 'C-x <C-left>' (previous-buffer) and 'C-x <C-right>' (next-buffer)
 > will navigate in the preserved history in the same order it navigated
 > in the old window location.

Swapping the states of two windows does not swap their identities.
That is, the windows themselves remain where they are, only their
buffers change.  If we changed their previous and next buffers, we
would tell a lie.  And we might introduce some slight inconsistency
because the previous/next buffers of a window are no more elements of
the 'buffer-list' of their respective frames when the windows are on
different frames.  I doubt that has any consequences, though ...

So if you want this change, please provide an option say
'window-swap-states-swap-history' and, if that is non-nil, support the
changes from your 'rotate-window-buffers'.

Thanks, martin