[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: display-buffer and temp-buffer-resize-mode
From: |
Juri Linkov |
Subject: |
Re: display-buffer and temp-buffer-resize-mode |
Date: |
Wed, 16 Feb 2022 20:38:43 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
> There are numerous ways to fix that, all requiring some sort of surgery:
>
> - We could simply document the current behavior. This means that for
> using 'display-buffer-in-direction' as helper function for say
> 'display-buffer-at-bottom' we would have to append an extra
> (window-height . nil) alist entry in order to suppress the resizing
> ('display-buffer-at-bottom' currently does not suffer from that
> syndrome).
Shouldn't both 'display-buffer-in-direction (direction . bottom)'
and 'display-buffer-at-bottom' be consistent with each other
in regard to resizing, and either both resize or not?
Even this comment says they should have the same implementation:
;; This should be rewritten as
;; (display-buffer-in-direction buffer (cons '(direction . bottom) alist))
(defun display-buffer-at-bottom (buffer alist)
> - We could inhibit the resizing. This would require a slight amendment
> in the call in 're-builder' - all other calls in our code base provide
> an extra 'window-height' alist entry. Nevertheless, it would be an
> incompatible change of, admittedly undocumented, behavior. (Note that
> for 'display-buffer--maybe-at-bottom' we would then have to fix
> 'hack-local-variables-confirm'.)
Also I found 'ediff-setup-windows-plain-compare' where
'display-buffer-in-direction' is without explicit 'window-height'.
But the decision whether to resize or not could depend on statistics:
if the majority of uses prefer resizing, then resize by default.
> - We could try to refine the snippet above in some way. For example,
> ask for 'resize-temp-buffer-window' only if the buffer to be displayed
> is "temporary". That's a bit tricky because 'temp-buffer-resize-mode'
> is a global mode and that variable does not allow to tell whether the
> buffer to display is temporary at all. In either case, the
> 'fit-window-to-buffer' entry would have to be dropped and we still
> have an incompatible change.
Another variant is to treat synonyms differently where e.g.
'(direction . bottom)' will resize, but '(direction . below) won't.