aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Spiegel2000-11-16 13:39:10 +0000
committerAndré Spiegel2000-11-16 13:39:10 +0000
commitafe355024f0ddac456583f823c4545f17f4e8c23 (patch)
treececf091c5f2a791b206bc7ab29a27bb51970bf18
parentffe586ab5c33f6a92cdb190a06b78a18c58c8416 (diff)
downloademacs-afe355024f0ddac456583f823c4545f17f4e8c23.tar.gz
emacs-afe355024f0ddac456583f823c4545f17f4e8c23.zip
(vc-annotate): Changed handling of prefix arg; now asks for both
version and ratio in the minibuffer.
-rw-r--r--lisp/vc.el32
1 files changed, 21 insertions, 11 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index 9b523832b14..26f58b9d6d7 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -5,7 +5,7 @@
5;; Author: FSF (see below for full credits) 5;; Author: FSF (see below for full credits)
6;; Maintainer: Andre Spiegel <spiegel@gnu.org> 6;; Maintainer: Andre Spiegel <spiegel@gnu.org>
7 7
8;; $Id: vc.el,v 1.284 2000/10/26 20:53:11 monnier Exp $ 8;; $Id: vc.el,v 1.285 2000/10/27 12:13:19 spiegel Exp $
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
@@ -147,7 +147,7 @@
147;; * latest-on-branch-p (file) 147;; * latest-on-branch-p (file)
148;; - cancel-version (file writable) 148;; - cancel-version (file writable)
149;; - rename-file (old new) 149;; - rename-file (old new)
150;; - annotate-command (file buf) 150;; - annotate-command (file buf rev)
151;; - annotate-difference (pos) 151;; - annotate-difference (pos)
152;; Only required if `annotate-command' is defined for the backend. 152;; Only required if `annotate-command' is defined for the backend.
153 153
@@ -2612,30 +2612,40 @@ menu items."
2612;;;; the contents in BUFFER. 2612;;;; the contents in BUFFER.
2613 2613
2614;;;###autoload 2614;;;###autoload
2615(defun vc-annotate (ratio) 2615(defun vc-annotate (prefix)
2616 "Display the result of the \"Annotate\" command using colors. 2616 "Display the result of the \"Annotate\" command using colors.
2617\"Annotate\" is defined by `vc-BACKEND-annotate-command'. New lines 2617\"Annotate\" is defined by `vc-BACKEND-annotate-command'. New lines
2618are displayed in red, old in blue. A prefix argument specifies a 2618are displayed in red, old in blue. When given a prefix argument, asks
2619factor for stretching the time scale. 2619for a version to annotate from, and a factor for stretching the time
2620scale.
2620 2621
2621`vc-annotate-menu-elements' customizes the menu elements of the 2622`vc-annotate-menu-elements' customizes the menu elements of the
2622mode-specific menu. `vc-annotate-color-map' and 2623mode-specific menu. `vc-annotate-color-map' and
2623`vc-annotate-very-old-color' defines the mapping of time to 2624`vc-annotate-very-old-color' defines the mapping of time to
2624colors. `vc-annotate-background' specifies the background color." 2625colors. `vc-annotate-background' specifies the background color."
2625 (interactive "p") 2626 (interactive "P")
2626 (vc-ensure-vc-buffer) 2627 (vc-ensure-vc-buffer)
2627 (message "Annotating...")
2628 (let ((temp-buffer-name (concat "*Annotate " (buffer-name) "*")) 2628 (let ((temp-buffer-name (concat "*Annotate " (buffer-name) "*"))
2629 (temp-buffer-show-function 'vc-annotate-display) 2629 (temp-buffer-show-function 'vc-annotate-display)
2630 (vc-annotate-ratio ratio) 2630 (vc-annotate-version
2631 (vc-annotate-backend (vc-backend (buffer-file-name)))) 2631 (if prefix (read-string
2632 (format "Annotate from version: (default %s) "
2633 (vc-workfile-version (buffer-file-name)))
2634 nil nil (vc-workfile-version (buffer-file-name)))))
2635 (vc-annotate-ratio
2636 (if prefix (string-to-number
2637 (read-string "Annotate ratio: (default 1.0) "
2638 nil nil "1.0"))))
2639 (vc-annotate-backend (vc-backend (buffer-file-name))))
2640 (message "Annotating...")
2632 (if (not (vc-find-backend-function vc-annotate-backend 'annotate-command)) 2641 (if (not (vc-find-backend-function vc-annotate-backend 'annotate-command))
2633 (error "Sorry, annotating is not implemented for %s" 2642 (error "Sorry, annotating is not implemented for %s"
2634 vc-annotate-backend)) 2643 vc-annotate-backend))
2635 (with-output-to-temp-buffer temp-buffer-name 2644 (with-output-to-temp-buffer temp-buffer-name
2636 (vc-call-backend vc-annotate-backend 'annotate-command 2645 (vc-call-backend vc-annotate-backend 'annotate-command
2637 (file-name-nondirectory (buffer-file-name)) 2646 (file-name-nondirectory (buffer-file-name))
2638 (get-buffer temp-buffer-name))) 2647 (get-buffer temp-buffer-name)
2648 vc-annotate-version))
2639 ;; Don't use the temp-buffer-name until the buffer is created 2649 ;; Don't use the temp-buffer-name until the buffer is created
2640 ;; (only after `with-output-to-temp-buffer'.) 2650 ;; (only after `with-output-to-temp-buffer'.)
2641 (setq vc-annotate-buffers 2651 (setq vc-annotate-buffers