From 665e5e07a99173d6b310bb7234a3bd0d774d107d Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 14 Dec 2012 10:22:24 -0500 Subject: [PATCH] * 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 --- lisp/ChangeLog | 7 +++++++ lisp/ChangeLog.15 | 4 ++-- lisp/vc/ediff-util.el | 22 +++++++++++++++------- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 97b3a6608a..61ccbead17 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-12-14 Dave Abrahams + + * 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 * json.el: Add pretty-print option (bug#12634). diff --git a/lisp/ChangeLog.15 b/lisp/ChangeLog.15 index b97cd80cdb..67801bfa20 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 (tiny change) +2011-03-03 David Abrahams * 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 (tiny change) +2010-01-15 David Abrahams * 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 86293ade58..75becfdecc 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) -- 2.20.1