unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dave Abrahams <dave@boostpro.com>
To: 11319@debbugs.gnu.org
Cc: Dave Abrahams <dave@boostpro.com>
Subject: bug#11319: [PATCH 1/2] BUGFIX: select current-diff-comparison regions for ediff-inferior-compare-regions correctly
Date: Mon, 23 Apr 2012 15:28:25 -0400	[thread overview]
Message-ID: <1335209306-81494-2-git-send-email-dave@boostpro.com> (raw)
In-Reply-To: <1335209306-81494-1-git-send-email-dave@boostpro.com>

The buffer types passed to
ediff-clone-buffer-for-current-diff-comparison are used to select the
character ranges that participate in the inferior comparison.  Those
were being hardcoded as 'A and 'B, which was wrong.
---
 lisp/vc/ediff-util.el |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index 78a2163..046070d 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -3378,10 +3378,18 @@ Without an argument, it saves customized diff argument, if available
     (set-window-buffer wind cloned-buff)
     cloned-buff))
 
-(defun ediff-clone-buffer-for-current-diff-comparison (buff buf-type reg-name)
-  (let ((cloned-buff (ediff-make-cloned-buffer buff reg-name))
-	(reg-start (ediff-get-diff-posn buf-type 'beg))
-	(reg-end (ediff-get-diff-posn buf-type 'end)))
+(defun ediff-buffer-type (buffer)
+  (cond ((eq buffer ediff-buffer-A) 'A)
+        ((eq buffer ediff-buffer-B) 'B)
+        ((eq buffer ediff-buffer-C) 'C)
+        ((eq buffer ediff-ancestor-buffer) 'Ancestor)
+        (t nil)))
+
+(defun ediff-clone-buffer-for-current-diff-comparison (buff reg-name)
+  (let* ((cloned-buff (ediff-make-cloned-buffer buff reg-name))
+         (buf-type (ediff-buffer-type buff))
+         (reg-start (ediff-get-diff-posn buf-type 'beg))
+         (reg-end (ediff-get-diff-posn buf-type 'end)))
     (ediff-with-current-buffer cloned-buff
       ;; set region to be the current diff region
       (goto-char reg-start)
@@ -3555,7 +3563,7 @@ Ediff Control Panel to restore highlighting."
 
     (setq bufA (if use-current-diff-p
 		   (ediff-clone-buffer-for-current-diff-comparison
-		    bufA 'A "-Region.A-")
+		    bufA "-Region.A-")
 		 (ediff-clone-buffer-for-region-comparison bufA "-Region.A-")))
     (ediff-with-current-buffer bufA
       (setq begA (region-beginning)
@@ -3570,7 +3578,7 @@ Ediff Control Panel to restore highlighting."
 
     (setq bufB (if use-current-diff-p
 		   (ediff-clone-buffer-for-current-diff-comparison
-		    bufB 'B "-Region.B-")
+		    bufB "-Region.B-")
 		 (ediff-clone-buffer-for-region-comparison bufB "-Region.B-")))
     (ediff-with-current-buffer bufB
       (setq begB (region-beginning)
-- 
1.7.10






  reply	other threads:[~2012-04-23 19:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 19:28 bug#11318: [Patchset] A bugfix and an arguable bugfix for ediff-inferior-compare-regions Dave Abrahams
2012-04-23 19:28 ` Dave Abrahams [this message]
2012-12-14 15:23   ` bug#11319: [PATCH 1/2] BUGFIX: select current-diff-comparison regions for ediff-inferior-compare-regions correctly Stefan Monnier
2012-12-14 17:17     ` Dave Abrahams
     [not found]     ` <e5472cbf85e944178dd2aebb9d6ed40a@HUBCAS1.cs.stonybrook.edu>
2012-12-15  4:46       ` Michael Kifer
2012-12-17 23:22         ` Dave Abrahams
2012-12-17 23:28           ` Michael Kifer
2012-12-17 23:44             ` Dave Abrahams
2012-12-18  0:01               ` Michael Kifer
2012-04-23 19:28 ` bug#11320: [PATCH 2/2] Useful behavior for ediff-inferior-compare-regions when merging with an ancestor Dave Abrahams
2018-05-12  2:03   ` Noam Postavsky
2018-06-29  2:13     ` Noam Postavsky
2012-05-10  1:05 ` bug#11318: [Patchset] A bugfix and an arguable bugfix for ediff-inferior-compare-regions Glenn Morris
2012-05-10  1:40   ` Dave Abrahams
2012-05-10  4:04   ` Stefan Monnier
2012-05-10  4:20     ` Glenn Morris
2012-05-12 17:18       ` Stefan Monnier
2012-07-21  2:30   ` Dave Abrahams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335209306-81494-2-git-send-email-dave@boostpro.com \
    --to=dave@boostpro.com \
    --cc=11319@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).