|
|
|
|
@ -328,15 +328,14 @@ registered" sym-name)
|
|
|
|
|
nil))
|
|
|
|
|
|
|
|
|
|
(defun tacc-invariant ()
|
|
|
|
|
"Returns t if tacc is in a legal state for mutating tacc-info, signal an error otherwise
|
|
|
|
|
Note, if there is no tacc-buffer then you shouldn't be touching tacc-info"
|
|
|
|
|
"Returns t when state indicates tacc-info can be mutated. Signals error if not"
|
|
|
|
|
(if (bufferp (tacc-buffer))
|
|
|
|
|
(if (tacc-live?)
|
|
|
|
|
(if (tacc-live-state?)
|
|
|
|
|
t
|
|
|
|
|
;; Timer running without reason in logic
|
|
|
|
|
(signal 'tacc-error-illegal-buffer-state tacc-timer))
|
|
|
|
|
(if (tacc-session-state?)
|
|
|
|
|
(if (tacc-session-state? (alist-get 'state tacc-info))
|
|
|
|
|
t
|
|
|
|
|
;; Buffer is live without reason in logic
|
|
|
|
|
(signal 'tacc-error-illegal-buffer-state (tacc-buffer))))
|
|
|
|
|
@ -390,7 +389,7 @@ Note, if there is no tacc-buffer then you shouldn't be touching tacc-info"
|
|
|
|
|
"Redraws the timer buffer and returns the calculated countdown seconds"
|
|
|
|
|
(let* ((cycle (alist-get 'cycle tacc-info))
|
|
|
|
|
(work-ts (alist-get 'work-ts tacc-info))
|
|
|
|
|
(break-ts (alist-gete 'break-ts tacc-info))
|
|
|
|
|
(break-ts (alist-get 'break-ts tacc-info))
|
|
|
|
|
(est (tacc-est-ts state cycle work-ts break-ts))
|
|
|
|
|
(countdown (time-subtract est now)))
|
|
|
|
|
(tacc-timer-buffer-update state est countdown now)
|
|
|
|
|
|