diff options
| author | Dave Abrahams | 2012-12-14 10:22:24 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2012-12-14 10:22:24 -0500 |
| commit | 665e5e07a99173d6b310bb7234a3bd0d774d107d (patch) | |
| tree | 82a2f6f6e9f6a418f2ebc6419a5e0dca87ebdd67 /lisp/vc | |
| parent | d72e9e922fb914a946e104ad2128f57c983ab75d (diff) | |
| download | emacs-665e5e07a99173d6b310bb7234a3bd0d774d107d.tar.gz emacs-665e5e07a99173d6b310bb7234a3bd0d774d107d.zip | |
* 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
Diffstat (limited to 'lisp/vc')
| -rw-r--r-- | lisp/vc/ediff-util.el | 22 |
1 files changed, 15 insertions, 7 deletions
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 | |||
| 3378 | (set-window-buffer wind cloned-buff) | 3378 | (set-window-buffer wind cloned-buff) |
| 3379 | cloned-buff)) | 3379 | cloned-buff)) |
| 3380 | 3380 | ||
| 3381 | (defun ediff-clone-buffer-for-current-diff-comparison (buff buf-type reg-name) | 3381 | (defun ediff-buffer-type (buffer) |
| 3382 | (let ((cloned-buff (ediff-make-cloned-buffer buff reg-name)) | 3382 | (cond ((eq buffer ediff-buffer-A) 'A) |
| 3383 | (reg-start (ediff-get-diff-posn buf-type 'beg)) | 3383 | ((eq buffer ediff-buffer-B) 'B) |
| 3384 | (reg-end (ediff-get-diff-posn buf-type 'end))) | 3384 | ((eq buffer ediff-buffer-C) 'C) |
| 3385 | ((eq buffer ediff-ancestor-buffer) 'Ancestor) | ||
| 3386 | (t nil))) | ||
| 3387 | |||
| 3388 | (defun ediff-clone-buffer-for-current-diff-comparison (buff reg-name) | ||
| 3389 | (let* ((cloned-buff (ediff-make-cloned-buffer buff reg-name)) | ||
| 3390 | (buf-type (ediff-buffer-type buff)) | ||
| 3391 | (reg-start (ediff-get-diff-posn buf-type 'beg)) | ||
| 3392 | (reg-end (ediff-get-diff-posn buf-type 'end))) | ||
| 3385 | (ediff-with-current-buffer cloned-buff | 3393 | (ediff-with-current-buffer cloned-buff |
| 3386 | ;; set region to be the current diff region | 3394 | ;; set region to be the current diff region |
| 3387 | (goto-char reg-start) | 3395 | (goto-char reg-start) |
| @@ -3466,7 +3474,7 @@ Without an argument, it saves customized diff argument, if available | |||
| 3466 | 3474 | ||
| 3467 | (defun ediff-inferior-compare-regions () | 3475 | (defun ediff-inferior-compare-regions () |
| 3468 | "Compare regions in an active Ediff session. | 3476 | "Compare regions in an active Ediff session. |
| 3469 | Like ediff-regions-linewise but is called from under an active Ediff session on | 3477 | Like `ediff-regions-linewise' but is called from under an active Ediff session on |
| 3470 | the files that belong to that session. | 3478 | the files that belong to that session. |
| 3471 | 3479 | ||
| 3472 | After quitting the session invoked via this function, type C-l to the parent | 3480 | After quitting the session invoked via this function, type C-l to the parent |
| @@ -3555,7 +3563,7 @@ Ediff Control Panel to restore highlighting." | |||
| 3555 | 3563 | ||
| 3556 | (setq bufA (if use-current-diff-p | 3564 | (setq bufA (if use-current-diff-p |
| 3557 | (ediff-clone-buffer-for-current-diff-comparison | 3565 | (ediff-clone-buffer-for-current-diff-comparison |
| 3558 | bufA 'A "-Region.A-") | 3566 | bufA "-Region.A-") |
| 3559 | (ediff-clone-buffer-for-region-comparison bufA "-Region.A-"))) | 3567 | (ediff-clone-buffer-for-region-comparison bufA "-Region.A-"))) |
| 3560 | (ediff-with-current-buffer bufA | 3568 | (ediff-with-current-buffer bufA |
| 3561 | (setq begA (region-beginning) | 3569 | (setq begA (region-beginning) |
| @@ -3570,7 +3578,7 @@ Ediff Control Panel to restore highlighting." | |||
| 3570 | 3578 | ||
| 3571 | (setq bufB (if use-current-diff-p | 3579 | (setq bufB (if use-current-diff-p |
| 3572 | (ediff-clone-buffer-for-current-diff-comparison | 3580 | (ediff-clone-buffer-for-current-diff-comparison |
| 3573 | bufB 'B "-Region.B-") | 3581 | bufB "-Region.B-") |
| 3574 | (ediff-clone-buffer-for-region-comparison bufB "-Region.B-"))) | 3582 | (ediff-clone-buffer-for-region-comparison bufB "-Region.B-"))) |
| 3575 | (ediff-with-current-buffer bufB | 3583 | (ediff-with-current-buffer bufB |
| 3576 | (setq begB (region-beginning) | 3584 | (setq begB (region-beginning) |