Corrected kill hook behaviour

master
Brady McDonough 3 years ago
parent af54b79b2f
commit 4449a1cc9e

@ -270,16 +270,6 @@ registered" sym-name)
(graph-start . ,(copy-marker 0))
(graph-end . ,(copy-marker 0)))))
;; ERROR: It seems like this style of ticker doesn't work and I don't have time to look into it
;; more deeply. As far as I can tell I've copied the reference examples pretty closely.
;; In the meantime a "dumber" solution that works is being used
;; (defun cycle-ticker ()
;; "A closure with an internal count, only increments when fed 'break timer state"
;; (let ((ticker 0))
;; (lambda (&optional state)
;; (cond ((eq state 'break) (setq ticker (1+ ticker)))
;; ( 't ticker)))))
(defun tacc-info-initial ()
"Returns the initial state of tacc-info"
`((history . ())
@ -415,7 +405,8 @@ Note, if there is no tacc-buffer then you shouldn't be touching tacc-info"
"Ask for confirmation if a timer is still running"
(if (tacc-running?)
(yes-or-no-p "Are you sure you want to kill the timer buffer? This will\
end the current timer session as well.")))
end the current timer session as well.")
t))
(defun tacc-buffer-cleanup ()
"Save and cleanup the timer state if a timer is still live"
@ -480,6 +471,7 @@ Note, if there is no tacc-buffer then you shouldn't be touching tacc-info"
tacc-display-buffer-window-settings))))
(with-current-buffer buffer
(tacc-timer-mode)
(make-local-variable 'kill-buffer-query-functions)
(add-hook 'kill-buffer-query-functions 'tacc-kill-buffer-confirm)
(let ((width (window-total-width window 'floor))
(inhibit-read-only t))
@ -623,8 +615,8 @@ Returns the current tag if no prompt is made"
"Sets a tag for live timer sessions going forward"
(interactive)
(if (tacc-running?)
(setcdr (assoc 'tag tacc-info) (tacc-tag-prompt)))
(message "There isn't a live timer session to tag"))
(setcdr (assoc 'tag tacc-info) (tacc-tag-prompt))
(message "There isn't a live timer session to tag")))
(defun tacc-cycle-increment (state)
"Increments the cycle counter if the current state is a 'break"

Loading…
Cancel
Save