From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Trust me I am a Doctor Newsgroups: gmane.emacs.bugs Subject: bug#49277: 28.0.50; [PATCH] Fix ediff3 with window-combinaison-resize Date: Wed, 21 Jul 2021 13:12:57 +0200 Message-ID: <878s1zewyn.fsf@riseup.net> References: <87im1wy3va.fsf@riseup.net> <3b5f00bf-0572-8ca8-462b-d87f01bfe17e@gmx.at> <87pmvs6f46.fsf@riseup.net> <87eebujnia.fsf@gnus.org> 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="9317"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49277@debbugs.gnu.org, Lars Ingebrigtsen To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 21 13:20:14 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 1m6AGs-0002Hs-6z for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Jul 2021 13:20:14 +0200 Original-Received: from localhost ([::1]:58506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6AGr-0001vz-5a for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Jul 2021 07:20:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6AGg-0001vo-7E for bug-gnu-emacs@gnu.org; Wed, 21 Jul 2021 07:20:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52941) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6AGf-00080P-VW for bug-gnu-emacs@gnu.org; Wed, 21 Jul 2021 07:20:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m6AGf-00058F-Rk for bug-gnu-emacs@gnu.org; Wed, 21 Jul 2021 07:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Trust me I am a Doctor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Jul 2021 11:20:01 +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.162686635019660 (code B ref 49277); Wed, 21 Jul 2021 11:20:01 +0000 Original-Received: (at 49277) by debbugs.gnu.org; 21 Jul 2021 11:19:10 +0000 Original-Received: from localhost ([127.0.0.1]:36254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6AFp-000572-LQ for submit@debbugs.gnu.org; Wed, 21 Jul 2021 07:19:09 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:36260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6AFo-00056o-Ag for 49277@debbugs.gnu.org; Wed, 21 Jul 2021 07:19:09 -0400 Original-Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (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 4GVClB39FxzF4R1; Wed, 21 Jul 2021 04:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1626866342; bh=7V5jHyzwJasVpLpWXyXaIa/7O9N64GbVWmivz2jXe1w=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=b9+ZOLhKeY7R32GpVqhnS1tIsegmaQz7AB6G6tJt6/imOvRZxvPZCu7rnd54o6ncD dSRvESE164vRfsZqaMX8umieiisKDt2y64YMFstdxNa1+FlhOP5a1plU5nEhPyO/b2 v6ufLS37TQVnKh+O2WdS5L74RIWLjOkGjyMBycY4= X-Riseup-User-ID: 2809318D850A1FCAD1B1231B45F2EA165E40C9CFC0483F8A05940CD3887926AD Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4GVCl92pLPz1yS7; Wed, 21 Jul 2021 04:19:01 -0700 (PDT) In-reply-to: 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:210416 Archived-At: --=-=-= Content-Type: text/plain please try this one. I swear it is not again the same buggy patch. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-ediff3-with-window-combinaison-resize.patch Content-Description: corrected >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 -- --=-=-=--