unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: display-buffer and temp-buffer-resize-mode
Date: Wed, 16 Feb 2022 20:38:43 +0200	[thread overview]
Message-ID: <86leyay7v0.fsf@mail.linkov.net> (raw)
In-Reply-To: <c2b7e835-7ebd-1762-eb4a-006095f4ef25@gmx.at> (martin rudalics's message of "Wed, 16 Feb 2022 18:52:44 +0100")

> 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.



      reply	other threads:[~2022-02-16 18:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16 17:52 display-buffer and temp-buffer-resize-mode martin rudalics
2022-02-16 18:38 ` Juri Linkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86leyay7v0.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).