[Org] Moving around helper functions
in the hope to increase readability of the overall configuration …
This commit is contained in:
parent
a8d79c52f5
commit
3135619bb6
80
init.el
80
init.el
|
@ -686,42 +686,7 @@ _h_ _l_ _o_k _y_ank
|
|||
:group 'personal-settings
|
||||
:type 'string)
|
||||
|
||||
(use-package org-clock
|
||||
:init (setq org-clock-history-length 23
|
||||
org-clock-in-resume t
|
||||
org-clock-into-drawer t
|
||||
org-clock-idle-time nil
|
||||
org-clock-out-remove-zero-time-clocks t
|
||||
org-clock-out-when-done '("DONE" "CANC" "WAIT" "HOLD")
|
||||
org-clock-auto-clock-resolution 'when-no-clock-is-running
|
||||
org-clock-mode-line-total 'auto
|
||||
org-clock-report-include-clocking-task t
|
||||
org-clock-in-switch-to-state (lambda (_)
|
||||
(when (not
|
||||
(and (boundp 'org-capture-mode)
|
||||
org-capture-mode))
|
||||
(cond
|
||||
((member (org-get-todo-state)
|
||||
(list "TODO" "READ"))
|
||||
"CONT")
|
||||
((member (org-get-todo-state)
|
||||
(list "GOTO"))
|
||||
"ATTN"))))
|
||||
org-clock-persist t
|
||||
org-clock-persist-query-resume nil
|
||||
org-duration-format 'h:mm
|
||||
org-time-stamp-rounding-minutes '(1 1))
|
||||
:config (progn
|
||||
(org-clock-persistence-insinuate)
|
||||
|
||||
(add-hook 'org-clock-in-hook ; mark current default task
|
||||
(lambda ()
|
||||
(let ((current-id (org-id-get org-clock-marker)))
|
||||
(when (member current-id (list org-working-task-id
|
||||
org-home-task-id))
|
||||
(org-clock-mark-default-task)))))
|
||||
|
||||
;; Clock in default task if no other task is given
|
||||
;; Helper Functions for Clocking
|
||||
|
||||
(defun db/find-parent-task ()
|
||||
;; http://doc.norang.ca/org-mode.html#Clocking
|
||||
|
@ -758,10 +723,6 @@ _h_ _l_ _o_k _y_ank
|
|||
(t
|
||||
(org-clock-in '(4))))))))
|
||||
|
||||
(add-hook 'org-clock-out-hook #'db/ensure-running-clock 'append)
|
||||
|
||||
;; Communicate the currently clocked in task to the outside world
|
||||
|
||||
(defvar db/org-clock-current-task-file
|
||||
"~/.org-current-task")
|
||||
|
||||
|
@ -774,6 +735,45 @@ _h_ _l_ _o_k _y_ank
|
|||
(insert "No running clock")
|
||||
(insert org-clock-heading)))))
|
||||
|
||||
(use-package org-clock
|
||||
:init (setq org-clock-history-length 23
|
||||
org-clock-in-resume t
|
||||
org-clock-into-drawer t
|
||||
org-clock-idle-time nil
|
||||
org-clock-out-remove-zero-time-clocks t
|
||||
org-clock-out-when-done '("DONE" "CANC" "WAIT" "HOLD")
|
||||
org-clock-auto-clock-resolution 'when-no-clock-is-running
|
||||
org-clock-mode-line-total 'auto
|
||||
org-clock-report-include-clocking-task t
|
||||
org-clock-in-switch-to-state (lambda (_)
|
||||
(when (not
|
||||
(and (boundp 'org-capture-mode)
|
||||
org-capture-mode))
|
||||
(cond
|
||||
((member (org-get-todo-state)
|
||||
(list "TODO" "READ"))
|
||||
"CONT")
|
||||
((member (org-get-todo-state)
|
||||
(list "GOTO"))
|
||||
"ATTN"))))
|
||||
org-clock-persist t
|
||||
org-clock-persist-query-resume nil
|
||||
org-duration-format 'h:mm
|
||||
org-time-stamp-rounding-minutes '(1 1))
|
||||
:config (progn
|
||||
(org-clock-persistence-insinuate)
|
||||
|
||||
(add-hook 'org-clock-in-hook ; mark current default task
|
||||
(lambda ()
|
||||
(let ((current-id (org-id-get org-clock-marker)))
|
||||
(when (member current-id (list org-working-task-id
|
||||
org-home-task-id))
|
||||
(org-clock-mark-default-task)))))
|
||||
|
||||
;; Clock in default task if no other task is given
|
||||
(add-hook 'org-clock-out-hook #'db/ensure-running-clock 'append)
|
||||
|
||||
;; Communicate the currently clocked in task to the outside world
|
||||
(add-hook 'org-clock-in-hook #'db/org-current-task)))
|
||||
|
||||
(use-package ox-icalendar
|
||||
|
|
Loading…
Reference in New Issue