|
|
|
@ -203,7 +203,7 @@ To use, add this to `chronometrist-after-out-functions', and
|
|
|
|
|
|
|
|
|
|
(defun chronometrist-goal-on-file-change ()
|
|
|
|
|
"Manage timed alerts when `chronometrist-file' changes."
|
|
|
|
|
(let ((last (chronometrist-last)))
|
|
|
|
|
(let ((last (chronometrist-latest-record (chronometrist-active-backend))))
|
|
|
|
|
(chronometrist-goal-stop-alert-timers)
|
|
|
|
|
;; if there's a task running, start timed alerts for it
|
|
|
|
|
(unless (plist-get last :stop)
|
|
|
|
@ -211,18 +211,21 @@ To use, add this to `chronometrist-after-out-functions', and
|
|
|
|
|
|
|
|
|
|
;;;; minor mode
|
|
|
|
|
(defun chronometrist-goal-row-transformer (row)
|
|
|
|
|
"Add goal information to the return value of `chronometrist-rows'.
|
|
|
|
|
ROW must be a valid element in the list specified by
|
|
|
|
|
`tabulated-list-entries'."
|
|
|
|
|
"Add a goal cell to ROW.
|
|
|
|
|
Used to add a goal column to `chronometrist-rows'.
|
|
|
|
|
|
|
|
|
|
ROW must be a valid element of the list specified by
|
|
|
|
|
`tabulated-list-entries'."
|
|
|
|
|
(-let* (((task vector) row)
|
|
|
|
|
(goal-minutes (chronometrist-goal-get task))
|
|
|
|
|
(goal-string (if goal-minutes (format "% 4d" goal-minutes) "")))
|
|
|
|
|
(list task (vconcat vector `[,goal-string]))))
|
|
|
|
|
|
|
|
|
|
(defun chronometrist-goal-schema-transformer (schema)
|
|
|
|
|
"Add a goal column to the return value of `tabulated-list-format'.
|
|
|
|
|
SCHEMA should be a vector (see `tabulated-list-format')."
|
|
|
|
|
(vconcat schema `[("Target" 3 t)]))
|
|
|
|
|
"Add a goal column to SCHEMA.
|
|
|
|
|
Used to add a goal column to `chronometrist-schema-transformers'.
|
|
|
|
|
SCHEMA should be a vector as specified by `tabulated-list-format'."
|
|
|
|
|
|
|
|
|
|
(defun chronometrist-goal-setup ()
|
|
|
|
|
"Add `chronometrist-goal' functions to `chronometrist' hooks."
|
|
|
|
|