+2005-12-28 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * vc.el (vc-annotate-mode-map): Remove obsolete binding.
+ (vc-annotate-mode-menu): Remove left-over redundant declaration.
+ Correct the construction of span entries. Simplify.
+ (vc-annotate-display-select): Fix the nil case.
+ (vc-annotate): Remove obsolete (and now broken) code.
+ (vc-annotate-extract-revision-at-line): Remove obsolete code.
+ (vc-annotate-time-span): Remove unused arg `quantize'. Simplify.
+
2005-12-28 Luc Teirlinck <teirllm@auburn.edu>
* subr.el (lazy-completion-table): Correct typo in docstring.
2005-12-05 Ralf Angeli <angeli@iwi.uni-sb.de>
- * mail/smtpmail.el (smtpmail-try-auth-methods): Send
- credentials together with "AUTH PLAIN" command.
+ * mail/smtpmail.el (smtpmail-try-auth-methods):
+ Send credentials together with "AUTH PLAIN" command.
2005-12-27 Richard M. Stallman <rms@gnu.org>
2005-12-27 Juri Linkov <juri@jurta.org>
* help-mode.el (help-insert-string): New function. Save buffer
- contents in cases where it is impossible to recompute the old
- contents.
+ contents in cases where it is impossible to recompute the old contents.
* descr-text.el (describe-char): Set help-xref-stack-item
explicitly after buffer has been generated.
(defvar vc-annotate-mode-map
(let ((m (make-sparse-keymap)))
- (define-key m [menu-bar] (make-sparse-keymap "VC-Annotate"))
(define-key m "A" 'vc-annotate-revision-previous-to-line)
(define-key m "D" 'vc-annotate-show-diff-revision-at-line)
(define-key m "J" 'vc-annotate-revision-at-line)
m)
"Local keymap used for VC-Annotate mode.")
-(defvar vc-annotate-mode-menu nil
- "Local keymap used for VC-Annotate mode's menu bar menu.")
-
;; Header-insertion hair
(defcustom vc-static-header-alist
(vc-annotate-display
(vc-annotate-time-span ;return the scaled colormap.
vc-annotate-color-map
- (/ (- (if full newest current) oldest)
+ (/ (- (if full newest current) oldest)
(vc-annotate-car-last-cons vc-annotate-color-map)))
(if full newest))
(message "Redisplaying annotation...done \(%s\)"
,@(let ((oldest-in-map (vc-annotate-car-last-cons vc-annotate-color-map)))
(mapcar (lambda (element)
(let ((days (* element oldest-in-map)))
- `([,(format "Span %.1f days" days)
- (unless (and (numberp vc-annotate-display-mode)
- (= vc-annotate-display-mode ,days))
- (vc-annotate-display-select nil ,days))
- :style toggle :selected
- (and (numberp vc-annotate-display-mode)
- (= vc-annotate-display-mode ,days)) ])))
+ `[,(format "Span %.1f days" days)
+ (vc-annotate-display-select nil ,days)
+ :style toggle :selected
+ (eql vc-annotate-display-mode ,days) ]))
vc-annotate-menu-elements))
["Span ..."
- (let ((days
- (float (string-to-number
- (read-string "Span how many days? ")))))
- (vc-annotate-display-select nil days)) t]
+ (vc-annotate-display-select
+ nil (float (string-to-number (read-string "Span how many days? "))))]
"--"
["Span to Oldest"
(unless (eq vc-annotate-display-mode 'scale)
(if (not vc-annotate-parent-rev)
(vc-annotate-mode))
(cond ((null vc-annotate-display-mode)
+ ;; The ratio is global, thus relative to the global color-map.
+ (kill-local-variable 'vc-annotate-color-map)
(vc-annotate-display-default vc-annotate-ratio))
;; One of the auto-scaling modes
((eq vc-annotate-display-mode 'scale)
(rename-buffer temp-buffer-name t)
;; In case it had to be uniquified.
(setq temp-buffer-name (buffer-name))))
- (if (not (vc-find-backend-function vc-annotate-backend 'annotate-command))
- (error "Sorry, annotating is not implemented for %s"
- vc-annotate-backend))
(with-output-to-temp-buffer temp-buffer-name
(vc-call annotate-command file (get-buffer temp-buffer-name) rev))
(with-current-buffer temp-buffer-name
(defun vc-annotate-extract-revision-at-line ()
"Extract the revision number of the current line."
;; This function must be invoked from a buffer in vc-annotate-mode
- (save-window-excursion
- (vc-ensure-vc-buffer)
- (setq vc-annotate-backend (vc-backend buffer-file-name)))
(vc-call-backend vc-annotate-backend 'annotate-extract-revision-at-line))
(defun vc-annotate-revision-at-line ()
(previous-line)
(line-number-at-pos))))))))
-(defun vc-annotate-time-span (a-list span &optional quantize)
+(defun vc-annotate-time-span (a-list span)
"Apply factor SPAN to the time-span of association list A-LIST.
-Return the new alist.
-Optionally quantize to the factor of QUANTIZE."
+Return the new alist."
;; Apply span to each car of every cons
- (if (not (eq nil a-list))
- (append (list (cons (* (car (car a-list)) span)
- (cdr (car a-list))))
- (vc-annotate-time-span (nthcdr (or quantize ; optional
- 1) ; Default to cdr
- a-list) span quantize))))
+ (mapcar (lambda (elem) (cons (* (car elem) span) (cdr elem)))
+ a-list))
(defun vc-annotate-compcar (threshold a-list)
"Test successive cons cells of A-LIST against THRESHOLD.