aboutsummaryrefslogtreecommitdiff
path: root/.emacs.local.d/lisp/packages/rul-org-agenda.el
diff options
context:
space:
mode:
authorRaul Benencia <id@rbenencia.name>2023-02-21 19:44:16 -0800
committerRaul Benencia <id@rbenencia.name>2023-02-21 19:44:16 -0800
commit492049470fa3d486d909f50ddca59b335c8a44bb (patch)
tree2a11a54593dc6f63c9985bb02b5d28ae2db2e3ba /.emacs.local.d/lisp/packages/rul-org-agenda.el
parent4cd3b3371dcf77171b98dc12f48da248b2f703b2 (diff)
emacs: reorganize org files
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