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: Tue, 29 Jun 2021 18:24:34 +0200 Message-ID: <87im1wy3va.fsf@riseup.net> 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="40591"; mail-complaints-to="usenet@ciao.gmane.io" To: 49277@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 29 19:32:12 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 1lyHam-000AP6-5V for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Jun 2021 19:32:12 +0200 Original-Received: from localhost ([::1]:55592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyHal-0000M8-35 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Jun 2021 13:32:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyHac-0000K8-U9 for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 13:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyHac-00055X-KU for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 13:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lyHac-000389-Ia for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 13:32:02 -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: Tue, 29 Jun 2021 17:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49277 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162498789912004 (code B ref -1); Tue, 29 Jun 2021 17:32:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Jun 2021 17:31:39 +0000 Original-Received: from localhost ([127.0.0.1]:55252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyHaF-00037X-FN for submit@debbugs.gnu.org; Tue, 29 Jun 2021 13:31:39 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:42280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyHaD-00037O-8g for submit@debbugs.gnu.org; Tue, 29 Jun 2021 13:31:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyHaD-0008EH-08 for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 13:31:37 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:44454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyHaA-0004n0-KG for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 13:31:36 -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 4GDs390cWhzDqCQ for ; Tue, 29 Jun 2021 10:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1624987893; bh=MxMUjoQnFeVJu3wp91Hm1fW1z7bvlC4hbg1oq2D4gcw=; h=From:To:Subject:Date:From; b=cftCwRV6m/HxBiilZfbuX9VEtEZqZjEq9ed8Slh3H/M+o7Pkfqs3PMKzOfhBrPgYQ +q+/DVRjgDnpoVOM9pcu0y3yUuTNe0lRIGNOpPWjEsAMzpbB9lzJYCf/qey1VrCoeM LYpBlv/bwdQTLcE9pz/fI2T6ooyqifMDA46LJd98= X-Riseup-User-ID: FE9313F684C334F8254AE09A084391BDD9A504FED6D926E7E42E371C80E1E104 Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4GDs375hBQz5w7M for ; Tue, 29 Jun 2021 10:31:31 -0700 (PDT) Received-SPF: pass client-ip=198.252.153.129; envelope-from=pillule@riseup.net; helo=mx1.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:209110 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-ediff3-with-window-combinaison-resize.patch Content-Description: Fix ediff3 with window-combinaison-resize >From ddb8cda5b0c21807c884b9e5a72b0da7ee9605a2 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 | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el index fc6ea944ae..361eecd01e 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 @@ -427,14 +428,7 @@ ediff-setup-windows-plain-compare (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 +437,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) @@ -746,6 +740,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 +753,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 +762,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 --=-=-=--