From 41ad6a2c6dd6a5798fe8f7256b8f08690032b314 Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Fri, 11 Apr 2025 16:15:04 -0600 Subject: [PATCH] agenda functions work --- dotfiles/doom/config.org | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/dotfiles/doom/config.org b/dotfiles/doom/config.org index 5347a5f..e4022f8 100755 --- a/dotfiles/doom/config.org +++ b/dotfiles/doom/config.org @@ -457,6 +457,7 @@ Configurations to add linting support to specific languages by integrating linte (add-to-list 'flycheck-checkers 'nix-statix)) #+end_src + * HUGO Capture template for new hugo posts. @@ -729,16 +730,19 @@ empty list if the cache doesn’t exist. (with-temp-file my/org-agenda-cache-file (prin1 todo-files (current-buffer)))) (message "No TODOs found — not writing cache.")))) -;; (defun my/load-org-agenda-from-cache () -;; "Load org-agenda-files from .cache, or fallback to an empty list." -;; (if (file-exists-p my/org-agenda-cache-file) -;; (with-temp-buffer -;; (insert-file-contents my/org-agenda-cache-file) -;; (read (current-buffer))) -;; (message "Agenda cache not found — using empty org-agenda-files.") -;; nil)) -;; (after! org -;; (setq org-agenda-files (my/load-org-agenda-from-cache))) +(defun my/load-org-agenda-from-cache () + "Load org-agenda-files from .cache, or fallback to an empty list." + (interactive) + (let ((file my/org-agenda-cache-file)) + (if (and (file-exists-p file) + (> (nth 7 (file-attributes file)) 0)) ; size > 0 + (with-temp-buffer + (insert-file-contents file) + (read (current-buffer))) + (message "Agenda cache not found or empty") + nil))) +(after! org + (setq org-agenda-files (my/load-org-agenda-from-cache))) #+end_src ** Set font sizes for each header level in Org