;;; vc-annotate.el --- VC Annotate Support
;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-;; 2007, 2008 Free Software Foundation, Inc.
+;; 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Martin Lorentzson <emwson@emw.ericsson.se>
;; Maintainer: FSF
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
-;;
+;;
(require 'vc-hooks)
(require 'vc)
:group 'vc)
(defcustom vc-annotate-very-old-color "#3F3FFF"
- "Color for lines older than the current color range in \\[vc-annotate]]."
+ "Color for lines older than the current color range in \\[vc-annotate]."
:type 'string
:group 'vc)
(defvar vc-annotate-mode-map
(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 "a" 'vc-annotate-revision-previous-to-line)
+ (define-key m "d" 'vc-annotate-show-diff-revision-at-line)
+ (define-key m "D" 'vc-annotate-show-changeset-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)
- (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 "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)
+ (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)
m)
"Local keymap used for VC-Annotate mode.")
;; The fontification is done by vc-annotate-lines instead of font-lock.
'((vc-annotate-lines)))
-(define-derived-mode vc-annotate-mode fundamental-mode "Annotate"
+(define-derived-mode vc-annotate-mode special-mode "Annotate"
"Major mode for output buffers of the `vc-annotate' command.
You can use the mode-specific menu to alter the time-span of the used
(remove-from-invisibility-spec 'foo)
(set (make-local-variable 'truncate-lines) t)
(set (make-local-variable 'font-lock-defaults)
- '(vc-annotate-font-lock-keywords t))
- (view-mode 1))
+ '(vc-annotate-font-lock-keywords t)))
(defun vc-annotate-toggle-annotation-visibility ()
"Toggle whether or not the annotation is visible."
: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
;; If BUF is specified, we presume the caller maintains current line,
;; so we don't need to do it here. This implementation may give
;; strange results occasionally in the case of REV != WORKFILE-REV.
- (current-line (or move-point-to (unless buf (line-number-at-pos)))))
+ (current-line (or move-point-to (unless buf
+ (save-restriction
+ (widen)
+ (line-number-at-pos))))))
(message "Annotating...")
;; If BUF is specified it tells in which buffer we should put the
;; annotations. This is used when switching annotations to another
(defun vc-annotate-warp-revision (revspec)
"Annotate the revision described by REVSPEC.
-If REVSPEC is a positive integer, warp that many revisions
-forward, if possible, otherwise echo a warning message. If
-REVSPEC is a negative integer, warp that many revisions backward,
+If REVSPEC is a positive integer, warp that many revisions forward,
if possible, otherwise echo a warning message. If REVSPEC is a
-string, then it describes a revision number, so warp to that
-revision."
+negative integer, warp that many revisions backward, if possible,
+otherwise echo a warning message. If REVSPEC is a string, then it
+describes a revision number, so warp to that revision."
(if (not (equal major-mode 'vc-annotate-mode))
(message "Cannot be invoked outside of a vc annotate buffer")
(let* ((buf (current-buffer))
(defun vc-annotate-display (ratio &optional offset)
"Highlight `vc-annotate' output in the current buffer.
-RATIO, is the expansion that should be applied to `vc-annotate-color-map'.
+RATIO is the expansion that should be applied to `vc-annotate-color-map'.
The annotations are relative to the current time, unless overridden by OFFSET."
(when (/= ratio 1.0)
(set (make-local-variable 'vc-annotate-color-map)