mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-02-06 20:49:33 +00:00
(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.
This commit is contained in:
parent
65399e8313
commit
4105dd524e
@ -1,3 +1,8 @@
|
||||
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,b_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
|
||||
|
||||
* net/ange-ftp.el: Do not hook into file-name-handler-alist, this
|
||||
|
@ -338,9 +338,11 @@ discover the name of the project."
|
||||
(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
|
||||
@ -349,7 +351,7 @@ discover the name of the project."
|
||||
(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))))))
|
||||
|
Loading…
x
Reference in New Issue
Block a user