From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#55169: Can't combine window-min-height with window-height Date: Sun, 01 May 2022 20:06:04 +0300 Organization: LINKOV.NET Message-ID: <86czgxi3nn.fsf@mail.linkov.net> References: <86y1zp5but.fsf@mail.linkov.net> <87czh0gp6m.fsf@gnus.org> <9753db0e-05f2-5927-80fb-50d17f16441d@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34459"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , 55169@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 01 19:49:18 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlDh8-0008pg-77 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 May 2022 19:49:18 +0200 Original-Received: from localhost ([::1]:58926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlDh6-00028v-N3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 May 2022 13:49:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlDgu-000262-92 for bug-gnu-emacs@gnu.org; Sun, 01 May 2022 13:49:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlDgu-0005cE-08 for bug-gnu-emacs@gnu.org; Sun, 01 May 2022 13:49:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlDgt-0000Wj-Uq for bug-gnu-emacs@gnu.org; Sun, 01 May 2022 13:49:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 May 2022 17:49:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55169 X-GNU-PR-Package: emacs Original-Received: via spool by 55169-submit@debbugs.gnu.org id=B55169.16514272891880 (code B ref 55169); Sun, 01 May 2022 17:49:03 +0000 Original-Received: (at 55169) by debbugs.gnu.org; 1 May 2022 17:48:09 +0000 Original-Received: from localhost ([127.0.0.1]:34109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlDg1-0000UG-Eh for submit@debbugs.gnu.org; Sun, 01 May 2022 13:48:09 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:40477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlDg0-0000TS-A4 for 55169@debbugs.gnu.org; Sun, 01 May 2022 13:48:08 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 6FB4CE0006; Sun, 1 May 2022 17:48:01 +0000 (UTC) In-Reply-To: <9753db0e-05f2-5927-80fb-50d17f16441d@gmx.at> (martin rudalics's message of "Sat, 30 Apr 2022 10:03:33 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:231178 Archived-At: > Ideally, a 'window-min-height' entry should be applied when an existing > window is used via 'display-buffer-use-some-window'. Just that in such > case we (i) don't even look at that entry and (ii) we would not apply a > 'window-height' entry in the first place because that one is only used > for new windows or windows that always showed one and the same buffer. > > Now > >>> 1. first set window-height with fit-window-to-buffer; >>> 2. then check if the constraint of window-min-height is fulfilled, >>> and shrink too high window. > > is in general non-trivial because "1." constitutes a fait accompli: We > need a _real_ window to calculate its desired size and whether it is > 'window-resizable' to that size. So we may have to split some window > first to make "1." work. But what would we do then if "2." were not > satisfied? Restore the frame to a window configuration saved before > splitting? > > Which means that the strategy proposed above would work seamlessly with > 'display-buffer-reuse-window' only. But then would we really reject a > window showing a buffer already only because it's not large enough? > > As usual we are caught in between long established conveniences and more > rigorous guide lines for how 'display-buffer' should behave. Maybe as a workaround two calls of display-buffer would do the trick? The first call display-buffer-below-selected will split the window, then the second call display-buffer-use-some-window will adjust the height.