Compare commits

..

No commits in common. '909596986eee4ebe475587464bba671200f31088' and '4d63057d52794665ba54a03ec18c2397e0de5aad' have entirely different histories.

@ -3,7 +3,7 @@
;; Author: Brady McDonough <me@bradymcd.ca> ;; Author: Brady McDonough <me@bradymcd.ca>
;; URL: git.bradymcd.ca/brady/tacc ;; URL: git.bradymcd.ca/brady/tacc
;; Keywords: tools, time, pomidoro, accountability ;; Keywords: tools, time, pomodoro, accountability
;; Version: 0.0.1 ;; Version: 0.0.1
;; ;;
@ -89,7 +89,7 @@
(+ secs (* 60 mins))) (+ secs (* 60 mins)))
(defcustom tacc-work-seconds (m:s 30 0) (defcustom tacc-work-seconds (m:s 30 0)
"The length of a base pomidoro round" "The length of a base pomodoro round"
:type 'integer :group 'tacc) :type 'integer :group 'tacc)
(defcustom tacc-work-seconds-increment 0 (defcustom tacc-work-seconds-increment 0
@ -384,32 +384,26 @@ Note, if there is no tacc-buffer then you shouldn't be touching tacc-info"
(defun tacc-push-current () (defun tacc-push-current ()
"Push the current period into the record" "Push the current period into the record"
(let* ((stack (assoc 'history tacc-info)) (let* ((stack (assoc 'history tacc-info))
(work-place (assoc 'work-ts tacc-info)) (work-ts (assoc 'work-ts tacc-info))
(break-place (assoc 'break-ts tacc-info)) (break-ts (assoc 'break-ts tacc-info))
(end-place (assoc 'end-ts tacc-info)) (end-ts (assoc 'end-ts tacc-info))
(tag (alist-get 'tag tacc-info ""))) (tag (alist-get 'tag tacc-info)))
(let ((work-cond (if (cdr work-place) 't nil)) (if work-ts
(break-cond (if (cdr break-place) 't nil))) (push `((ts . ,work-ts)
(if work-cond (end . ,(if (cdr break-ts)
(let ((ts (time-to-seconds (cdr work-place))) (time-seconds (cdr break-ts))
(end (time-to-seconds (if break-cond (cdr end-ts)))
(cdr break-place)
(cdr end-place)))))
(push `((ts . ,ts)
(end . ,end)
(state . work) (state . work)
(tag . ,tag)) (tag . ,tag))
stack))) (cdr stack)))
(if break-cond (if break-ts
(let ((ts (time-to-seconds (cdr break-place))) (push `((ts . ,(cdr break-ts))
(end (time-to-seconds (cdr end-ts)))) (end . ,(cdr end-ts))
(push `((ts . ,ts)
(end . ,end)
(state . break) (state . break)
(tag . ,tag)) (tag . ,tag))
stack)))) (cdr stack)))
(setcdr work-place nil) (setcdr work-ts nil)
(setcdr break-place nil) (setcdr break-ts nil)
(setcdr end-ts nil))) (setcdr end-ts nil)))
(defun tacc-kill-buffer-confirm () (defun tacc-kill-buffer-confirm ()

Loading…
Cancel
Save