summary refs log tree commit diff
path: root/emacs/custom
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/custom')
-rw-r--r--emacs/custom/my-org.el22
1 files changed, 22 insertions, 0 deletions
diff --git a/emacs/custom/my-org.el b/emacs/custom/my-org.el
index 05990d3..759af7b 100644
--- a/emacs/custom/my-org.el
+++ b/emacs/custom/my-org.el
@@ -120,6 +120,28 @@
    (file+olp+datetree "journal.org")
    "* %?\n:PROPERTIES:\n:CREATED: %T\n:END:\n" :tree-type day)))
 
+(setq org-capture-templates-contexts
+      ;; only show the capture template for emails when in a notmuch
+      ;; buffer
+      '(("m" ((in-mode . "notmuch-search-mode")
+              (in-mode . "notmuch-show-mode")
+              (in-mode . "notmuch-tree-mode")))))
+
+;; https://stackoverflow.com/questions/20164918/how-to-untick-checkboxes-in-org-mode-for-the-next-cyclic-repetitive-task
+(defun my/org-reset-checkbox-state-maybe ()
+  "Reset all checkboxes in an entry if the `RESET_CHECK_BOXES' property is set."
+  (interactive "*")
+  (if (org-entry-get (point) "RESET_CHECK_BOXES")
+      (org-reset-checkbox-state-subtree)))
+
+(defun my/org-reset-checkbox-when-done ()
+  "Reset all checkboxes in an entry when the state is DONE."
+  (when (member org-state org-done-keywords) ;; org-state dynamically bound in org.el/org-todo
+    (my/org-reset-checkbox-state-maybe)))
+
+(add-hook 'org-after-todo-state-change-hook 'my/org-reset-checkbox-when-done)
+
+
 (provide 'my-org)
 
 ;;; my-org.el ends here