From 61409ef458509a55b6cc077c215cedf4680b0ced Mon Sep 17 00:00:00 2001 From: BirDt_ Date: Thu, 21 Aug 2025 17:00:00 +0800 Subject: [PATCH] Don't side tree preview buffers, revert smarter --- workflows/org-custom.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/workflows/org-custom.el b/workflows/org-custom.el index d7c4eff..0d1b1fc 100644 --- a/workflows/org-custom.el +++ b/workflows/org-custom.el @@ -75,11 +75,13 @@ ) (defun theurgy-refresh-org-files () - "Alternative to revert-all-org-buffers, which is a bit more intelligent." + "Revert all agenda file buffers in the background." (interactive) (dolist (f org-agenda-files) - (with-current-buffer (find-file-noselect f t) - (revert-buffer t t)))) + (let ((buf (find-buffer-visiting f))) + (when buf + (with-current-buffer buf + (revert-buffer :ignore-auto :noconfirm)))))) (theurgy-refresh-org-files) @@ -106,7 +108,7 @@ ;; Side tree (defun conditional-side-tree () - (when (not (string-match-p "\\*capture\\*\\|CAPTURE-\\|scratch\\*" (buffer-name))) + (when (not (string-match-p "\\*capture\\*\\|CAPTURE-\\|scratch\\*\\|\\[Preview\\]" (buffer-name))) (org-side-tree))) (use-package org-side-tree