# HG changeset patch # User Dan Nicolaescu # Date 1202974671 0 # Node ID 98b6c9d8facaefb8446e219a6a7915c49ac62b2b # Parent d9b5db4c83853c98d0f8d4c35a7f435cdedf6a43 (vc-annotate-find-revision-at-line): New function. (vc-annotate-mode-map): Bind it. (vc-annotate-mode-menu): Add a menu entry for it. Add :help for some entries. diff -r d9b5db4c8385 -r 98b6c9d8faca etc/NEWS --- a/etc/NEWS Thu Feb 14 03:57:12 2008 +0000 +++ b/etc/NEWS Thu Feb 14 07:37:51 2008 +0000 @@ -348,6 +348,9 @@ *** In VC Annotate mode, you can type V to toggle the annotation visibility. +*** In VC Annotate mode, you can type f to show the file revision on +the current line. + ** log-edit now has a command bound to C-c C-d to show the diff for the files involved. diff -r d9b5db4c8385 -r 98b6c9d8faca lisp/ChangeLog --- a/lisp/ChangeLog Thu Feb 14 03:57:12 2008 +0000 +++ b/lisp/ChangeLog Thu Feb 14 07:37:51 2008 +0000 @@ -1,3 +1,10 @@ +2008-02-14 Dan Nicolaescu + + * vc.el (vc-annotate-find-revision-at-line): New function. + (vc-annotate-mode-map): Bind it. + (vc-annotate-mode-menu): Add a menu entry for it. Add :help for + some entries. + 2008-02-14 Glenn Morris * Makefile.in (custom-deps, finder-data, autoloads, recompile): diff -r d9b5db4c8385 -r 98b6c9d8faca lisp/vc.el --- a/lisp/vc.el Thu Feb 14 03:57:12 2008 +0000 +++ b/lisp/vc.el Thu Feb 14 07:37:51 2008 +0000 @@ -820,6 +820,7 @@ (let ((m (make-sparse-keymap))) (define-key m "A" 'vc-annotate-revision-previous-to-line) (define-key m "D" 'vc-annotate-show-diff-revision-at-line) + (define-key m "f" 'vc-annotate-find-revision-at-line) (define-key m "J" 'vc-annotate-revision-at-line) (define-key m "L" 'vc-annotate-show-log-revision-at-line) (define-key m "N" 'vc-annotate-next-revision) @@ -3624,22 +3625,39 @@ ["Span to Oldest" (unless (eq vc-annotate-display-mode 'scale) (vc-annotate-display-select nil 'scale)) + :help + "Use an autoscaled color map from the oldest annotation to the current time" :style toggle :selected (eq vc-annotate-display-mode 'scale)] ["Span Oldest->Newest" (unless (eq vc-annotate-display-mode 'fullscale) (vc-annotate-display-select nil 'fullscale)) + :help + "Use an autoscaled color map from the oldest to the newest annotation" :style toggle :selected (eq vc-annotate-display-mode 'fullscale)] "--" - ["Toggle annotation visibility" vc-annotate-toggle-annotation-visibility] - ["Annotate previous revision" vc-annotate-prev-revision] - ["Annotate next revision" vc-annotate-next-revision] - ["Annotate revision at line" vc-annotate-revision-at-line] - ["Annotate revision previous to line" vc-annotate-revision-previous-to-line] - ["Annotate latest revision" vc-annotate-working-revision] - ["Show log of revision at line" vc-annotate-show-log-revision-at-line] - ["Show diff of revision at line" vc-annotate-show-diff-revision-at-line])) + ["Toggle annotation visibility" vc-annotate-toggle-annotation-visibility + :help + "Toggle whether the annotation is visible or not"] + ["Annotate previous revision" vc-annotate-prev-revision + :help "Visit the annotation of the revision previous to this one"] + ["Annotate next revision" vc-annotate-next-revision + :help "Visit the annotation of the revision after this one"] + ["Annotate revision at line" vc-annotate-revision-at-line + :help + "Visit the annotation of the revision identified in the current line"] + ["Annotate revision previous to line" vc-annotate-revision-previous-to-line + :help "Visit the annotation of the revision before the revision at line"] + ["Annotate latest revision" vc-annotate-working-revision + :help "Visit the annotation of the working revision of this file"] + ["Show log of revision at line" vc-annotate-show-log-revision-at-line + :help "Visit the log of the revision at line"] + ["Show diff of revision at line" vc-annotate-show-diff-revision-at-line + :help + "Visit the diff of the revision at line from its previous revision"] + ["Visit revision at line" vc-annotate-find-revision-at-line + :help "Visit the revision identified in the current line"])) (defun vc-annotate-display-select (&optional buffer mode) "Highlight the output of \\[vc-annotate]. @@ -3790,6 +3808,16 @@ (message "Already at revision %s" rev-at-line) (vc-annotate-warp-revision rev-at-line)))))) +(defun vc-annotate-find-revision-at-line () + "Visit the revision identified in the current line." + (interactive) + (if (not (equal major-mode 'vc-annotate-mode)) + (message "Cannot be invoked outside of a vc annotate buffer") + (let ((rev-at-line (vc-annotate-extract-revision-at-line))) + (if (not rev-at-line) + (message "Cannot extract revision number from the current line") + (vc-revision-other-window rev-at-line))))) + (defun vc-annotate-revision-previous-to-line () "Visit the annotation of the revision before the revision at line." (interactive)