GNU bug report logs - #36859
Customizable fit-window-to-buffer

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Tue, 30 Jul 2019 20:40:02 UTC

Severity: wishlist

Tags: patch

Merged with 51062, 52855

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 36859 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 36859 <at> debbugs.gnu.org
Subject: Re: bug#36859: Customizable fit-window-to-buffer
Date: Wed, 31 Jul 2019 23:57:14 +0300
>> It's a nice feature when fit-window-to-buffer resizes temporary windows
>> that go away after exiting the minibuffer.
>>
>> OTOH, resizing permanent windows does more harm, because these windows
>> can be reused later for other buffers, but their size remains too narrow.
>
> What is a permanent window?

A window that remains indefinitely after finishing the current command,
and where other buffers with different number of lines might appear.

                               IIRC we only fit new windows or frames
> that go away when quit and carefully try to not resize other windows
> but the one used for splitting off the new window.  Old windows are
> fit iff they did show the same buffer before and were created for that
> buffer.  Such windows should, by concept, not be reused for showing
> another buffer.

I see that the existing windows are resized with
'shrink-window-if-larger-than-buffer'.  So not only
'fit-window-to-buffer' is involved.

Two examples of 'shrink-window-if-larger-than-buffer':
- in vc-log-internal-common;
- in vc-diff-finish.

>> I'm not asking to change the default behavior, but it should be customizable.
>
> In what sense?

I hope it would be possible to specify a special action alist entry
in 'display-buffer-alist' , e.g.

  (window-height . no-fit-window)

to override

  (window-height . fit-window-to-buffer)

This requires that more commands should use this alist in their
'display-buffer' calls instead of directly calling
'shrink-window-if-larger-than-buffer'.

Do you think this is feasible?  If not, then maybe these commands
should provide post-display hooks such as e.g. 'proced-post-display-hook'
where 'fit-window-to-buffer' is added by default, but can be removed
by customization.




This bug report was last modified 3 years and 131 days ago.

Previous Next


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