diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index 9f5cfaf..122dfb6 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2022.0602.214649 +;; Version: 2022.0612.162440 ;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org org-contrib org-bullets org-edna diminish all-the-icons olivetti mixed-pitch) ;; This program is free software; you can redistribute it and/or modify @@ -474,6 +474,11 @@ also move point to the start of the heading." (when (member org-state org-done-keywords) (outline-hide-body))) +(defun oni-org-update-all-dblocks-live () + "Call ‘org-update-all-dblocks’ if the current file isn't an archive file." + (if (not (string-suffix-p "_archive" (buffer-file-name))) + (org-update-all-dblocks))) + (setq org-todo-keywords '((sequence "TODO(t)" "WIP" "BLOCKED(b@)" "|" "DONE(d!)") (sequence "READ(r)" "READING(!)" "|" "FINISHED(!)" "STOPPED(@)") @@ -490,6 +495,7 @@ also move point to the start of the heading." (add-to-list 'org-babel-load-languages '(java . t)) +(add-hook 'before-save-hook #'oni-org-update-all-dblocks-live) (add-hook 'org-mode-hook #'oni-org-set-tag-faces) (add-hook 'org-mode-hook #'oni-org-set-todo-keyword-faces) (add-hook 'org-mode-hook #'oni-org-set-yasnippet-condition)