GNU bug report logs -
#55169
Can't combine window-min-height with window-height
Previous Next
Full log
View this message in rfc822 format
>>>> (pop-to-buffer (generate-new-buffer "*edit string*")
>>>> '(display-buffer-below-selected
>>>> (window-height . (lambda (window)
>>>> (fit-window-to-buffer window nil 10)))))
>>>
>>> Sounds too complicated IMO.
>>
>> Actually a lambda is already supported, so no changes are required.
>
> We have to find a suitable way to explain that in the manual.
It's already documented in the manual:
• If the value specifies a function, that function is called
with one argument—the chosen window. The function is supposed
to adjust the height of the window; its return value is
ignored. Suitable functions are ‘fit-window-to-buffer’ and
‘shrink-window-if-larger-than-buffer’, see *note Resizing
Windows::.
It would be nice to add just a small example of a lambda with more args
for fit-window-to-buffer or shrink-window-if-larger-than-buffer.
>> A special case for fit-window-to-buffer, shrink-window-* and other similar
>> could be implemented only when you are sure that a `window-min-height' entry
>> is not going to be used for other purposes besides of using it as an argument
>> of a window-height entry.
>
> You said that this is the case for 'fit-window-to-buffer' and that
> function is the canonical client for a 'window-height' function. So why
> bother about the rest?
You found another function shrink-window-if-larger-than-buffer.
Then it would be better not to limit only to these two.
>> BTW, fit-window-to-buffer has also other arguments: MAX-WIDTH and MIN-WIDTH.
>> Would they be useful for a window-width entry?
>
> Maybe. But let's talk about MAX-HEIGHT first.
Maybe MAX-WIDTH is not needed after all, as much as MAX-HEIGHT.
>>> And if we really want to, we can always add a MIN-HEIGHT argument to
>>> 'shrink-window-if-larger-than-buffer' and handle it the same way.
>>
>> This is very much needed, thanks.
>
> See below (this should also fix the lie about the return value).
Thanks, I'll test it. Does it need more args from fit-window-to-buffer?
This bug report was last modified 3 years and 28 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.