1
0
Fork 0

Switch to IN-PROGRESS when clocking in

When a task is TODO and I clock in, automatically switch it to
IN-PROGRESS. Leave it as is if it's any other state.
This commit is contained in:
Tom Willemse 2019-08-15 16:36:27 -07:00
parent 53d104a44b
commit 52797d3917

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 20190721235442
;; Version: 20190815163343
;; Package-Requires: (org-plus-contrib org-bullets hydra org-wild-notifier)
;; This program is free software; you can redistribute it and/or modify
@ -29,6 +29,7 @@
(require 'hydra)
(require 'org)
(require 'org-capture)
(require 'org-clock)
(require 'org-habit)
(defun oni-org-expand-to-home (file-name)
@ -98,6 +99,12 @@ After running it once remove it from `org-capture-after-finalize-hook'."
(setf (frame-height) 24)
(add-hook 'org-capture-after-finalize-hook 'oni-org-delete-frame-once)))
(defun oni-org-maybe-change-todo-state (current-state)
"Change the state of the current task to in-progress CURRENT-STATE is todo."
(if (string= current-state "TODO")
"IN-PROGRESS"
current-state))
;;;###autoload
(defun oni-org-open-index ()
"Open the index of my org-based personal wiki."
@ -123,6 +130,7 @@ After running it once remove it from `org-capture-after-finalize-hook'."
(setq org-log-into-drawer t)
(setq org-agenda-todo-ignore-scheduled 'future)
(setq org-agenda-skip-function-global #'oni-org-skip-tasks)
(setq org-clock-in-switch-to-state #'oni-org-maybe-change-todo-state)
(setq org-agenda-custom-commands
'(("c" "Today's (Current) tasks" tags "SCHEDULED=\"<today>\"")))