Subject: Re: bug#39822: 27.0.90; Cannot set *Completions* buffer height using display-buffer-alist

From: martin rudalics <[email-masked]>
Date: Thu, 5 Mar 2020 10:13:13 +0100

>> IIUC it neither runs the hooks for temporary buffers nor does it obey
 >> 'temp-buffer-resize-mode'.
 >
 > I don't know why it should run hooks and 'temp-buffer-resize-mode'.
 > Why other clients of display-buffer don't need these hooks?
 >
 >>> and nothing more, without hassles of with-displayed-buffer-window.
 >>> And still it fits the window nicely into the buffer height.
 >>
 >> How comes?
 >
 > Maybe this means it's possible to avoid using with-displayed-buffer-window?
 >
 >>> Why the above 3 commands couldn't do the same by abandoning
 >>> with-displayed-buffer-window?
 >>
 >> It depends on how much of the stuff in 'temp-buffer-window-setup' and
 >> 'temp-buffer-window-show' they really need.
 >
 > Maybe they need none of these?

'display-buffer--maybe-at-bottom' handles this by using

   (let ((alist (append alist `(,(if temp-buffer-resize-mode
		                    '(window-height . resize-temp-buffer-window)
	                          '(window-height . fit-window-to-buffer))
	                       ,(when temp-buffer-resize-mode
	                          '(preserve-size . (nil . t)))))))

The question is now whether we want to do that in one place (that is, in
the temporary buffer setup and show functions) or in many places (like
in the buffer display action functions).

martin