summaryrefslogtreecommitdiff
path: root/lisp/vc
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2012-04-10 16:08:43 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2012-04-10 16:08:43 -0400
commit1930bf5dc38950d05a26bbb1118a4602694acfba (patch)
tree0f26df67529ee1cea075c9a2dbc6dc41f6f35ab7 /lisp/vc
parent6bbef4e552d1c3cbb08fc8b5224ebcaa663ff95a (diff)
downloademacs-1930bf5dc38950d05a26bbb1118a4602694acfba.tar.gz
* lisp/vc/vc-annotate.el (vc-annotate-show-diff-revision-at-line-internal):
Use derived-mode-p. Run the diff asynchronously.
Diffstat (limited to 'lisp/vc')
-rw-r--r--lisp/vc/vc-annotate.el28
1 files changed, 13 insertions, 15 deletions
diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el
index a1dd807d828..f4964ef85cc 100644
--- a/lisp/vc/vc-annotate.el
+++ b/lisp/vc/vc-annotate.el
@@ -522,12 +522,12 @@ the file in question, search for the log entry required and move point."
(car rev-at-line) t 1)))))))
(defun vc-annotate-show-diff-revision-at-line-internal (filediff)
- (if (not (equal major-mode 'vc-annotate-mode))
+ (if (not (derived-mode-p 'vc-annotate-mode))
(message "Cannot be invoked outside of a vc annotate buffer")
(let* ((rev-at-line (vc-annotate-extract-revision-at-line))
- (prev-rev nil)
- (rev (car rev-at-line))
- (fname (cdr rev-at-line)))
+ (prev-rev nil)
+ (rev (car rev-at-line))
+ (fname (cdr rev-at-line)))
(if (not rev-at-line)
(message "Cannot extract revision number from the current line")
(setq prev-rev
@@ -535,17 +535,15 @@ the file in question, search for the log entry required and move point."
(if filediff fname nil) rev))
(if (not prev-rev)
(message "Cannot diff from any revision prior to %s" rev)
- (save-window-excursion
- (vc-diff-internal
- nil
- ;; The value passed here should follow what
- ;; `vc-deduce-fileset' returns.
- (list vc-annotate-backend
- (if filediff
- (list fname)
- nil))
- prev-rev rev))
- (switch-to-buffer "*vc-diff*"))))))
+ (vc-diff-internal
+ t
+ ;; The value passed here should follow what
+ ;; `vc-deduce-fileset' returns.
+ (list vc-annotate-backend
+ (if filediff
+ (list fname)
+ nil))
+ prev-rev rev))))))
(defun vc-annotate-show-diff-revision-at-line ()
"Visit the diff of the revision at line from its previous revision."