GNU bug report logs - #63455
30.0.50; display-buffer-in-direction is always resizing

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Fri, 12 May 2023 01:07:01 UTC

Severity: normal

Found in version 30.0.50

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Michael Heerdegen <michael_heerdegen <at> web.de>, 63455 <at> debbugs.gnu.org
Cc: dgutov <at> yandex.ru, juri <at> linkov.net
Subject: bug#63455: 30.0.50; display-buffer-in-direction is always resizing
Date: Fri, 12 May 2023 09:39:40 +0200
> OTOH, the action `display-buffer-in-direction' _always_ resizes the
> window no matter what buffer is current.  Try e.g.
>
> #+begin_src emacs-lisp
> (display-buffer (current-buffer)
>                 '((display-buffer-in-direction) . ((direction . top))))
> #+end_src
>
> from any window or buffer.
>
> This is handled by this part of the implementation of
> `display-buffer-in-direction':
>
> #+begin_src emacs-lisp
> 	(setq 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))))))
> #+end_src
>
> Looking at that it doesn't seem to be intended as a general behavior,
> and the behavior is not a good default IMO - even if it can be
> suppressed by adding a (window-height . nil) entry to the
> `display-buffer' call.
>
> I guess that Bug#45945 could be a symptom of this problem.

I think you're right.  In my local Emacs I removed both incarnations of
that code (the other one being in 'display-buffer--maybe-at-bottom')
long ago.  I can only shortly sketch how I manage things here: The end
of 'help--window-setup' has become

        (help-window-setup
         (setq window (temp-buffer-window-show (current-buffer) nil t)))
        (help-make-xrefs (current-buffer))
	(when (and window temp-buffer-resize-mode)
          (let (resize-temp-buffer-window-inhibit)
            (resize-temp-buffer-window window)))))))

'temp-buffer-window-show' has a third argument NO-RESIZE and its last
lines are rewritten as

	(with-selected-window window
	  (run-hooks 'temp-buffer-window-show-hook)
	  (when (and (not no-resize) temp-buffer-resize-mode)
	    (resize-temp-buffer-window window)))
	;; Return the window.
	window))))

Maybe Juri can make heads or tails of this.

martin




This bug report was last modified 2 years and 22 days ago.

Previous Next


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