comparison lisp/vc.el @ 24139:2b3e32c0fc18

(vc-annotate-display): Delete old overlays. Fix check for major-mode. (vc-annotate-mode): Delete variable.
author André Spiegel <spiegel@gnu.org>
date Fri, 22 Jan 1999 16:28:12 +0000
parents 9caafbfd8130
children b3b029a06e34
comparison
equal deleted inserted replaced
24138:8ca6326a79e1 24139:2b3e32c0fc18
3 ;; Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. 3 ;; Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
4 4
5 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com> 5 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
6 ;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de> 6 ;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de>
7 7
8 ;; $Id: vc.el,v 1.241 1998/12/08 16:04:52 rost Exp rms $ 8 ;; $Id: vc.el,v 1.242 1999/01/02 21:54:32 rms Exp spiegel $
9 9
10 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
11 11
12 ;; GNU Emacs is free software; you can redistribute it and/or modify 12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by 13 ;; it under the terms of the GNU General Public License as published by
2291 "failed")) 2291 "failed"))
2292 (cd (file-name-directory changelog)) 2292 (cd (file-name-directory changelog))
2293 (delete-file tempfile))))) 2293 (delete-file tempfile)))))
2294 2294
2295 ;; vc-annotate functionality (CVS only). 2295 ;; vc-annotate functionality (CVS only).
2296 (defvar vc-annotate-mode nil
2297 "Variable indicating if VC-Annotate mode is active.")
2298
2299 (defvar vc-annotate-mode-map nil 2296 (defvar vc-annotate-mode-map nil
2300 "Local keymap used for VC-Annotate mode.") 2297 "Local keymap used for VC-Annotate mode.")
2301 2298
2302 (defvar vc-annotate-mode-menu nil 2299 (defvar vc-annotate-mode-menu nil
2303 "Local keymap used for VC-Annotate mode's menu bar menu.") 2300 "Local keymap used for VC-Annotate mode's menu bar menu.")
2442 '(("Jan" . 1) ("Feb" . 2) ("Mar" . 3) ("Apr" . 4) 2439 '(("Jan" . 1) ("Feb" . 2) ("Mar" . 3) ("Apr" . 4)
2443 ("May" . 5) ("Jun" . 6) ("Jul" . 7) ("Aug" . 8) 2440 ("May" . 5) ("Jun" . 6) ("Jul" . 7) ("Aug" . 8)
2444 ("Sep" . 9) ("Oct" . 10) ("Nov" . 11) ("Dec" . 12)))) 2441 ("Sep" . 9) ("Oct" . 10) ("Nov" . 11) ("Dec" . 12))))
2445 (set-buffer buffer) 2442 (set-buffer buffer)
2446 (display-buffer buffer) 2443 (display-buffer buffer)
2447 (if (not vc-annotate-mode) ; Turn on vc-annotate-mode if not done 2444 (or (eq major-mode 'vc-annotate-mode) ; Turn on vc-annotate-mode if not done
2448 (vc-annotate-mode)) 2445 (vc-annotate-mode))
2446 ;; Delete old overlays
2447 (mapcar
2448 (lambda (overlay)
2449 (if (overlay-get overlay 'vc-annotation)
2450 (delete-overlay overlay)))
2451 (overlays-in (point-min) (point-max)))
2449 (goto-char (point-min)) ; Position at the top of the buffer. 2452 (goto-char (point-min)) ; Position at the top of the buffer.
2450 (while (re-search-forward 2453 (while (re-search-forward
2451 "^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): " 2454 "^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): "
2452 ;; "^[0-9]+\\(\.[0-9]+\\)*\\s-+(\\sw+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): " 2455 ;; "^[0-9]+\\(\.[0-9]+\\)*\\s-+(\\sw+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): "
2453 nil t) 2456 nil t)
2471 ((let ((tmp-face (make-face (intern face-name)))) 2474 ((let ((tmp-face (make-face (intern face-name))))
2472 (set-face-foreground tmp-face (cdr color)) 2475 (set-face-foreground tmp-face (cdr color))
2473 (if vc-annotate-background 2476 (if vc-annotate-background
2474 (set-face-background tmp-face vc-annotate-background)) 2477 (set-face-background tmp-face vc-annotate-background))
2475 tmp-face)))) ; Return the face 2478 tmp-face)))) ; Return the face
2476 (point (point))) 2479 (point (point))
2480 overlay)
2477 2481
2478 (forward-line 1) 2482 (forward-line 1)
2479 (overlay-put (make-overlay point (point) nil) 'face face))))) 2483 (setq overlay (make-overlay point (point)))
2484 (overlay-put overlay 'face face)
2485 (overlay-put overlay 'vc-annotation t)))))
2480 2486
2481 2487
2482 ;; Collect back-end-dependent stuff here 2488 ;; Collect back-end-dependent stuff here
2483 2489
2484 (defun vc-backend-admin (file &optional rev comment) 2490 (defun vc-backend-admin (file &optional rev comment)