GNU bug report logs - #11320
[PATCH 2/2] Useful behavior for ediff-inferior-compare-regions when merging with an ancestor

Previous Next

Package: emacs;

Reported by: Dave Abrahams <dave <at> boostpro.com>

Date: Mon, 23 Apr 2012 19:30:03 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11320 in the body.
You can then email your comments to 11320 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#11320; Package emacs. (Mon, 23 Apr 2012 19:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dave Abrahams <dave <at> boostpro.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 23 Apr 2012 19:30:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dave Abrahams <dave <at> boostpro.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Dave Abrahams <dave <at> boostpro.com>
Subject: [PATCH 2/2] Useful behavior for ediff-inferior-compare-regions when
	merging with an ancestor
Date: Mon, 23 Apr 2012 15:28:26 -0400
The default, when "comparing currently-highlighted difference regions"
was to compare the selected region to the entire conflict in the merge
buffer.  Now it simply compares the region to the highlighted part of
the ancestor buffer.
---
 lisp/vc/ediff-util.el |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index 046070d..393c8ad 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -3557,9 +3557,11 @@ Ediff Control Panel to restore highlighting."
 		 bufB ediff-buffer-B
 		 possibilities nil)))
 
-    (if (and (ediff-valid-difference-p ediff-current-difference)
+    (when (and (ediff-valid-difference-p ediff-current-difference)
 	     (y-or-n-p "Compare currently highlighted difference regions? "))
-	(setq use-current-diff-p t))
+      (setq use-current-diff-p t)
+      (if ediff-merge-with-ancestor-job
+          (setq bufB ediff-ancestor-buffer)))
 
     (setq bufA (if use-current-diff-p
 		   (ediff-clone-buffer-for-current-diff-comparison
-- 
1.7.10





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11320; Package emacs. (Sat, 12 May 2018 02:04:01 GMT) Full text and rfc822 format available.

Message #8 received at 11320 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Dave Abrahams <dave <at> boostpro.com>
Cc: 11320 <at> debbugs.gnu.org
Subject: Re: bug#11320: [PATCH 2/2] Useful behavior for
 ediff-inferior-compare-regions when merging with an ancestor
Date: Fri, 11 May 2018 22:03:04 -0400
[Message part 1 (text/plain, inline)]
Dave Abrahams <dave <at> boostpro.com> writes:

> The default, when "comparing currently-highlighted difference regions"
> was to compare the selected region to the entire conflict in the merge
> buffer.

Right, this is pretty useless.

> -    (if (and (ediff-valid-difference-p ediff-current-difference)
> +    (when (and (ediff-valid-difference-p ediff-current-difference)
>  	     (y-or-n-p "Compare currently highlighted difference regions? "))
> -	(setq use-current-diff-p t))
> +      (setq use-current-diff-p t)
> +      (if ediff-merge-with-ancestor-job
> +          (setq bufB ediff-ancestor-buffer)))

Would it make sense to ask about ancestor vs merge buffer even before
the "currently highlighted" query?  I don't quite see why those two
should be tied together.  Although with the patch below, it might be too
many queries, perhaps it's better to only ask when given a prefix arg or
something.

[0001-Let-ediff-compare-against-ancestor-buffer-Bug-11320.patch (text/x-diff, inline)]
From b503830af00e38ba0d510467dea957e95668a74b Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Fri, 11 May 2018 21:56:56 -0400
Subject: [PATCH] Let ediff '=' compare against ancestor buffer (Bug#11320)

* lisp/vc/ediff-util.el (ediff-inferior-compare-regions): Ask user
whether to compare against the ancestor or merge buffer.  Use
read-multiple-choice for A vs B buffer query.
---
 lisp/vc/ediff-util.el | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index 104a578268..c121df9eca 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -3546,25 +3546,20 @@ ediff-inferior-compare-regions
     (ediff-paint-background-regions 'unhighlight)
 
     (cond ((ediff-merge-job)
-	   (setq bufB ediff-buffer-C)
+	   (setq bufB (if (and ediff-ancestor-buffer
+                               (y-or-n-p "Compare against ancestor buffer?"))
+                          ediff-ancestor-buffer
+                        ediff-buffer-C))
 	   ;; ask which buffer to compare to the merge buffer
-	   (while (cond ((eq answer ?A)
-			 (setq bufA ediff-buffer-A
-			       possibilities '(?B))
-			 nil)
-			((eq answer ?B)
-			 (setq bufA ediff-buffer-B
-			       possibilities '(?A))
-			 nil)
-			((equal answer ""))
-			(t (beep 1)
-			   (message "Valid values are A or B")
-			   (sit-for 2)
-			   t))
-	     (let ((cursor-in-echo-area t))
-	       (message
-		"Which buffer to compare to the merge buffer (A or B)? ")
-	       (setq answer (capitalize (read-char-exclusive))))))
+	   (setq answer (car (read-multiple-choice
+                              (format "Which buffer to compare to the %s buffer?"
+                                      (if (eq bufB ediff-ancestor-buffer)
+                                          "ancestor" "merge"))
+                              '((?a "A")
+                                (?b "B")))))
+           (if (eq answer ?a)
+               (setq bufA ediff-buffer-A)
+             (setq bufA ediff-buffer-B)))
 
 	  ((ediff-3way-comparison-job)
 	   ;; ask which two buffers to compare
-- 
2.11.0


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11320; Package emacs. (Fri, 29 Jun 2018 02:14:02 GMT) Full text and rfc822 format available.

Message #11 received at 11320 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Dave Abrahams <dave <at> boostpro.com>
Cc: 11320 <at> debbugs.gnu.org
Subject: Re: bug#11320: [PATCH 2/2] Useful behavior for
 ediff-inferior-compare-regions when merging with an ancestor
Date: Thu, 28 Jun 2018 22:13:10 -0400
tags 11320 fixed
close 11320 27.1
quit

Noam Postavsky <npostavs <at> gmail.com> writes:

> Would it make sense to ask about ancestor vs merge buffer even before
> the "currently highlighted" query?  I don't quite see why those two
> should be tied together.  Although with the patch below, it might be too
> many queries, perhaps it's better to only ask when given a prefix arg or
> something.

I changed the order of the queries, so that the user can hit two "y"s in
order.  I found this fairly okay.  I've pushed to master, we'll see if
someone comes up with something better later.

[1: 591bb3d900]: 2018-06-28 22:09:04 -0400
  Let ediff '=' compare against ancestor buffer (Bug#11320)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=591bb3d90018ebbcf79e6d496ed73ef396a58887




Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 29 Jun 2018 02:14:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 11320 <at> debbugs.gnu.org and Dave Abrahams <dave <at> boostpro.com> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 29 Jun 2018 02:14:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 27 Jul 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 331 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.