+2002-07-13 Glenn Morris <gmorris@ast.cam.ac.uk>
+
+ * calendar/timeclock.el (timeclock-in): Handle the case where no
+ log file exists (ie the very first call).
+
2002-07-13 Kai Gro\e,b_\e(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
* net/ange-ftp.el: Do not hook into file-name-handler-alist, this
(error "You've already clocked in!")
(unless timeclock-last-event
(timeclock-reread-log))
- (unless (equal (timeclock-time-to-date
- (cadr timeclock-last-event))
- (timeclock-time-to-date (current-time)))
+ ;; Either no log file, or day has rolled over.
+ (unless (and timeclock-last-event
+ (equal (timeclock-time-to-date
+ (cadr timeclock-last-event))
+ (timeclock-time-to-date (current-time))))
(let ((workday (or (and (numberp arg) arg)
(and arg 0)
(and timeclock-get-workday-function
(run-hooks 'timeclock-first-in-hook)
;; settle the discrepancy for the new day
(setq timeclock-discrepancy
- (- timeclock-discrepancy workday))
+ (- (or timeclock-discrepancy 0) workday))
(if (not (= workday timeclock-workday))
(timeclock-log "h" (and (numberp arg)
(number-to-string arg))))))