Clock in when DOING a project
This commit is contained in:
parent
66c30a2252
commit
5ad5e44adf
1 changed files with 15 additions and 2 deletions
17
ha-org.org
17
ha-org.org
|
@ -32,6 +32,7 @@ Org is a /large/ complex beast with a gazillion settings, so I discuss these lat
|
||||||
:init
|
:init
|
||||||
<<variables>>
|
<<variables>>
|
||||||
<<org-todo>>
|
<<org-todo>>
|
||||||
|
<<org-todo-clock>>
|
||||||
<<ob-configuration>>
|
<<ob-configuration>>
|
||||||
|
|
||||||
:config
|
:config
|
||||||
|
@ -184,14 +185,26 @@ The org API allows getting the context associated with the /current element/. Th
|
||||||
context))
|
context))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Tasks
|
** Tasks
|
||||||
I need to add a /blocked/ state:
|
I need to add a /blocked/ state, and wouldn’t /doing/ be better than /in progress/ (you know, without a space):
|
||||||
|
|
||||||
#+name: org-todo
|
#+name: org-todo
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(setq org-todo-keywords '((sequence "TODO(t)" "DOING(g)" "|" "DONE(d)")
|
(setq org-todo-keywords '((sequence "TODO(t)" "DOING(g)" "|" "DONE(d)")
|
||||||
(sequence "BLOCKED(b)" "|" "CANCELLED(c)")))
|
(sequence "BLOCKED(b)" "|" "CANCELLED(c)")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
[[https://janusworx.com/blog/what-i-learned-today-2023-02-10/][Mario Braganza]] had an interesting idea of starting the clock when a task changes to /in progress/:
|
||||||
|
#+name: org-todo-clock
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun ha-org-clock-todo-change ()
|
||||||
|
"Called from hook `org-after-todo-state-change-hook'.
|
||||||
|
Clock in if a task changes to DOING (i.e. IN_PROGRESS),
|
||||||
|
and clocks out with any other state change."
|
||||||
|
(if (string= org-state "DOING")
|
||||||
|
(org-clock-in)
|
||||||
|
(org-clock-out-if-current)))
|
||||||
|
|
||||||
|
(add-hook 'org-after-todo-state-change-hook 'ha-org-clock-todo-change)
|
||||||
|
#+end_src
|
||||||
And I would like to have cute little icons for those states:
|
And I would like to have cute little icons for those states:
|
||||||
|
|
||||||
#+name: org-font-lock
|
#+name: org-font-lock
|
||||||
|
|
Loading…
Reference in a new issue