[oni-org] Update all dynamic blocks on save
Skip any that are in archived files.
This commit is contained in:
parent
df3396bd8f
commit
3a5ea16176
1 changed files with 7 additions and 1 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||
;; 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)
|
||||
|
|
Loading…
Reference in a new issue