summaryrefslogtreecommitdiff
path: root/lisp/vc.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-06-14 17:29:10 +0000
committerRichard M. Stallman <rms@gnu.org>1997-06-14 17:29:10 +0000
commitf80f7bc21f1f95409b425a58b145327bbe6b959b (patch)
treeb2adff83383d394af61303ad4499ae1f49ba64b9 /lisp/vc.el
parent80402f25189e82a3d28af46f818dcb1f89a1149f (diff)
downloademacs-f80f7bc21f1f95409b425a58b145327bbe6b959b.tar.gz
(vc-annotate-mode-variables): Init vc-annotate-mode-menu
and put it into vc-annotate-mode-map. (vc-annotate-add-menu): Don't init vc-annotate-mode-menu, just add the bindings to it. Display progress messages. (vc-annotate-mode-menu): New defvar. (vc-annotate-ratio): Move defvar, add initial value. (vc-annotate-display-default): Display progress messages. (vc-annotate-display): Use vc-annotate-color-map.
Diffstat (limited to 'lisp/vc.el')
-rw-r--r--lisp/vc.el41
1 files changed, 32 insertions, 9 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index 837c98da1df..fca193a0b90 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -1984,19 +1984,32 @@ default directory."
(defvar vc-annotate-mode nil
"Variable indicating if VC-Annotate mode is active.")
-(defvar vc-annotate-mode-map ()
+(defvar vc-annotate-mode-map nil
"Local keymap used for VC-Annotate mode.")
+(defvar vc-annotate-mode-menu nil
+ "Local keymap used for VC-Annotate mode's menu bar menu.")
+
;; Syntax Table
(defvar vc-annotate-mode-syntax-table nil
"Syntax table used in VC-Annotate mode buffers.")
+;; Declare globally instead of additional parameter to
+;; temp-buffer-show-function (not possible to pass more than one
+;; parameter).
+(defvar vc-annotate-ratio nil)
+
(defun vc-annotate-mode-variables ()
(if (not vc-annotate-mode-syntax-table)
(progn (setq vc-annotate-mode-syntax-table (make-syntax-table))
(set-syntax-table vc-annotate-mode-syntax-table)))
(if (not vc-annotate-mode-map)
- (setq vc-annotate-mode-map (make-sparse-keymap))))
+ (setq vc-annotate-mode-map (make-sparse-keymap)))
+ (setq vc-annotate-mode-menu (make-sparse-keymap "Annotate"))
+ (define-key vc-annotate-mode-map [menu-bar]
+ (make-sparse-keymap "VC-Annotate"))
+ (define-key vc-annotate-mode-map [menu-bar vc-annotate-mode]
+ (cons "VC-Annotate" vc-annotate-mode-menu)))
(defun vc-annotate-mode ()
"Major mode for buffers displaying output from the CVS `annotate' command.
@@ -2018,11 +2031,12 @@ menu items."
(defun vc-annotate-display-default (&optional event)
"Use the default color spectrum for VC Annotate mode."
(interactive)
- (vc-annotate-display (get-buffer (buffer-name))))
+ (message "Redisplaying annotation...")
+ (vc-annotate-display (get-buffer (buffer-name)))
+ (message "Redisplaying annotation...done"))
(defun vc-annotate-add-menu ()
"Adds the menu 'Annotate' to the menu bar in VC-Annotate mode."
- (setq vc-annotate-mode-menu (make-sparse-keymap "Annotate"))
(define-key vc-annotate-mode-menu [default]
'("Default" . vc-annotate-display-default))
(let ((menu-elements vc-annotate-menu-elements))
@@ -2038,10 +2052,12 @@ menu items."
days)
`(lambda ()
,(format "Use colors spanning %d days" days)
- (vc-annotate-display (get-buffer (buffer-name))
- (vc-annotate-time-span ,element)))))))))
-
-(defvar vc-annotate-ratio)
+ (interactive)
+ (message "Redisplaying annotation...")
+ (vc-annotate-display
+ (get-buffer (buffer-name))
+ (vc-annotate-time-span vc-annotate-color-map ,element))
+ (message "Redisplaying annotation...done"))))))))
;;;###autoload
(defun vc-annotate (ratio)
@@ -2098,8 +2114,15 @@ Return the first cons which CAR is not less than THRESHOLD, nil otherwise"
(defun vc-annotate-display (buffer &optional color-map)
"Do the VC-Annotate display in BUFFER using COLOR-MAP."
+ ;; Handle the case of the global variable vc-annotate-ratio being
+ ;; set. This variable is used to pass information from function
+ ;; vc-annotate since it is not possible to use another parameter
+ ;; (see temp-buffer-show-function).
(if (and (not color-map) vc-annotate-ratio)
- (setq color-map (vc-annotate-time-span color-map vc-annotate-ratio)))
+ ;; This will only be true if called from vc-annotate with ratio
+ ;; being non-nil.
+ (setq color-map (vc-annotate-time-span vc-annotate-color-map
+ vc-annotate-ratio)))
;; We need a list of months and their corresponding numbers.
(let* ((local-month-numbers