From dc768d0e21c84cfeedad03a7aa86c80350857348 Mon Sep 17 00:00:00 2001 From: BardofSprites Date: Sun, 16 Mar 2025 17:44:00 -0400 Subject: function to export agenda to file --- bard-emacs-modules/bard-emacs-calendar.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'bard-emacs-modules/bard-emacs-calendar.el') 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) -- cgit v1.2.3