unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: martin rudalics <rudalics@gmx.at>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 55169@debbugs.gnu.org
Subject: bug#55169: Can't combine window-min-height with window-height
Date: Mon, 09 May 2022 21:58:17 +0300	[thread overview]
Message-ID: <868rray1me.fsf@mail.linkov.net> (raw)
In-Reply-To: <e08e4222-04d2-994c-a743-e738b742d870@gmx.at> (martin rudalics's message of "Mon, 9 May 2022 09:24:52 +0200")

>>>> (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?





  parent reply	other threads:[~2022-05-09 18:58 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 17:58 bug#55169: Can't combine window-min-height with window-height Juri Linkov
2022-04-29 10:27 ` Lars Ingebrigtsen
2022-04-30  8:03   ` martin rudalics
2022-05-01 17:06     ` Juri Linkov
2022-05-02  7:37       ` martin rudalics
2022-05-02 18:53         ` Juri Linkov
2022-05-03  9:21           ` martin rudalics
2022-05-03 17:38             ` Juri Linkov
2022-05-04  7:54               ` martin rudalics
2022-05-04 19:29                 ` Juri Linkov
2022-05-05  7:47                   ` martin rudalics
2022-05-05  8:03                     ` Juri Linkov
2022-05-05  9:49                       ` martin rudalics
2022-05-05 16:37                         ` Juri Linkov
2022-05-06  7:02                           ` martin rudalics
2022-05-06  7:52                             ` Juri Linkov
2022-05-06 14:10                               ` martin rudalics
2022-05-06 15:34                                 ` Juri Linkov
2022-05-07  7:58                                   ` martin rudalics
2022-05-08 18:18                                     ` Juri Linkov
2022-05-09  7:24                                       ` martin rudalics
2022-05-09  7:38                                         ` martin rudalics
2022-05-09 18:58                                         ` Juri Linkov [this message]
2022-05-10  7:41                                           ` martin rudalics
2022-05-11  7:21                                             ` Juri Linkov
2022-05-11  8:19                                               ` martin rudalics
2022-05-12 17:03                                                 ` Juri Linkov
2022-05-13  7:01                                                   ` martin rudalics
2022-05-13 16:58                                                     ` Juri Linkov
2022-05-14  7:49                                                       ` martin rudalics
2022-05-11  9:03                                           ` Richard Stallman
2022-05-12 16:59                                             ` Juri Linkov
2022-05-18 18:20                                         ` Juri Linkov
2022-05-19  7:18                                           ` martin rudalics
2022-05-19 16:27                                             ` Juri Linkov

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=868rray1me.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=55169@debbugs.gnu.org \
    --cc=larsi@gnus.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).