COMMIT
Hello Jeff, All, I am committing this now, but your review would be
much appreciated.
Best regards!
Adrian
packages ChangeLog patch:
Diff command: cvs -q diff -U 0
Files affected: xemacs-packages/calendar/ChangeLog
Index: xemacs-packages/calendar/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/ChangeLog,v
retrieving revision 1.52
diff -u -U0 -r1.52 ChangeLog
--- xemacs-packages/calendar/ChangeLog 11 Jul 2007 06:49:31 -0000 1.52
+++ xemacs-packages/calendar/ChangeLog 20 Sep 2007 22:28:29 -0000
@@ -0,0 +1,10 @@
+2007-09-21 Adrian Aichner <adrian(a)xemacs.org>
+
+ * timeclock.el (timeclock-read-moment): Report current
+ `line-number' in case of error.
+ * timeclock.el (timeclock-log-data): Remove tracking of line
+ number (which currently fails to track time balance entries)
+ instead of making the tracking ever more complicated. Simply
+ obtain current `line-number' in case of error.
+ * timeclock.el (timeclock-find-discrep): Ditto.
+
packages source patch:
Diff command: cvs -f -z3 -q diff -u -w -N
Files affected: xemacs-packages/calendar/timeclock.el
===================================================================
RCS xemacs-packages/calendar/ChangeLog
===================================================================
RCS
Index: xemacs-packages/calendar/timeclock.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/timeclock.el,v
retrieving revision 1.6
diff -u -w -r1.6 timeclock.el
--- xemacs-packages/calendar/timeclock.el 16 Apr 2007 02:12:28 -0000 1.6
+++ xemacs-packages/calendar/timeclock.el 20 Sep 2007 22:29:16 -0000
@@ -740,8 +740,10 @@
(project (match-string 8)))
(list code (encode-time sec min hour mday mon year) project)))
((not (eobp))
- (error "unexpected data in %s: %s"
+ (error "unexpected data in %s, line %d: %s"
timeclock-file
+ ;; XEmacs change
+ (line-number)
(buffer-substring
(point-at-bol)
(point-at-eol))))))
@@ -1026,7 +1028,7 @@
(now (current-time))
(todays-date (timeclock-time-to-date now))
last-date-limited last-date-seconds last-date
- (line 0) last beg day entry event)
+ last beg day entry event)
(with-temp-buffer
(insert-buffer
(timeclock-get-timeclock-file-buffer (or filename timeclock-file)))
@@ -1037,7 +1039,6 @@
(while (or (setq event (timeclock-read-moment))
(and beg (not last)
(setq last t event (list "o" now))))
- (setq line (1+ line))
(cond ((equal (car event) "b")
(setcar log-data (string-to-number (nth 2 event))))
((equal (car event) "h")
@@ -1046,7 +1047,8 @@
3600.0)))
((equal (car event) "i")
(if beg
- (error "Error in format of timelog file, line %d" line)
+ (error "Error in format of timelog file, line %d"
+ (line-number))
(setq beg t))
(setq entry (list (cadr event) nil
(and (> (length (nth 2 event)) 0)
@@ -1067,7 +1069,8 @@
last-date-limited nil)))
((equal (downcase (car event)) "o")
(if (not beg)
- (error "Error in format of timelog file, line %d" line)
+ (error "Error in format of timelog file, line %d"
+ (line-number))
(setq beg nil))
(setcar (cdr entry) (cadr event))
(let ((desc (and (> (length (nth 2 event)) 0)
@@ -1112,8 +1115,7 @@
;; total)
(let* ((now (current-time))
(todays-date (timeclock-time-to-date now))
- ;; XEmacs change
- (first t) (accum 0) (elapsed 0) (line 0)
+ (first t) (accum 0) (elapsed 0)
event beg last-date avg
last-date-limited last-date-seconds)
(unless timeclock-discrepancy
@@ -1129,8 +1131,6 @@
(unless (re-search-backward "^b\\s-+" nil t)
(goto-char (point-min)))
(while (setq event (timeclock-read-moment))
- ;; XEmacs change
- (setq line (1+ line))
(cond ((equal (car event) "b")
(setq accum (string-to-number (nth 2 event))))
((equal (car event) "h")
@@ -1155,7 +1155,8 @@
last-date-limited nil)
(if beg
;; XEmacs change
- (error "Error in format of timelog file, line %d" line)
+ (error "Error in format of timelog file, line %d"
+ (line-number))
(setq beg (timeclock-time-to-seconds (cadr event))))))
((equal (downcase (car event)) "o")
(if (and (nth 2 event)
@@ -1163,7 +1164,8 @@
(add-to-list 'timeclock-reason-list (nth 2 event)))
(if (not beg)
;; XEmacs change
- (error "Error in format of timelog file, line %d" line)
+ (error "Error in format of timelog file, line %d"
+ (line-umber))
(setq timeclock-last-period
(- (timeclock-time-to-seconds (cadr event)) beg)
accum (+ timeclock-last-period accum)
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches