diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-25 23:17:52 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-25 23:17:52 -0700 |
| commit | 671875dac181f7f1337f21d013a9c3d5f235ddf2 (patch) | |
| tree | 4091c2537439713df8efe8d3376116a6db3eb1c5 /lisp/vc/vc-annotate.el | |
| parent | f904488ff40dcee3e340b63a6386dde124d1241c (diff) | |
| parent | 0c6b7b19e52ba18b5d4fd2d4b73b133a0a721603 (diff) | |
| download | emacs-671875dac181f7f1337f21d013a9c3d5f235ddf2.tar.gz | |
Merge from mainline.
Diffstat (limited to 'lisp/vc/vc-annotate.el')
| -rw-r--r-- | lisp/vc/vc-annotate.el | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el index 271fce12429..abd3806d02f 100644 --- a/lisp/vc/vc-annotate.el +++ b/lisp/vc/vc-annotate.el @@ -128,6 +128,8 @@ List of factors, used to expand/compress the time scale. See `vc-annotate'." (define-key m "p" 'vc-annotate-prev-revision) (define-key m "w" 'vc-annotate-working-revision) (define-key m "v" 'vc-annotate-toggle-annotation-visibility) + (define-key m "v" 'vc-annotate-toggle-annotation-visibility) + (define-key m "\C-m" 'vc-annotate-goto-line) m) "Local keymap used for VC-Annotate mode.") @@ -673,6 +675,36 @@ The annotations are relative to the current time, unless overridden by OFFSET." ;; Pretend to font-lock there were no matches. nil) +(defun vc-annotate-goto-line () + "Go to the line corresponding to the current VC Annotate line." + (interactive) + (unless (eq major-mode 'vc-annotate-mode) + (error "Not in a VC-Annotate buffer")) + (let ((line (save-restriction + (widen) + (line-number-at-pos))) + (rev vc-annotate-parent-rev)) + (pop-to-buffer + (or (and (buffer-live-p vc-parent-buffer) + vc-parent-buffer) + (and (file-exists-p vc-annotate-parent-file) + (find-file-noselect vc-annotate-parent-file)) + (error "File not found: %s" vc-annotate-parent-file))) + (save-restriction + (widen) + (goto-char (point-min)) + (forward-line (1- line)) + (recenter)) + ;; Issue a warning if the lines might be incorrect. + (cond + ((buffer-modified-p) + (message "Buffer modified; annotated line numbers may be incorrect")) + ((not (eq (vc-state buffer-file-name) 'up-to-date)) + (message "File is not up-to-date; annotated line numbers may be incorrect")) + ((not (equal rev (vc-working-revision buffer-file-name))) + (message "Annotations were for revision %s; line numbers may be incorrect" + rev))))) + (provide 'vc-annotate) ;;; vc-annotate.el ends here |
