|
|
|
@ -53,11 +53,12 @@
|
|
|
|
;; Split buffer update into clock and graph sections
|
|
|
|
;; Split buffer update into clock and graph sections
|
|
|
|
;; - As it is, pausing the timer can't draw a full buffer and ends up
|
|
|
|
;; - As it is, pausing the timer can't draw a full buffer and ends up
|
|
|
|
;; erasing the previous time graph
|
|
|
|
;; erasing the previous time graph
|
|
|
|
|
|
|
|
;; The buffer could render in smoother, just set points don't render empty data
|
|
|
|
|
|
|
|
;; Center the clock-countdown display
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
;; ERROR: timer shutdown seems to leave things in a wrong state and buffer doesn't die properly
|
|
|
|
;; ERROR: Check on the logic of push-current, needs predicates rather than lazy if conditions
|
|
|
|
;; Check on the logic of push-current, needs predicates rather than lazy if conditions
|
|
|
|
;; history field is not populating
|
|
|
|
;; I'm not calling anything to destroy the buffer on desched
|
|
|
|
;; BUG: Break timer displays wrong time and sign
|
|
|
|
;; BUG: The buffer is immortal?
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
|
|
;; Optional
|
|
|
|
;; Optional
|
|
|
|
@ -657,6 +658,18 @@ Returns the current tag if no prompt is made"
|
|
|
|
(alist-get 'tag tacc-info)
|
|
|
|
(alist-get 'tag tacc-info)
|
|
|
|
(tacc-tag-prompt)))
|
|
|
|
(tacc-tag-prompt)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun tacc-end-session ()
|
|
|
|
|
|
|
|
"Ends the current timer session, runs serialization and kills the buffer"
|
|
|
|
|
|
|
|
(if (tacc-session?)
|
|
|
|
|
|
|
|
(progn
|
|
|
|
|
|
|
|
(if (tacc-live?)
|
|
|
|
|
|
|
|
(progn (tacc-deschedule)
|
|
|
|
|
|
|
|
(tacc-push-current)))
|
|
|
|
|
|
|
|
(tacc-save-record (assoc 'history tacc-info))
|
|
|
|
|
|
|
|
(setq tacc-info (tacc-info-initial))
|
|
|
|
|
|
|
|
(kill-buffer (tacc-buffer))
|
|
|
|
|
|
|
|
(tacc-cleanup-invariant))))
|
|
|
|
|
|
|
|
|
|
|
|
;; 08.2 Interactive
|
|
|
|
;; 08.2 Interactive
|
|
|
|
|
|
|
|
|
|
|
|
(defun tacc-start-timer ()
|
|
|
|
(defun tacc-start-timer ()
|
|
|
|
@ -741,19 +754,23 @@ Returns the current tag if no prompt is made"
|
|
|
|
(defun tacc-end-timer ()
|
|
|
|
(defun tacc-end-timer ()
|
|
|
|
"Ends the current timer session, runs serialization and kills the buffer"
|
|
|
|
"Ends the current timer session, runs serialization and kills the buffer"
|
|
|
|
(interactive)
|
|
|
|
(interactive)
|
|
|
|
(if (tacc-session?)
|
|
|
|
(tacc-end-session))
|
|
|
|
(progn
|
|
|
|
|
|
|
|
(tacc-deschedule)
|
|
|
|
;; 09 Hooks setup
|
|
|
|
(tacc-push-current)
|
|
|
|
|
|
|
|
(tacc-save-record (assoc 'history tacc-info))
|
|
|
|
(defun tacc-kill-emacs-confirm ()
|
|
|
|
(setq tacc-info (tacc-info-initial))
|
|
|
|
"Ask for confirmation if a timer is still running"
|
|
|
|
(kill-buffer (tacc-buffer))
|
|
|
|
(if (and (tacc-session?) ;; Redundant, but more re-use this way
|
|
|
|
(tacc-cleanup-invariant))))
|
|
|
|
(yes-or-no-p "You still have a work timer running, are you sure you want\
|
|
|
|
|
|
|
|
to quit emacs?"))
|
|
|
|
|
|
|
|
(tacc-end-session)
|
|
|
|
|
|
|
|
t))
|
|
|
|
|
|
|
|
|
|
|
|
;; 09 Hooks setup
|
|
|
|
|
|
|
|
(add-hook 'after-init-hook 'tacc-load-tag-history)
|
|
|
|
(add-hook 'after-init-hook 'tacc-load-tag-history)
|
|
|
|
|
|
|
|
(add-hook 'kill-emacs-query-functions 'tacc-kill-emacs-confirm)
|
|
|
|
(add-hook 'kill-emacs-hook 'tacc-save-tag-history)
|
|
|
|
(add-hook 'kill-emacs-hook 'tacc-save-tag-history)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; 10 Provides
|
|
|
|
;; 10 Provides
|
|
|
|
|
|
|
|
|
|
|
|
(provide 'tacc)
|
|
|
|
(provide 'tacc)
|
|
|
|
|