feat(emacs): Customise org-agenda
Notable features include - Show repeater intervals. - Custom view split into day agenda and upcoming deadlines.
This commit is contained in:
@@ -214,6 +214,45 @@ See https://lists.gnu.org/archive/html/emacs-orgmode/2019-07/msg00081.html."
|
|||||||
;; Larger LaTeX previews.
|
;; Larger LaTeX previews.
|
||||||
(plist-put org-format-latex-options :scale 1.4))
|
(plist-put org-format-latex-options :scale 1.4))
|
||||||
|
|
||||||
|
(defun syd-org-init-agenda-h ()
|
||||||
|
(setq
|
||||||
|
;; The lengths of these leaders take account for our added
|
||||||
|
;; `syd-org--agenda-repeater'.
|
||||||
|
org-agenda-scheduled-leaders '("Sched" "S.%2dx")
|
||||||
|
org-agenda-deadline-leaders '("Deadl" "In%2dd" "D.%2dx")
|
||||||
|
org-agenda-timerange-leaders '("" ; Range within a single day.
|
||||||
|
"%2d/%2d") ; Range spanning many days.
|
||||||
|
;; Hide "upcoming deadlines" until the scheduled date.
|
||||||
|
org-agenda-skip-deadline-prewarning-if-scheduled 'pre-scheduled
|
||||||
|
;; Hide completed tasks.
|
||||||
|
org-agenda-skip-scheduled-if-done t)
|
||||||
|
|
||||||
|
;; Show the repeater (the repeat interval, e.g. +1d) in repeating agenda
|
||||||
|
;; entries.
|
||||||
|
(defun syd-org--agenda-repeater ()
|
||||||
|
(if (org-before-first-heading-p)
|
||||||
|
"-------" ; fill the time grid
|
||||||
|
(format "%5s: " (or (org-get-repeat) ""))))
|
||||||
|
|
||||||
|
;; Add `syd-org--agenda-repeater' to the agenda prefix.
|
||||||
|
(setcdr (assoc 'agenda org-agenda-prefix-format)
|
||||||
|
" %i %-12:c%?-12t%s%(syd-org--agenda-repeater)")
|
||||||
|
|
||||||
|
(setq org-agenda-custom-commands
|
||||||
|
'(("k" "My agenda for today"
|
||||||
|
((agenda
|
||||||
|
""
|
||||||
|
((org-agenda-span 1)
|
||||||
|
(org-deadline-warning-days 0)))
|
||||||
|
(agenda
|
||||||
|
""
|
||||||
|
((org-agenda-span 7)
|
||||||
|
(org-agenda-start-day "+1d")
|
||||||
|
(org-deadline-warning-days 0)
|
||||||
|
(org-agenda-time-grid nil)
|
||||||
|
(org-agenda-entry-types '(:deadline))
|
||||||
|
(org-agenda-overriding-header "Upcoming deadlines"))))))))
|
||||||
|
|
||||||
(use-package org
|
(use-package org
|
||||||
:defer-incrementally
|
:defer-incrementally
|
||||||
calendar find-func format-spec org-macs org-compat org-faces org-entities
|
calendar find-func format-spec org-macs org-compat org-faces org-entities
|
||||||
@@ -310,9 +349,11 @@ See https://lists.gnu.org/archive/html/emacs-orgmode/2019-07/msg00081.html."
|
|||||||
;; ol-rmail
|
;; ol-rmail
|
||||||
;; ol-eww
|
;; ol-eww
|
||||||
))
|
))
|
||||||
(add-hook 'org-load-hook
|
(syd-add-hook 'org-load-hook
|
||||||
#'syd-org-init-popup-rules-h
|
#'syd-org-init-popup-rules-h
|
||||||
#'syd-org-init-appearance-h)
|
#'syd-org-init-appearance-h)
|
||||||
|
(with-eval-after-load 'org-agenda
|
||||||
|
(syd-org-init-agenda-h))
|
||||||
:config
|
:config
|
||||||
(require 'syd-prose)
|
(require 'syd-prose)
|
||||||
(syd-add-hook 'org-mode-hook
|
(syd-add-hook 'org-mode-hook
|
||||||
|
|||||||
Reference in New Issue
Block a user