pomm: fix byte-compile for Emacs 29

This commit is contained in:
Pavel Korytov 2024-07-10 00:52:33 +03:00
parent 4fc8cfc8a7
commit 1b06edc33a
2 changed files with 23 additions and 18 deletions

View file

@ -90,21 +90,21 @@ of period. The format is as follows:
"The current state of the Third Time timer. "The current state of the Third Time timer.
This is an alist with the following keys: This is an alist with the following keys:
- status: either 'stopped or 'running - status: either \\='stopped or \\='running
(having a pause state seems to make little sense here) (having a pause state seems to make little sense here)
- current: an alist with a current period - current: an alist with a current period
- history: a list with history for today - history: a list with history for today
- last-changed-time: a timestamp of the last change in status - last-changed-time: a timestamp of the last change in status
- context: a string that describes the current task - context: a string that describes the current task
'current is an alist with the following keys: \\='current is an alist with the following keys:
- kind: either 'work or 'break - kind: either \\='work or \\='break
- start-time: start timestamp - start-time: start timestamp
- break-time-bank: break time, postpone from previous periods - break-time-bank: break time, postpone from previous periods
- iteration: number of the current iteration - iteration: number of the current iteration
'history is a list of alists with the following keys: \\='history is a list of alists with the following keys:
- kind: same as in 'current - kind: same as in \\='current
- iteration - iteration
- start-time: start timestamp - start-time: start timestamp
- end-time: end timestamp - end-time: end timestamp
@ -678,16 +678,16 @@ The idea of the technique is as follows:
The timer can have two states: The timer can have two states:
- Stopped. - Stopped.
Can be started with 's' or `pomm-third-time-start'. Can be started with \\='s' or `pomm-third-time-start'.
- Running. - Running.
Can be stopped with 'S' or `pomm-third-time-stop'. Can be stopped with \\='S' or `pomm-third-time-stop'.
If the timer is running, the current period type (work or break) can If the timer is running, the current period type (work or break) can
be switched by 'b' or `pomm-third-time-switch'. If the break time be switched by \\='b' or `pomm-third-time-switch'. If the break time
runs out, the timer automatically switches to work. runs out, the timer automatically switches to work.
The timer supports setting \"context\", for example, a task on which The timer supports setting \"context\", for example, a task on which
you're working on. It can be set with '-c' or you\\='re working on. It can be set with \\='-c' or
`pomm-third-time-set-context'. This is useful together with CSV `pomm-third-time-set-context'. This is useful together with CSV
logging, which is enabled if `pomm-third-time-csv-history-file' is logging, which is enabled if `pomm-third-time-csv-history-file' is
non-nil. non-nil.

23
pomm.el
View file

@ -45,6 +45,11 @@
(require 'eieio) (require 'eieio)
(require 'transient) (require 'transient)
;; XXX optional dependency on org-clock
(declare-function "org-clock-in-last" "org-clock")
(declare-function "org-clock-out" "org-clock")
(defvar org-clock-current-task)
(defgroup pomm nil (defgroup pomm nil
"Pomodoro and Third Time timers." "Pomodoro and Third Time timers."
:group 'tools) :group 'tools)
@ -220,14 +225,14 @@ If nil, the clock in happens after the first command."
"The current state of the Pomodoro timer. "The current state of the Pomodoro timer.
This is an alist with the following keys: This is an alist with the following keys:
- status: either 'stopped, 'paused or 'running - status: either \\='stopped, \\='paused or \\='running
- current: an alist with a current period - current: an alist with a current period
- history: a list with history for today - history: a list with history for today
- last-changed-time: a timestamp of the last change in status - last-changed-time: a timestamp of the last change in status
- context: a string that describes the current task - context: a string that describes the current task
'current is also an alist with the following keys: \\='current is also an alist with the following keys:
- kind: either 'short-break, 'long-break or 'work - kind: either \\='short-break, \\='long-break or \\='work
- start-time: start timestamp - start-time: start timestamp
- effective-start-time: start timestamp, corrected for pauses - effective-start-time: start timestamp, corrected for pauses
- iteration: number of the current Pomodoro iteration - iteration: number of the current Pomodoro iteration
@ -484,7 +489,7 @@ The condition is: (effective-start-time + length) < now."
The formula is: The formula is:
\(effective-start-time + length\) - now + paused-time, \(effective-start-time + length\) - now + paused-time,
where paused-time is 0 if status is not 'paused, otherwise: where paused-time is 0 if status is not \\='paused, otherwise:
paused-time := now - last-changed-time" paused-time := now - last-changed-time"
(+ (+
(+ (or (alist-get 'effective-start-time (alist-get 'current pomm--state)) 0) (+ (or (alist-get 'effective-start-time (alist-get 'current pomm--state)) 0)
@ -866,17 +871,17 @@ This command initializes the timer and triggers the transient buffer.
The timer can have 3 states: The timer can have 3 states:
- Stopped. - Stopped.
Can be started with 's' or `pomm-start'. A new iteration of the Can be started with \\='s' or `pomm-start'. A new iteration of the
timer will be started. timer will be started.
- Paused. - Paused.
Can be continuted with 's' / `pomm-start' or stopped competely with Can be continuted with \\='s' / `pomm-start' or stopped competely with
'S' / `pomm-stop'. \\='S' / `pomm-stop'.
- Running. - Running.
Can be paused with 'p' / `pomm-pause' or stopped with 'S' / Can be paused with \\='p' / `pomm-pause' or stopped with \\='S' /
`pomm-stop'. `pomm-stop'.
The timer supports setting \"context\", for example, a task on which The timer supports setting \"context\", for example, a task on which
you're working on. It can be set with '-c' or `pomm-set-context'. you're working on. It can be set with \\='-c' or `pomm-set-context'.
This is useful together with CSV logging, which is enabled if This is useful together with CSV logging, which is enabled if
`pomm-csv-history-file' is non-nil. `pomm-csv-history-file' is non-nil.