aboutsummaryrefslogtreecommitdiff
path: root/.emacs.local.d/lisp/packages/rul-org-agenda.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.local.d/lisp/packages/rul-org-agenda.el')
-rw-r--r--.emacs.local.d/lisp/packages/rul-org-agenda.el40
1 files changed, 40 insertions, 0 deletions
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 "<f12>") #'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)
nihil fit ex nihilo