From 492049470fa3d486d909f50ddca59b335c8a44bb Mon Sep 17 00:00:00 2001 From: Raul Benencia Date: Tue, 21 Feb 2023 19:44:16 -0800 Subject: emacs: reorganize org files --- .emacs.local.d/lisp/packages/rul-org-agenda.el | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .emacs.local.d/lisp/packages/rul-org-agenda.el (limited to '.emacs.local.d/lisp/packages/rul-org-agenda.el') diff --git a/.emacs.local.d/lisp/packages/rul-org-agenda.el b/.emacs.local.d/lisp/packages/rul-org-agenda.el new file mode 100644 index 0000000..f978ea7 --- /dev/null +++ b/.emacs.local.d/lisp/packages/rul-org-agenda.el @@ -0,0 +1,40 @@ +(require 'org) + +(global-set-key (kbd "") #'org-agenda) +(global-set-key (kbd "C-c a") #'org-agenda) + +;; AGENDA VIEW ;; + +(setq org-agenda-files my-org-agenda-files) +(setq org-agenda-custom-commands my-org-agenda-custom-commands) + +;; Do not dim blocked tasks +(setq org-agenda-compact-blocks nil) +(setq org-agenda-dim-blocked-tasks nil) +(setq org-agenda-block-separator 61) + +;; Agenda log mode items to display (closed and state changes by default) +(setq org-agenda-log-mode-items (quote (closed state))) + +; For tag searches ignore tasks with scheduled and deadline dates +(setq org-agenda-tags-todo-honor-ignore-options t) + +;; Credits: https://200ok.ch/posts/2022-02-13_integrating_org_mode_agenda_into_other_calendar_apps.html +(defun org-agenda-export-to-ics () + ;; Run all custom agenda commands that have a file argument. + (org-batch-store-agenda-views) + + ;; Org mode correctly exports TODO keywords as VTODO events in ICS. + ;; However, some proprietary calendars do not really work with + ;; standards (looking at you Google), so VTODO is ignored and only + ;; VEVENT is read. + (with-current-buffer (find-file-noselect my-org-agenda-private-local-path) + (goto-char (point-min)) + (while (re-search-forward "VTODO" nil t) + (replace-match "VEVENT")) + (save-buffer)) + + ;; Copy the ICS file to a remote server (Tramp paths work). + (copy-file my-org-agenda-private-local-path my-org-agenda-private-remote-path t)) + +(provide 'rul-org-agenda) -- cgit v1.2.3