aboutsummaryrefslogtreecommitdiff
path: root/bard-emacs-modules
diff options
context:
space:
mode:
authorBardofSprites <[email protected]>2025-03-16 17:44:00 -0400
committerBardofSprites <[email protected]>2025-03-16 17:44:00 -0400
commitdc768d0e21c84cfeedad03a7aa86c80350857348 (patch)
tree7f97d0bda2263cd3560266b3387518fab4ebf762 /bard-emacs-modules
parentc7a49dc313feb56a9b43a58fc44707639a70b6fa (diff)
function to export agenda to file
Diffstat (limited to 'bard-emacs-modules')
-rw-r--r--bard-emacs-modules/bard-emacs-calendar.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/bard-emacs-modules/bard-emacs-calendar.el b/bard-emacs-modules/bard-emacs-calendar.el
index ce7d4e8..7aaf8c6 100644
--- a/bard-emacs-modules/bard-emacs-calendar.el
+++ b/bard-emacs-modules/bard-emacs-calendar.el
@@ -80,4 +80,23 @@
holiday-christian-holidays nil
holiday-islamic-holidays nil))
+(defun bard/export-agenda-to-file ()
+ (interactive)
+ (org-eval-in-environment (org-make-parameter-alist
+ '(org-agenda-span
+ 'week
+ org-agenda-use-time-grid t
+ org-agenda-remove-tags t
+ org-agenda-window-setup 'nope))
+ (let* ((wins (current-window-configuration))
+ org-agenda-sticky)
+ (save-excursion
+ (with-current-buffer
+ (get-buffer-create org-agenda-buffer-name)
+ (pop-to-buffer (current-buffer))
+ (org-agenda nil "a")
+ (let ((result (buffer-string)))
+ (with-temp-file "~/.cache/agenda" (insert result)))))
+ (set-window-configuration wins))))
+
(provide 'bard-emacs-calendar)