.emacs.d

the most bloated Emacs config on this planet
git clone https://git.trogloxene.org/.emacs.d.git
Log | Files | Refs

commit 1c50f7bc6b1f526186c1e5e4c33997ab2dd5d777
parent aec488f4f063e7a393f719390ed95f1a133e1462
Author: andsy10 <andsy1016@gmail.com>
Date:   Wed,  7 Oct 2026 00:53:25 +0800

Add command to update all dynamic blocks

Diffstat:
Mlisp/init-org.el | 20+++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/lisp/init-org.el b/lisp/init-org.el @@ -110,7 +110,7 @@ :hook (after-init . denote-rename-buffer-mode) (dired-mode . denote-dired-mode) - :commands my-denote-find-file my-denote-find-backlink-with-location + :commands my-denote-find-file my-denote-find-backlink-with-location my-org-dblock-update-all :config (defun my-denote-find-file (&optional arg) "Find file use denote-open-or-create." @@ -131,6 +131,24 @@ (fetcher (lambda () (xref-matches-in-files id files)))) (consult-xref fetcher nil))) + (defun my-org-dblock-update-all () + "Update all dynamic blocks in denote files." + (interactive) + (let ((recentf-exclude '(".*")) + (changed 0)) + (dolist (file (denote-directory-files)) + (let ((already-open (find-buffer-visiting file)) + (buf (find-file-noselect file))) + (with-current-buffer buf + (with-buffer-unmodified-if-unchanged + (when (derived-mode-p 'org-mode) + (org-dblock-update t))) + (when (buffer-modified-p) + (setq changed (1+ changed))) + (unless (or (buffer-modified-p) already-open) + (kill-current-buffer))))) + (message "Updated %s file(s)" changed))) + :init (setq denote-directory org-directory denote-org-store-link-to-heading 'context