Subject: Re: bug#55169: Can't combine window-min-height with window-height

From: Juri Linkov <[email-masked]>
Date: Fri, 06 May 2022 18:34:35 +0300

>>> You mean the value of a 'window-height' entry could also be a
>>>
>>>          • A list whose CAR is a function and whose remaining elements
>>>            are the arguments passed to that function.
>>>
>>> so we'd run
>>>
>>> 	    (ignore-errors (funcall (car height) window (nth 1 height) ...))
>> ...
> This boils down to what I sketched above: ALIST must supply a list whose
> car is 'fit-window-to-buffer' and 'window--display-buffer' supplies the
> window used as first argument in its call to 'fit-window-to-buffer' and
> the rest of the list as the remaining arguments.

Then this could be an easy to explain rule.  I'm only unsure about the
WINDOW argument.  What if another function has a WINDOW argument in
another position, not the first?  Maybe better to allow a lambda like this:

(pop-to-buffer (generate-new-buffer "*edit string*")
               '(display-buffer-below-selected
                 (window-height . (lambda (window)
                                    (fit-window-to-buffer window nil 10)))))