Subject: bug#32825: 27.0.50; Deterministic window management

From: martin rudalics <[email-masked]>
Date: Sun, 11 Nov 2018 09:53:29 +0100

> I tried it long ago to see it works fine, and later reverted locally
 > because I thought already you pushed it to master.
 >
 > Now I tried again with display-buffer-below-selected, and it still
 > works fine.
 >
 > But still it seems better would be to add display-buffer-at-bottom
 > after display-buffer-below-selected:
 >
 > display-buffer-reuse-window
 > display-buffer-in-previous-window
 > display-buffer-below-selected
 > display-buffer-at-bottom
 >
 > because display-buffer-at-bottom tries to resize other windows
 > to accommodate the *Backtrace* window.

I certainly won't object but we have to make the previous-window
behavior DTRT so the 'display-buffer-at-bottom' won't hide its
misbehavior.

Currently we use a window's previous buffers for three things:

(1) For 'switch-to-prev-buffer'.

(2) To find a buffer to display when killing or burying a window's
     buffer and the window shall be kept.

(3) For finding a window in 'display-buffer-in-previous-window'.

Personally I don't care about (2).  But two things about (1) that
annoy me in practice are: When the window-local buffer list is
exhausted I get a buffer from the frame-local or global lists, so I
often enough get TAGS or other intestines dished in that window and,
to double my pleasure, indirectly have these enter the window-local
list.  I'd rather restart with a buffer from the window-local list
provided that list is "long enough".  That's fuzzy to implement.

And, I get too many irrelevant buffers like temporary ones from the
window-local list.  OTOH it's just the temporary buffers we want to
keep there because of (3).  Moreover, when I'm in a window reused by
*Help* and I want to temporarily switch to that window's previous
buffer then switching back to the window's next buffer should probably
get me back to *Help*.  So what I'd like is yet another notion of
fuzziness that after some time forgets about temporary buffers shown
in a window in the past, including *Backtrace*.

martin