summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Abrahams <dave@boostpro.com>2012-12-14 10:22:24 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2012-12-14 10:22:24 -0500
commit665e5e07a99173d6b310bb7234a3bd0d774d107d (patch)
tree82a2f6f6e9f6a418f2ebc6419a5e0dca87ebdd67
parentd72e9e922fb914a946e104ad2128f57c983ab75d (diff)
downloademacs-665e5e07a99173d6b310bb7234a3bd0d774d107d.tar.gz
* lisp/vc/ediff-util.el (ediff-buffer-type): New function.
(ediff-clone-buffer-for-current-diff-comparison): Compute the buf-type rather than taking it as as argument. (ediff-inferior-compare-regions): Adjust calls accordingly. Fixes: debbugs:11319
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/ChangeLog.154
-rw-r--r--lisp/vc/ediff-util.el22
3 files changed, 24 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 97b3a6608ad..61ccbead17d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2012-12-14 Dave Abrahams <dave@boostpro.com>
+
+ * vc/ediff-util.el (ediff-buffer-type): New function.
+ (ediff-clone-buffer-for-current-diff-comparison): Compute the buf-type
+ rather than taking it as as argument.
+ (ediff-inferior-compare-regions): Adjust calls accordingly (bug#11319).
+
2012-12-14 Ryan Crum <ryan.crum@eleostech.com>
* json.el: Add pretty-print option (bug#12634).
diff --git a/lisp/ChangeLog.15 b/lisp/ChangeLog.15
index b97cd80cdba..67801bfa20f 100644
--- a/lisp/ChangeLog.15
+++ b/lisp/ChangeLog.15
@@ -324,7 +324,7 @@
(ert-run-tests-batch, ert--print-test-for-ewoc):
Handle `ert-test-quit'.
-2011-03-03 David Abrahams <dave@boostpro.com> (tiny change)
+2011-03-03 David Abrahams <dave@boostpro.com>
* vc/ediff-init.el (ediff-use-faces, ediff-highlight-all-diffs):
Move ediff-defvar-local calls after defcustoms. (Bug#1821)
@@ -13597,7 +13597,7 @@
* textmodes/artist.el (artist-compute-popup-menu-table):
Remove duplicated words in doc-strings.
-2010-01-15 David Abrahams <dave@boostpro.com> (tiny change)
+2010-01-15 David Abrahams <dave@boostpro.com>
* net/mairix.el (mairix-widget-send-query): Send -1 instead of nil
to mairix-search to suppress threading (Bug#5342).
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index 86293ade580..75becfdeccb 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)
@@ -3466,7 +3474,7 @@ Without an argument, it saves customized diff argument, if available
(defun ediff-inferior-compare-regions ()
"Compare regions in an active Ediff session.
-Like ediff-regions-linewise but is called from under an active Ediff session on
+Like `ediff-regions-linewise' but is called from under an active Ediff session on
the files that belong to that session.
After quitting the session invoked via this function, type C-l to the parent
@@ -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)