emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/vc-cvs.el


From: Andre Spiegel
Subject: [Emacs-diffs] Changes to emacs/lisp/vc-cvs.el
Date: Wed, 14 Nov 2001 08:51:53 -0500

Index: emacs/lisp/vc-cvs.el
diff -u emacs/lisp/vc-cvs.el:1.25 emacs/lisp/vc-cvs.el:1.26
--- emacs/lisp/vc-cvs.el:1.25   Sun Oct 21 08:21:29 2001
+++ emacs/lisp/vc-cvs.el        Mon Oct 22 03:57:00 2001
@@ -5,7 +5,7 @@
 ;; Author:      FSF (see vc.el for full credits)
 ;; Maintainer:  Andre Spiegel <address@hidden>
 
-;; $Id: vc-cvs.el,v 1.25 2001/10/21 12:21:29 spiegel Exp $
+;; $Id: vc-cvs.el,v 1.26 2001/10/22 07:57:00 spiegel Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -553,14 +553,22 @@
   (vc-do-command buffer 0 "cvs" file "annotate" (if version
                                                     (concat "-r" version))))
 
-(defun vc-cvs-annotate-difference (point)
-  "Return the difference between the time of the line and the current time.
-Return values are as defined for `current-time'."
-  ;; We need a list of months and their corresponding numbers.
-  (if (looking-at 
"^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): ")
+(defun vc-cvs-annotate-current-time ()
+  "Return the current time, based at midnight of the current day, and
+encoded as fractional days."
+  (vc-annotate-convert-time
+   (apply 'encode-time 0 0 0 (nthcdr 3 (decode-time (current-time))))))
+
+(defun vc-cvs-annotate-time ()
+  "Return the time of the next annotation (as fraction of days)
+systime , or NIL if there is none."
+  (let ((time-stamp 
+        "^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): "))
+    (if (looking-at time-stamp)
       (progn
        (let* ((day (string-to-number (match-string 1)))
-              (month (cdr (assoc (match-string 2) vc-cvs-local-month-numbers)))
+                (month (cdr (assoc (match-string 2) 
+                                   vc-cvs-local-month-numbers)))
               (year-tmp (string-to-number (match-string 3)))
               ;; Years 0..68 are 2000..2068.
               ;; Years 69..99 are 1969..1999.
@@ -569,17 +577,14 @@
                              (t 0))
                        year-tmp)))
          (goto-char (match-end 0)) ; Position at end makes for nicer overlay 
result
-         (- (car (current-time))
-            (car (encode-time 0 0 0 day month year)))))
+           (vc-annotate-convert-time (encode-time 0 0 0 day month year))))
     ;; If we did not look directly at an annotation, there might be
     ;; some further down.  This is the case if we are positioned at
     ;; the very top of the buffer, for instance.
-    (if (re-search-forward
-        "^\\S-+\\s-+\\S-+\\s-+\\([0-9]+\\)-\\(\\sw+\\)-\\([0-9]+\\)): " nil t)
+      (if (re-search-forward time-stamp nil t)
        (progn
          (beginning-of-line nil)
-         (vc-cvs-annotate-difference (point))))))
-
+           (vc-cvs-annotate-time))))))
 
 ;;;
 ;;; Snapshot system



reply via email to

[Prev in Thread] Current Thread [Next in Thread]