Subject: bug#79125: quit-window fails to restore window height in a scenario of buffer reuse

From: Eli Zaretskii <[email-masked]>
Date: Thu, 31 Jul 2025 07:47:14 +0300

> Cc: martin rudalics <[email-masked]>, [email-masked]
> From: Juri Linkov <[email-masked]>
> Date: Wed, 30 Jul 2025 20:58:04 +0300
> 
> >>> Does anybody agree that steps 7 and/or 9 behave suboptimally? Can that be improved?
> >> It can be improved but that would be expensive.  'window-prev-buffers'
> >> would have to return the height (and possibly the weight) of the window
> >> in addition to the start and point positions - that is, we'd have to
> >> store five instead of three values per buffer.
> >
> > That only applies to buffers that were previously displayed in some window,
> > right?
> 
> Ideally, auto-resizing should be window+buffer-local.
> And as soon as switching from the auto-resized buffer
> to another buffer in the same window, the original
> window height should be restored.

It's debatable whether everyone will like this.  For example, my main
code-editing frame always has a window at its bottom where I display
stuff like *Help*, *Apropos*, and commit logs, and I like to keep that
window's height small at all times, once I resize it manually to the
height I like (I have the resize-temp-buffer-window-inhibit option set
to 'vertical').

So if we introduce the above feature, it should be controlled by a
user option.