aboutsummaryrefslogtreecommitdiffstats
path: root/oni-org
diff options
context:
space:
mode:
authorGravatar Tom Willemse2026-01-08 12:19:55 -0800
committerGravatar Tom Willemse2026-01-08 12:19:55 -0800
commit8e88ad44c2f3b7efca4ef25e1cb889a8834a8569 (patch)
treede499d64617905730656e27a646eaa6fd0d42fde /oni-org
parent2376f20be34c5c94919ab73ced02b9b89c91f160 (diff)
downloademacs-config-8e88ad44c2f3b7efca4ef25e1cb889a8834a8569.tar.gz
emacs-config-8e88ad44c2f3b7efca4ef25e1cb889a8834a8569.zip
oni-org: Add function to change TODO state back after clocking out
Diffstat (limited to 'oni-org')
-rw-r--r--oni-org/oni-org.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el
index f505814..d2df96b 100644
--- a/oni-org/oni-org.el
+++ b/oni-org/oni-org.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2025.0306.003512
+;; Version: 2026.0105.140349
;; Package-Requires: (oni-yasnippet oni-hydra org org-edna diminish olivetti org-pretty-table)
;; This program is free software; you can redistribute it and/or modify
@@ -158,13 +158,20 @@ located at the start of the line."
(add-to-list 'yas-snippet-dirs oni-org-snippets-dir t))
(yas-load-directory oni-org-snippets-dir))
-(defun oni-org-maybe-change-todo-state (current-state)
+(defun oni-org-maybe-change-to-wip-state (current-state)
"Change the state of the current task to in-progress CURRENT-STATE is todo."
(if (and (not org-capture-mode)
(member current-state org-todo-heads))
(cadr (member current-state org-todo-keywords-1))
current-state))
+(defun oni-org-maybe-change-to-todo-state (current-state)
+ "Change the state of the current task to in-progress CURRENT-STATE is wip."
+ (if (and (not org-capture-mode)
+ (equal current-state (cadr org-todo-keywords-1)))
+ (car org-todo-keywords-1)
+ current-state))
+
;;;###autoload
(defun oni-org-open-index ()
"Open the index of my org-based personal wiki."
@@ -278,7 +285,8 @@ _di_: Add inlineimages STARTUP
;; ever used because there are code blocks in there.
(setq org-archive-location (format-time-string "%%s_archive_%Y::"))
(setq org-fold-catch-invisible-edits 'error)
-(setq org-clock-in-switch-to-state #'oni-org-maybe-change-todo-state)
+(setq org-clock-in-switch-to-state #'oni-org-maybe-change-to-wip-state)
+(setq org-clock-out-switch-to-state #'oni-org-maybe-change-to-todo-state)
(setq org-extend-today-until 2)
(setq org-fontify-whole-heading-line t)
(setq org-fontify-quote-and-verse-blocks t)