mirror of
https://github.com/vale981/pomm.el
synced 2025-03-05 09:41:42 -05:00
add option pomm-ask-before-work
This commit is contained in:
parent
596eed778f
commit
cefbeebf96
1 changed files with 21 additions and 11 deletions
22
pomm.el
22
pomm.el
|
@ -81,6 +81,11 @@
|
||||||
:group 'pomm
|
:group 'pomm
|
||||||
:type 'boolean)
|
:type 'boolean)
|
||||||
|
|
||||||
|
(defcustom pomm-ask-before-work nil
|
||||||
|
"Ask a user whether to start a new pomodoro period."
|
||||||
|
:group 'pomm
|
||||||
|
:type 'boolean)
|
||||||
|
|
||||||
(defcustom pomm-reset-context-on-iteration-end t
|
(defcustom pomm-reset-context-on-iteration-end t
|
||||||
"Whether to reset the context when the iteration ends."
|
"Whether to reset the context when the iteration ends."
|
||||||
:group 'pomm
|
:group 'pomm
|
||||||
|
@ -424,18 +429,23 @@ The condition is: (effective-start-time + length) < now."
|
||||||
(+ current-iteration 1)
|
(+ current-iteration 1)
|
||||||
current-iteration)))
|
current-iteration)))
|
||||||
(pomm--store-current-to-history)
|
(pomm--store-current-to-history)
|
||||||
(if (or (not (eq next-kind 'long-break))
|
(if (or
|
||||||
(not pomm-ask-before-long-break)
|
(and (eq next-kind 'long-break)
|
||||||
(y-or-n-p "Start a long break (y) or end the pomodors (n)? "))
|
pomm-ask-before-long-break
|
||||||
|
(not (y-or-n-p "Start a long break (y) or end the pomodoros (n)? ")))
|
||||||
|
(and (eq next-kind 'work)
|
||||||
|
pomm-ask-before-work
|
||||||
|
(not (y-or-n-p "Start a pomodoro (y) or end the pomodoros (n)? "))))
|
||||||
|
(progn
|
||||||
|
(setf (alist-get 'current pomm--state) nil)
|
||||||
|
(setf (alist-get 'status pomm--state) 'stopped))
|
||||||
(progn
|
(progn
|
||||||
(setf (alist-get 'current pomm--state)
|
(setf (alist-get 'current pomm--state)
|
||||||
`((kind . ,next-kind)
|
`((kind . ,next-kind)
|
||||||
(start-time . ,(time-convert nil 'integer))
|
(start-time . ,(time-convert nil 'integer))
|
||||||
(effective-start-time . ,(time-convert nil 'integer))
|
(effective-start-time . ,(time-convert nil 'integer))
|
||||||
(iteration . ,next-iteration)))
|
(iteration . ,next-iteration)))
|
||||||
(pomm--dispatch-notification next-kind))
|
(pomm--dispatch-notification next-kind)))
|
||||||
(setf (alist-get 'current pomm--state) nil)
|
|
||||||
(setf (alist-get 'status pomm--state) 'stopped))
|
|
||||||
(pomm--save-state)
|
(pomm--save-state)
|
||||||
(run-hooks 'pomm-on-status-changed-hook)
|
(run-hooks 'pomm-on-status-changed-hook)
|
||||||
(when (and (eq next-kind 'long-break) pomm-reset-context-on-iteration-end)
|
(when (and (eq next-kind 'long-break) pomm-reset-context-on-iteration-end)
|
||||||
|
|
Loading…
Add table
Reference in a new issue