=== modified file 'lisp/vc/ediff-vers.el' --- lisp/vc/ediff-vers.el 2011-01-25 04:08:28 +0000 +++ lisp/vc/ediff-vers.el 2011-03-10 04:03:04 +0000 @@ -59,6 +59,14 @@ 'vc-working-revision 'vc-workfile-version)) + +(defun ediff-revision-internal (rev1 rev2 &optional startup-hook) + ;; Call backend-specific ediff function. Uses `vc.el' or `rcs.el' + ;; depending on `ediff-version-control-package'." + (funcall + (intern (format "ediff-%S-internal" ediff-version-control-package)) + rev1 rev2 startup-hook)) + ;; VC.el support (eval-when-compile === modified file 'lisp/vc/ediff.el' --- lisp/vc/ediff.el 2011-01-25 04:08:28 +0000 +++ lisp/vc/ediff.el 2011-03-10 04:03:14 +0000 @@ -1408,8 +1408,7 @@ (defun ediff-revision (&optional file startup-hooks) "Run Ediff by comparing versions of a file. The file is an optional FILE argument or the file entered at the prompt. -Default: the file visited by the current buffer. -Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'." +Default: the file visited by the current buffer." ;; if buffer is non-nil, use that buffer instead of the current buffer (interactive "P") (if (not (stringp file)) @@ -1435,11 +1434,7 @@ (format "Revision 2 to compare (default %s's current state): " (file-name-nondirectory file)))) (ediff-load-version-control) - (funcall - (intern (format "ediff-%S-internal" ediff-version-control-package)) - rev1 rev2 startup-hooks) - )) - + (ediff-revision-internal rev1 rev2 startup-hooks))) ;;;###autoload (defalias 'erevision 'ediff-revision) === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2011-03-07 08:56:30 +0000 +++ lisp/vc/vc.el 2011-03-10 04:04:32 +0000 @@ -1681,6 +1681,35 @@ (called-interactively-p 'interactive)))) ;;;###autoload +(defun vc-ediff (historic &optional not-urgent) + "Display diffs between revisions of a file using ediff. +Normally this compares the currently selected file with its +working revision. With the prefix argument HISTORIC, it reads two revision +designators specifying which revisions to compare. + +The optional argument NOT-URGENT non-nil means it is ok to say no +to saving the buffer." + (interactive (list current-prefix-arg t)) + (when buffer-file-name (vc-buffer-sync not-urgent)) + (let* ((vc-fileset (vc-deduce-fileset not-urgent)) + (files (cadr vc-fileset)) + (first (car files))) + (cond + ;; FIXME: Only supports one selected file (for now?). + ;; Alternatively, we could spin off a separate ediff session + ;; for each of the selected files. + ((= (length files) 1) + (if historic + ;; Let user select revisions to compare. + (ediff-revision first) + (find-file first) + ;; With empty arguments, function compares latest version of + ;; current buffer's file with current buffer. + (ediff-revision-internal "" ""))) + (t + (error "`vc-ediff' does not support selecting more than one file!"))))) + +;;;###autoload (defun vc-root-diff (historic &optional not-urgent) "Display diffs between VC-controlled whole tree revisions. Normally, this compares the tree corresponding to the current