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: Mon, 11 Jan 2021 19:55:03 +0100 Message-ID: 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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------E578D16EBCC62219B76301A0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9257"; 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 Mon Jan 11 19:56:09 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 1kz2ML-0002J8-Hm for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Jan 2021 19:56:09 +0100 Original-Received: from localhost ([::1]:45222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kz2MK-0004hx-GR for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Jan 2021 13:56:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kz2MD-0004hn-V6 for bug-gnu-emacs@gnu.org; Mon, 11 Jan 2021 13:56:01 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kz2MD-0005XQ-OE for bug-gnu-emacs@gnu.org; Mon, 11 Jan 2021 13:56:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kz2MD-0002Jf-N7 for bug-gnu-emacs@gnu.org; Mon, 11 Jan 2021 13:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Jan 2021 18:56:01 +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.16103913148840 (code B ref 45688); Mon, 11 Jan 2021 18:56:01 +0000 Original-Received: (at 45688) by debbugs.gnu.org; 11 Jan 2021 18:55:14 +0000 Original-Received: from localhost ([127.0.0.1]:58251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kz2LR-0002IW-R1 for submit@debbugs.gnu.org; Mon, 11 Jan 2021 13:55:14 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:40417) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kz2LP-0002IE-DK for 45688@debbugs.gnu.org; Mon, 11 Jan 2021 13:55:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1610391305; bh=PKHF48mdYPo9dNkCnxnYL+bJF/WLYlARnm/rjKBanP8=; h=X-UI-Sender-Class:Subject:From:To:Cc:References:Date:In-Reply-To; b=YgepkJcVZGslc9B7qAGMng0YnMN7ow9XHJTNB88BDDRhPrToBpDqiXxnLUvu0ZmGA 5eoTm5rXcIqenQJ20fBoO6uQx1aa34wpQi4dJ/CmuReuU+sHcypChFFMZpM81fxeg5 vBAAJCFSkDjaU8KTq6Pd8QeTMXT4CGxrZN5ueUBQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([212.95.5.67]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MiaY9-1kL0EZ3eGl-00fhJ5; Mon, 11 Jan 2021 19:55:04 +0100 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K1:fsLotdLTdszE4veVBgI2wIqrhiyCXDHEYcQb/Ct3e2klYd6UafV JRlozn+QxTaOPWvTiI+BfKx7w/1fY65qJ9ZqdTTqJ1nzCCt1bcaafl4DSFWN2IXJJ+r9Gv2 0p95M0fHwXZD80O4f6L3X2ttjG2+4Kgx5/kFjHBLwwc93sxjfbZMYIibp1llroo89riVbZ1 54ySikov9KCfGI06CL/6w== X-UI-Out-Filterresults: notjunk:1;V03:K0:2tH6IxpHFs4=:WgJGQotngrmCl9sbEpmLY7 Psf1U/NrHz1egY40dURuc6OWzafVf2eeEhyEDsnLFqllbir//86T1AagIBH+1lGAvH5iqf0x+ M+iZ4/wAmJ9JGwcgPdoEzDYLZd2b4V5ZBzRKSLEtXMXuTDAt7iKv6QV/zk1kXUBVtgg4IPHAM /iFXxqgkEDmgxBGdRGI/Uqq1QRsMr4dZ5M83x1FB7zY3bJtbEOrR2H+fXPPlLxmAu1X6b9Cld avv9Fj/qFg3B5Xo/NYEIwvm+A6T0cKO3e5wtH8++ngIJL7kLoOr+Nsp1xgH4ygju32uk4H4Pw P5KqawUueMwUIySi9nnbwZ2amIWme1eEJrFh/j4b7fKZgyUPNxzjdgomeWxVRW7QdxJvLhPoi XwmBEfHr6Mk3sp73g7ErVkhPD517Anx1Ix/dv2oaVC7gvpJEttr78dq2oFGjvwcqCdWctuKNl JeEDtN7w7aBwbfkIw+SknVLO0X78TMmZmr6Mm+CHTX5vozgBfYUvmBM3OJ67gUMVdjBeq6/VO kmjLNiFi3H3hH3zZte22F9nJ+tGRnQFP7A1q5Zk38/uYDFhIbT41PQRzkGRi+xuHN2cn8ybVL 0YemgjYefywK0AyFULA3QkJIXBqTLRdZAM2UhOt1A/apvwV1HP4aiBfk1gJh/hmRtTlLFmhuX Qk99qt8LXr6hfMGR8ml2iie6RcBDT1XPuZWQya+QHljoQ4IvBsw3u9cPaNPZ5fNWD5NmyP6Rv tgzpvictUETAooX+ejq28qvd/Xk/a0LdSZ138TqDS8WlPHv8tENuoBGpgS7bOqwGUg8hIcou 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:197735 Archived-At: This is a multi-part message in MIME format. --------------E578D16EBCC62219B76301A0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit > Let's try to clean up the height value when copying the 'quit-restore' > parameter as attached. Just found a related bug in the code. When 'display-buffer' makes a new window on the left or right, it sets that value to the window's width which doesn't make any sense. The current code can handle only height values as for 'shrink-window-if-larger-than-buffer' or the default 'fit-window-to-buffer'. So please use the patch attached here. martin --------------E578D16EBCC62219B76301A0 Content-Type: text/x-patch; name="split-window-quit-restore.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="split-window-quit-restore.diff" diff --git a/lisp/window.el b/lisp/window.el index a6cdd4dec2..c09d9532e3 100644 =2D-- a/lisp/window.el +++ b/lisp/window.el @@ -5543,10 +5543,12 @@ split-window-below Otherwise, the window starts are chosen so as to minimize the amount of redisplay; this is convenient on slow terminals." (interactive "P") - (let ((old-window (selected-window)) - (old-point (window-point)) - (size (and size (prefix-numeric-value size))) - moved-by-window-height moved new-window bottom) + (let* ((old-window (selected-window)) + (old-point (window-point)) + (size (and size (prefix-numeric-value size))) + (quit-restore (window-parameter old-window 'quit-restore)) + (quad (nth 1 quit-restore)) + moved-by-window-height moved new-window bottom) (when (and size (< size 0) (< (- size) window-min-height)) ;; `split-window' would not signal an error here. (error "Size of new window too small")) @@ -5574,10 +5576,18 @@ split-window-below (<=3D (window-start new-window) old-point) (set-window-point new-window old-point) (select-window new-window)))) - ;; Always copy quit-restore parameter in interactive use. - (let ((quit-restore (window-parameter old-window 'quit-restore))) - (when quit-restore - (set-window-parameter new-window 'quit-restore quit-restore))) + + (when quit-restore + (when (and (listp quad) (integerp (nth 3 quad))) + ;; nth 3 of quad is the old-window height of OLD-WINDOW. This + ;; value is meaningless in NEW-WINDOW so set it to the present + ;; height of NEW-WINDOW. + (setq quit-restore (copy-tree quit-restore)) + (rplaca (cdddr (nth 1 quit-restore)) + (window-total-height new-window))) + + (set-window-parameter new-window 'quit-restore quit-restore)) + new-window)) (defalias 'split-window-vertically 'split-window-below) @@ -6440,9 +6450,7 @@ display-buffer-record-window ;; Preserve window-point-insertion-type (Bug#12855). (copy-marker (window-point window) window-point-insertion-type) - (if (window-combined-p window) - (window-total-height window) - (window-total-width window))) + (window-total-height window)) (selected-window) buffer))))) ((eq type 'window) ;; WINDOW has been created on an existing frame. --------------E578D16EBCC62219B76301A0--