diff options
| author | Glenn Morris | 2002-07-13 18:56:04 +0000 |
|---|---|---|
| committer | Glenn Morris | 2002-07-13 18:56:04 +0000 |
| commit | 4105dd524e297345ea8cd9f0ccd01eb263165f03 (patch) | |
| tree | 8ef3c46bef8f05adc25f1e63db637839a8364915 | |
| parent | 65399e8313a1cb1e659259bda2244400f305050a (diff) | |
| download | emacs-4105dd524e297345ea8cd9f0ccd01eb263165f03.tar.gz emacs-4105dd524e297345ea8cd9f0ccd01eb263165f03.zip | |
(timeclock-in): Run the new day section if, after rereading the log file,
timeclock-last-event is nil, indicating no log file exists yet. Take
account of the fact that timeclock-discrepancy will be nil in that case.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/calendar/timeclock.el | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 707dc9dc122..f3e66eb7df3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2002-07-13 Glenn Morris <gmorris@ast.cam.ac.uk> | ||
| 2 | |||
| 3 | * calendar/timeclock.el (timeclock-in): Handle the case where no | ||
| 4 | log file exists (ie the very first call). | ||
| 5 | |||
| 1 | 2002-07-13 Kai Gro,b_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> | 6 | 2002-07-13 Kai Gro,b_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> |
| 2 | 7 | ||
| 3 | * net/ange-ftp.el: Do not hook into file-name-handler-alist, this | 8 | * net/ange-ftp.el: Do not hook into file-name-handler-alist, this |
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 21a931297e8..db679b8d55e 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el | |||
| @@ -338,9 +338,11 @@ discover the name of the project." | |||
| 338 | (error "You've already clocked in!") | 338 | (error "You've already clocked in!") |
| 339 | (unless timeclock-last-event | 339 | (unless timeclock-last-event |
| 340 | (timeclock-reread-log)) | 340 | (timeclock-reread-log)) |
| 341 | (unless (equal (timeclock-time-to-date | 341 | ;; Either no log file, or day has rolled over. |
| 342 | (cadr timeclock-last-event)) | 342 | (unless (and timeclock-last-event |
| 343 | (timeclock-time-to-date (current-time))) | 343 | (equal (timeclock-time-to-date |
| 344 | (cadr timeclock-last-event)) | ||
| 345 | (timeclock-time-to-date (current-time)))) | ||
| 344 | (let ((workday (or (and (numberp arg) arg) | 346 | (let ((workday (or (and (numberp arg) arg) |
| 345 | (and arg 0) | 347 | (and arg 0) |
| 346 | (and timeclock-get-workday-function | 348 | (and timeclock-get-workday-function |
| @@ -349,7 +351,7 @@ discover the name of the project." | |||
| 349 | (run-hooks 'timeclock-first-in-hook) | 351 | (run-hooks 'timeclock-first-in-hook) |
| 350 | ;; settle the discrepancy for the new day | 352 | ;; settle the discrepancy for the new day |
| 351 | (setq timeclock-discrepancy | 353 | (setq timeclock-discrepancy |
| 352 | (- timeclock-discrepancy workday)) | 354 | (- (or timeclock-discrepancy 0) workday)) |
| 353 | (if (not (= workday timeclock-workday)) | 355 | (if (not (= workday timeclock-workday)) |
| 354 | (timeclock-log "h" (and (numberp arg) | 356 | (timeclock-log "h" (and (numberp arg) |
| 355 | (number-to-string arg)))))) | 357 | (number-to-string arg)))))) |