From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: marmote-te Newsgroups: gmane.emacs.bugs Subject: bug#49277: 28.0.50; [PATCH] Fix ediff3 with window-combinaison-resize Date: Thu, 08 Jul 2021 15:33:50 +0200 Message-ID: <87pmvs6f46.fsf@riseup.net> References: <87im1wy3va.fsf@riseup.net> <3b5f00bf-0572-8ca8-462b-d87f01bfe17e@gmx.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18399"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49277@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 08 16:44:18 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 1m1VGC-0004de-Vq for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Jul 2021 16:44:17 +0200 Original-Received: from localhost ([::1]:58124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1VGA-0005so-VS for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Jul 2021 10:44:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1VFy-0005sR-Bj for bug-gnu-emacs@gnu.org; Thu, 08 Jul 2021 10:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45686) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1VFy-0005NU-4F for bug-gnu-emacs@gnu.org; Thu, 08 Jul 2021 10:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m1VFy-0005na-3T for bug-gnu-emacs@gnu.org; Thu, 08 Jul 2021 10:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: marmote-te Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Jul 2021 14:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49277 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49277-submit@debbugs.gnu.org id=B49277.162575540222213 (code B ref 49277); Thu, 08 Jul 2021 14:44:02 +0000 Original-Received: (at 49277) by debbugs.gnu.org; 8 Jul 2021 14:43:22 +0000 Original-Received: from localhost ([127.0.0.1]:57227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1VFJ-0005mD-N4 for submit@debbugs.gnu.org; Thu, 08 Jul 2021 10:43:22 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:58904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1VFH-0005ly-Go for 49277@debbugs.gnu.org; Thu, 08 Jul 2021 10:43:20 -0400 Original-Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4GLJtn6C3DzDqr4; Thu, 8 Jul 2021 07:43:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1625755393; bh=zVOhKGP9JW1121WpxCVtnePpaeNWQWwGcr2aQGer934=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=LrsktDl0UY1BrFRnKk6FNnS5wE+TUO8RCxYlUP38DluRc4ZE9pDucBkV66f2+QeD5 WaN+OUgBErM9TdDV1Upx8Y48875fvV0UQkZM6ZUPjamFfiiG77QTpqhk5Ww7ne/ZOa /G2ztIcq33jzwogVzC1EOEnjMFO/IOo/5sN87EHc= X-Riseup-User-ID: 503C831F778D0A13F575F15031A17D5A1FF1124D5423CF99CD9F12BE0C4E4417 Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4GLJtm3DM2z5vYh; Thu, 8 Jul 2021 07:43:11 -0700 (PDT) In-reply-to: <3b5f00bf-0572-8ca8-462b-d87f01bfe17e@gmx.at> 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:209696 Archived-At: --=-=-= Content-Type: text/plain martin rudalics writes: >> I have a bug when calling ediff3, the layout is not a balanced. >> >> Ultimately I found that combining this settings were the culprit : >> >> (setq window-combination-resize t >> even-window-sizes nil) >> >> ;; you can test it with eg : >> (setq default-directory "/home/user") >> (ediff3 ".bashrc" >> ".bash_history" >> ".bash_logout") >> >> Removing the manual resizing when splitting windows and relying rather >> on 'window-combinaison-resize' to balance the layout, solve the issue. > > I think we can easily do that but it does not handle the > > (setq window-combination-resize t > even-window-sizes nil > ediff-window-setup-function 'ediff-setup-windows-plain) > > case here. Shouldn't we fix that too? > > Thanks, martin Yes, I missed that one ; it worked only in plain window with (setq ediff-split-window-function #'split-window-horizontally) I guess that is the control buffer that is interfering somehow with the resizing ? I tried to apply on it a 'window-preserve parameter on its window, without much success. So in this one, for the plain window setup, I only create the control window at the end of the layout. It does not seemed necessary to setup the control buffer twice. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Fix-ediff3-with-window-combinaison-resize.patch Content-Description: Fix ediff3 with window-combinaison-resize 2 >From 96b03d92ea2c46d5cb9716383ad2248a3d701c72 Mon Sep 17 00:00:00 2001 From: Trust me I am a doctor Date: Tue, 29 Jun 2021 19:22:04 +0200 Subject: [PATCH] Fix ediff3 with window-combinaison-resize * lisp/vc/ediff-wind.el (ediff-setup-windows-plain-compare): When 'window-combination-resize' is set to t and 'even-window-sizes' is set to nil, the 3 window layout as in ediff3 does not produce a balanced layout. Getting rid of the manual resizing and relying rather on window.el to automatically resize the windows with 'window-combination-resize', solve that issue. (ediff-setup-windows-multiframe-compare): Tiddo. --- lisp/vc/ediff-wind.el | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el index fc6ea944ae..7c90348b5d 100644 --- a/lisp/vc/ediff-wind.el +++ b/lisp/vc/ediff-wind.el @@ -400,7 +400,8 @@ ediff-setup-windows-plain-compare ;; skip dedicated and unsplittable frames (ediff-destroy-control-frame control-buffer) (let ((window-min-height 1) - split-window-function wind-width-or-height + (window-combination-resize t) + split-window-function three-way-comparison wind-A-start wind-B-start wind-A wind-B wind-C) (with-current-buffer control-buffer @@ -419,22 +420,12 @@ ediff-setup-windows-plain-compare (select-window (next-window nil 'ignore-minibuf))) (delete-other-windows) (set-window-dedicated-p (selected-window) nil) - (split-window-vertically) - (ediff-select-lowest-window) - (ediff-setup-control-buffer control-buffer) ;; go to the upper window and split it betw A, B, and possibly C (other-window 1) (switch-to-buffer buf-A) (setq wind-A (selected-window)) - (if three-way-comparison - (setq wind-width-or-height - (/ (if (eq split-window-function #'split-window-vertically) - (window-height wind-A) - (window-width wind-A)) - 3))) - - (funcall split-window-function wind-width-or-height) + (funcall split-window-function) (if (eq (selected-window) wind-A) (other-window 1)) @@ -443,7 +434,7 @@ ediff-setup-windows-plain-compare (if three-way-comparison (progn - (funcall split-window-function) ; equally + (funcall split-window-function) (if (eq (selected-window) wind-B) (other-window 1)) (switch-to-buffer buf-C) @@ -461,7 +452,9 @@ ediff-setup-windows-plain-compare (set-window-start wind-A wind-A-start) (set-window-start wind-B wind-B-start))) - (ediff-select-lowest-window) + (select-window (display-buffer-in-direction + control-buffer + '((direction . bottom)))) (ediff-setup-control-buffer control-buffer) )) @@ -746,6 +739,7 @@ ediff-setup-windows-multiframe-compare (and (not (frame-live-p frame-A)) (or ctl-frame-exists-p (eq frame-B (selected-frame)))))) + (window-combination-resize t) wind-A-start wind-B-start designated-minibuffer-frame) @@ -758,7 +752,7 @@ ediff-setup-windows-multiframe-compare 'B ediff-narrow-bounds)))) (if use-same-frame - (let (wind-width-or-height) ; this affects 3way setups only + (progn (if (and (eq frame-A frame-B) (frame-live-p frame-A)) (select-frame frame-A) ;; avoid dedicated and non-splittable windows @@ -767,15 +761,7 @@ ediff-setup-windows-multiframe-compare (switch-to-buffer buf-A) (setq wind-A (selected-window)) - (if three-way-comparison - (setq wind-width-or-height - (/ - (if (eq split-window-function #'split-window-vertically) - (window-height wind-A) - (window-width wind-A)) - 3))) - - (funcall split-window-function wind-width-or-height) + (funcall split-window-function) (if (eq (selected-window) wind-A) (other-window 1)) (switch-to-buffer buf-B) -- 2.20.1 --=-=-= Content-Type: text/plain There is also the merge job layouts, that are a little bit different, but as far I understand them, they are not affected by this issue. If it feels cleaner, I could however apply the same modification to the setup of the control buffer. -- --=-=-=--