aboutsummaryrefslogtreecommitdiff
path: root/.emacs.local.d/lisp/packages/rul-org-agenda.el
blob: f978ea72867db81a29953562d610824688a25816 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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