From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#45688: 28.0.50; New action for display-buffer? Date: Tue, 12 Jan 2021 10:06:45 +0100 Message-ID: <568151d0-c8fd-1643-56a7-87ff36ce234d@gmx.at> References: <87im8a1dff.fsf@gnus.org> <83y2h6133r.fsf@gnu.org> <8735ze0yp7.fsf@gnus.org> <83o8i20w1f.fsf@gnu.org> <87lfd5yny9.fsf@gnus.org> <87o8i03gem.fsf@gnus.org> <528b7d6b-403a-ffef-b0a0-4a0b6d92bec8@gmx.at> <87turpvxv0.fsf@gnus.org> <87turnh6u8.fsf@gnus.org> <87im83cn02.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10970"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45688@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 12 10:07:17 2021 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 1kzFe1-0002kW-2c for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Jan 2021 10:07:17 +0100 Original-Received: from localhost ([::1]:39326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzFe0-00062V-3r for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Jan 2021 04:07:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzFdm-00062F-MG for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 04:07:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kzFdm-00042Q-FD for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 04:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kzFdm-0004Di-Ai for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2021 04:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Jan 2021 09:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45688 X-GNU-PR-Package: emacs Original-Received: via spool by 45688-submit@debbugs.gnu.org id=B45688.161044241616208 (code B ref 45688); Tue, 12 Jan 2021 09:07:02 +0000 Original-Received: (at 45688) by debbugs.gnu.org; 12 Jan 2021 09:06:56 +0000 Original-Received: from localhost ([127.0.0.1]:59249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzFdf-0004DL-W5 for submit@debbugs.gnu.org; Tue, 12 Jan 2021 04:06:56 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:34001) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzFdd-0004D1-I0 for 45688@debbugs.gnu.org; Tue, 12 Jan 2021 04:06:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1610442407; bh=i0thByFna1yR664jb9Amtw0BPYCJpWROK2332+l92Xk=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=SzhFx0fJlrINYntITVq66m2/GzO/BrGMFPb+MP9uojfnUrOm7hcrk0mlRaS8haX8p 2MVq5dZzkeH+DgBmlk4j3HerSFpfd90TiixvruojF1wmyQkhluWrj2uYL9YvfW4/Uv OC5fNOi2F8jKm/LrLLAnGvngWcK58aXjSI2/WP2Y= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([46.125.249.21]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MAONd-1koV3c0TiF-00BsBB; Tue, 12 Jan 2021 10:06:47 +0100 In-Reply-To: <87im83cn02.fsf@gnus.org> Content-Language: en-US X-Provags-ID: V03:K1:lJhhT+CD47utTjbGJGN5VasLC+iLyc89uPbHmTU02ShGSTuQi0P wgLilVJ7yzBuyvzaVc3Dgv5cZVU/4NinLwnwqbGIHcopBeiE5xISIia4Min+bq0AQTULOzk 4eQu0FCgdsMbjboGCVJRue4iOxyaO4+XGLpT4D0nTNddNPuLmMFdG3rkChMvzIOFxR4J84v USOrUWrOhzAqcQm0WpzKg== X-UI-Out-Filterresults: notjunk:1;V03:K0:v+Tshi86KZE=:mITdIgXdwWcUNvyCL5Zina 5WhFBfipDCw9j+5EG0ZLB/OWqdhG1CKqDPPEGb1Do7qHV4iJy/RM8wcOS+S9JvR/ffFeYLEoJ 31fK+VnYUwmNyOYnlOlvuUI8kjeLA9UhTohddtDxpkdiQdS2X3Vx2A0wPA8HwxoSU8MiwpsAg /h457WVHz/uhYw2XFcgmvAomNC2/tgoTTB0XwQQTFuWJrbTy8ProQcCk1TCDtadEjne1A6uHF zFFIZRAzxKrw+MB5ctKar+AitVwfsz4y5gTXEassGQWPe87+dxmtWQrRTciECWfDOEhoFS/o6 BF+RMpiYmSN96FAhm8PDk+Hg/+k+Z1TU4TElisBMFzDBVhPMHTHoKz/rvnLUmir7/uq0Kqczm EBw//JCJHplpUA5QCIrGwACdlwrQihzbk7oabTf5nLj0wg9V0nsF5dSsw+W9QBfs4ybnB42Bc D9zMEiavV08/Eo95vz54YEm3krzanolyKvtgV4r5IeTMoEjBxtqllwLC5+CZtEaUtWhd0lx7P d8aAq9oNnKK+QyNAvZc0oR4km5ImUyJs4enu935cXvBWtskP3D/yYjcnZLkjhVo3hCVpJrKeD iRGf5d8B6G3M1eTMglppzt7mUMfkuVK8OOM411sX8UTRFOIiodoUZM5v3cNyCE1bvAPpRylWR oM+WXxFL3WcNiX0pbLk1dMo4AvaQyubqV1uTHyPdpdElNdOkOkeaW6b0BXcN/Fq2P7VUPFvS+ p5j3kr2W3mt9R3Mxru1e5SroQHaevhUrUDvHBTTAyTHIGkQ+KOcRot/52apBJdCe6DmfUZ8J 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:197777 Archived-At: > This fixes the reproducer, but not the case of actually jumping around= > manually -- `M-x display-buffer' sometimes chooses to resize the > windows. :-/ Have you ever read the Elisp manual where it says =E2=80=98display-buffer=E2=80=99 is not overly well suited for disp= laying several buffers in sequence and making sure that all these buffers are shown orderly in the resulting window configuration. Again, the standard action functions =E2=80=98display-buffer-pop-up-window=E2=80= =99 and =E2=80=98display-buffer-use-some-window=E2=80=99 are not very suite= d for this purpose due to their somewhat chaotic nature in more complex configurations. Maybe you bumped into this with your experiments, in particular when trying to reuse a window that you've already used before. 'display-buffer' still lives in the paradigm of <=3D 2 windows frames set= up in the past century and probably still the only reasonable one for TTY frames. For that it supports things like 'even-window-heights' and a 'split-height-threshold' of 80 with its "If, however, a window is the only window on its frame, or all the other ones are dedicated, =E2=80=98split-window-sensibly=E2=80=99 may split it vertically disregard= ing the value of this variable." exception. Hence a first step to get your rampages produce more reasonable results might be to ask whether that paradigm is still a valid one. If we don't want to do that, we can try to do some cosmetics in the size restoring mechanism. Basically, that mechanism is used when you display a temporary buffer in a two windows layout and you have 'temp-buffer-resize-mode' enabled. Suppose with emacs -Q you enable that mode and type C-h f push RET and then C-x 4 f to find some file. This will re-enlarge the window used for showing the 'push' help to its prior size so you get what you intend for showing that file. If we want 'display-buffer-use-some-window' to not do such size restorations, we can just add a 'do-no-restore-size' alist entry and an appropriate check like (when (and (not (cdr (assq 'do-no-restore-size alist))) (listp quad) (integerp (nth 3 quad)) (> (nth 3 quad) (window-total-height window))) 'display-buffer-use-least-recent-window' (and/or the application/user) could then set that entry at their like. > In related news, get-lru-window doesn't seem to work reliably? I don'= t > have a reproducer for that, either, but it seems to happen if I have a= > three window frame, and I call: > > (setq lru (get-lru-window (selected-frame) nil t)) > (window-bump-use-time lru) > (get-lru-window (selected-frame) nil t) > > will then return the same window as `lru'... How do you "call"? I suppose there's no chance to make another window but the selected one the mru one. We would have to look into the inner workings of that "call". martin