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: Fri, 13 May 2022 19:58:40 +0300 Organization: LINKOV.NET Message-ID: <86mtflz7wf.fsf@mail.linkov.net> References: <86y1zp5but.fsf@mail.linkov.net> <868rriil03.fsf@mail.linkov.net> <0e9b53c4-b283-ca20-fa8a-995f2b58ed59@gmx.at> <865ymlje5o.fsf@mail.linkov.net> <8ae5e6ac-25f5-3feb-b05b-fbdb71e7ac1d@gmx.at> <864k24v0vo.fsf@mail.linkov.net> <865ymkrmze.fsf@mail.linkov.net> <86v8ujcd2r.fsf@mail.linkov.net> <3f7b273c-59f4-5486-728e-a0c8e09190a7@gmx.at> <86bkwahe5g.fsf@mail.linkov.net> <86mtfrj3bh.fsf@mail.linkov.net> <868rray1me.fsf@mail.linkov.net> <3c037fed-fc8e-52b0-3f3c-f06a7648c0bf@gmx.at> <865ymc8rgw.fsf@mail.linkov.net> <86bkw2el8g.fsf@mail.linkov.net> <0add6026-7ee0-762f-4ae9-dbf8d2e2d698@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="22334"; 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 Fri May 13 19:07:22 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 1npYl8-0005fg-KG for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 May 2022 19:07:22 +0200 Original-Received: from localhost ([::1]:34878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npYl7-0000En-CM for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 May 2022 13:07:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npYko-0000Du-Vh for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 13:07:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51027) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npYko-0005qw-Mm for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 13:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npYko-0002J3-Hu for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 13:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 May 2022 17:07:02 +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.16524615948780 (code B ref 55169); Fri, 13 May 2022 17:07:02 +0000 Original-Received: (at 55169) by debbugs.gnu.org; 13 May 2022 17:06:34 +0000 Original-Received: from localhost ([127.0.0.1]:44916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npYkM-0002HY-5o for submit@debbugs.gnu.org; Fri, 13 May 2022 13:06:34 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:45941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npYkK-0002HH-7M for 55169@debbugs.gnu.org; Fri, 13 May 2022 13:06:32 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 2CF05240005; Fri, 13 May 2022 17:06:24 +0000 (UTC) In-Reply-To: <0add6026-7ee0-762f-4ae9-dbf8d2e2d698@gmx.at> (martin rudalics's message of "Fri, 13 May 2022 09:01:46 +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:232176 Archived-At: >> Adding an alist is a good idea, but unfortunately it's not backwards-compatible. > > That's what I'm trying to bring up ever since we started this thread. > AFAICT we'd need two new functions at least - an action function say > 'display-buffer-split-window' Can the existing 'display-buffer-in-direction' be used to split window? Or a new action 'display-buffer-split-in-direction' is needed? > and a 'dislay-buffer-fit-window' function > - both accepting the ALIST as (additional) argument. But they can't be used simultaneously? When 'display-buffer-split-window' splits the window, then the next 'dislay-buffer-fit-window' is not called? >>> Think of an application suggesting 'fit-window-to-buffer' with some >>> 'window-min-height' value and a user who wants to use >>> 'shrink-window-if-larger-than-buffer' instead but still use the >>> 'window-min-height' value proposed by the application. How would we do >>> that? >> >> I have no idea how to make this backwards-compatible. > > It can be done with global variables but the resulting code will be > neither elegant nor comprehensible. IMO any such information must be > inevitably passed on through the ALIST argument. Maybe a new alist key could be added, e.g. 'window-fit', that is like 'window-height' but also adds the new arg 'alist'? >> Definitively the functions that create a new window >> should take into account height constraints. >> But not sure about functions that select the existing window. >> Should they resize the existing window? > > They do so already. With emacs -Q do > > (pop-to-buffer (get-buffer-create "*edit string*") > '(display-buffer-below-selected > (window-height . (lambda (window) > (fit-window-to-buffer window nil 10))))) > > followed by > > (pop-to-buffer (get-buffer-create "*edit string*") > '(display-buffer-below-selected > (window-height . (lambda (window) > (fit-window-to-buffer window nil 20))))) Nice!