diff options
author | Tom Willemse | 2022-03-15 23:09:46 -0700 |
---|---|---|
committer | Tom Willemse | 2022-03-15 23:09:46 -0700 |
commit | 8ff956b3a2fdf91a57a488739b82f666954b90a5 (patch) | |
tree | fff354d3a4ba99d5ea454505dcd9be675402aed3 | |
parent | 62dec3975644db19f24d4889a738c02d34fd4837 (diff) | |
download | emacs-config-8ff956b3a2fdf91a57a488739b82f666954b90a5.tar.gz emacs-config-8ff956b3a2fdf91a57a488739b82f666954b90a5.zip |
[oni-org] Hide the body of the task marked as done
-rw-r--r-- | oni-org/oni-org.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index ebb29ee..9049e95 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -466,6 +466,11 @@ also move point to the start of the heading." (oni-org-create-chapter-heading book-name chapter-name notes-file)) (oni-org-create-chapter-section chapter-name notes-file)))) +(defun oni-org-todo-maybe-hide-body () + "Hide the current outline body if ‘org-state’ is a DONE state." + (when (member org-state org-done-keywords) + (outline-hide-body))) + (setq org-todo-keywords '((sequence "TODO(t)" "WIP" "BLOCKED(b@)" "|" "DONE(d!)") (sequence "READ(r)" "READING(!)" "|" "FINISHED(!)" "STOPPED(@)") @@ -473,6 +478,8 @@ also move point to the start of the heading." (sequence "LISTEN(l)" "LISTENING" "|" "DONE(d!)") (sequence "|" "CANCELLED(c@)"))) +(add-hook 'org-after-todo-state-change-hook 'oni-org-todo-maybe-hide-body) + (setf (alist-get 'file org-link-frame-setup) 'find-file) (add-to-list 'org-modules 'org-habit) |