Allow function as value for break time variable
This commit is contained in:
parent
a8f213bbd2
commit
267f17e57d
|
@ -37,10 +37,27 @@
|
|||
|
||||
;; [[file:chronometrist-third.org::*working-hours][working-hours:1]]
|
||||
(defcustom chronometrist-third-working-hours nil
|
||||
"Pair of ISO-8601 timestamps specifying user's working hours.
|
||||
"User's working hours for today.
|
||||
This can be nil, a pair of ISO-8601 timestamps, or a function
|
||||
which takes no arguments and returns a pair of ISO-8601
|
||||
timestamps.
|
||||
|
||||
Setting this currently has no effect."
|
||||
:type '(choice (const :tag "No defined working hours" nil)
|
||||
(cons :tag "Time range" string string)))
|
||||
(cons :tag "Time range" string string)
|
||||
function)
|
||||
:group 'chronometrist-third)
|
||||
;; working-hours:1 ends here
|
||||
|
||||
;; [[file:chronometrist-third.org::*working-hours][working-hours:1]]
|
||||
(defun chronometrist-third-working-hours (default-hours)
|
||||
"Return the user's working hours based on DEFAULT-HOURS.
|
||||
For the possible values of DEFAULT-HOURS, see the variable
|
||||
`chronometrist-third-working-hours' ."
|
||||
(cl-typecase default-hours
|
||||
(cons default-hours)
|
||||
(function (funcall default-hours))
|
||||
(nil nil)))
|
||||
;; working-hours:1 ends here
|
||||
|
||||
;; [[file:chronometrist-third.org::*divisor][divisor:1]]
|
||||
|
|
|
@ -50,10 +50,28 @@
|
|||
** TODO working-hours :custom:variable:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defcustom chronometrist-third-working-hours nil
|
||||
"Pair of ISO-8601 timestamps specifying user's working hours.
|
||||
"User's working hours for today.
|
||||
This can be nil, a pair of ISO-8601 timestamps, or a function
|
||||
which takes no arguments and returns a pair of ISO-8601
|
||||
timestamps.
|
||||
|
||||
Setting this currently has no effect."
|
||||
:type '(choice (const :tag "No defined working hours" nil)
|
||||
(cons :tag "Time range" string string)))
|
||||
(cons :tag "Time range" string string)
|
||||
function)
|
||||
:group 'chronometrist-third)
|
||||
#+END_SRC
|
||||
|
||||
** working-hours :procedure:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun chronometrist-third-working-hours (default-hours)
|
||||
"Return the user's working hours based on DEFAULT-HOURS.
|
||||
For the possible values of DEFAULT-HOURS, see the variable
|
||||
`chronometrist-third-working-hours' ."
|
||||
(cl-typecase default-hours
|
||||
(cons default-hours)
|
||||
(function (funcall default-hours))
|
||||
(nil nil)))
|
||||
#+END_SRC
|
||||
|
||||
** divisor :custom:variable:
|
||||
|
|
Reference in New Issue