summaryrefslogtreecommitdiff
path: root/modules/org-agenda-config.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/org-agenda-config.el')
-rw-r--r--modules/org-agenda-config.el68
1 files changed, 42 insertions, 26 deletions
diff --git a/modules/org-agenda-config.el b/modules/org-agenda-config.el
index 7b436424..5610d840 100644
--- a/modules/org-agenda-config.el
+++ b/modules/org-agenda-config.el
@@ -32,9 +32,18 @@
;;; Code:
(require 'user-constants)
+;; Load debug functions if enabled
+(when (or (eq cj/debug-modules t)
+ (memq 'org-agenda cj/debug-modules))
+ (require 'org-agenda-config-debug
+ (expand-file-name "org-agenda-config-debug.el"
+ (file-name-directory load-file-name))
+ t))
+
(use-package org-agenda
:ensure nil ;; built-in
:after (org)
+ :demand t
:config
(setq org-agenda-prefix-format '((agenda . " %i %-25:c%?-12t% s")
(timeline . " % s")
@@ -59,7 +68,7 @@
(local-set-key (kbd "s-<left>")
#'org-agenda-todo-previousset)))
- ;; build org-agenda-list for the first time after emacs init completes.
+ ;; Rebuild org-agenda-files at startup to gather all todo.org files from projects
(add-hook 'emacs-startup-hook #'cj/build-org-agenda-list))
;; ------------------------ Add Files To Org Agenda List -----------------------
@@ -68,7 +77,6 @@
(defun cj/add-files-to-org-agenda-files-list (directory)
"Search for files named \\='todo.org\\=' add them to org-project-files.
-
DIRECTORY is a string of the path to begin the search."
(interactive "D")
(setq org-agenda-files
@@ -81,10 +89,9 @@ DIRECTORY is a string of the path to begin the search."
;; agenda targets is the schedule, contacts, project todos,
;; inbox, and org roam projects.
(defun cj/build-org-agenda-list ()
- "Rebuilds the org agenda list without checking org-roam for projects.
-
+ "Rebuilds the org agenda list.
Begins with the inbox-file, schedule-file, and contacts-file.
-Then adds all todo.org files from projects-dir and code-dir.
+Then adds all todo.org files from projects-dir.
Reports elapsed time in the messages buffer."
(interactive)
(let ((start-time (current-time)))
@@ -97,15 +104,8 @@ Reports elapsed time in the messages buffer."
(message "Rebuilt org-agenda-files in %.3f sec"
(float-time (time-subtract (current-time) start-time)))))
-;; Run the above once after Emacs startup when idle for 1 second
-;; makes regenerating the list much faster
-(add-hook 'emacs-startup-hook
- (lambda ()
- (run-with-idle-timer 1 nil #'cj/build-org-agenda-list)))
-
(defun cj/todo-list-all-agenda-files ()
"Displays an \\='org-agenda\\=' todo list.
-
The contents of the agenda will be built from org-project-files and org-roam
files that have project in their filetag."
(interactive)
@@ -118,7 +118,6 @@ files that have project in their filetag."
(defun cj/todo-list-from-this-buffer ()
"Displays an \\='org-agenda\\=' todo list built from the current buffer.
-
If the current buffer isn't an org buffer, inform the user."
(interactive)
(if (eq major-mode 'org-mode)
@@ -153,7 +152,6 @@ If the current buffer isn't an org buffer, inform the user."
(defun cj/org-agenda-skip-subtree-if-not-overdue ()
"Skip an agenda subtree if it is not an overdue deadline or scheduled task.
-
An entry is considered overdue if it has a scheduled or deadline date strictly
before today, is not marked as done, and is not a habit."
(let* ((subtree-end (save-excursion (org-end-of-subtree t)))
@@ -176,7 +174,6 @@ before today, is not marked as done, and is not a habit."
(defun cj/org-skip-subtree-if-priority (priority)
"Skip an agenda subtree if it has a priority of PRIORITY.
-
PRIORITY may be one of the characters ?A, ?B, or ?C."
(let ((subtree-end (save-excursion (org-end-of-subtree t)))
(pri-value (* 1000 (- org-lowest-priority priority)))
@@ -187,7 +184,6 @@ PRIORITY may be one of the characters ?A, ?B, or ?C."
(defun cj/org-skip-subtree-if-keyword (keywords)
"Skip an agenda subtree if it has a TODO keyword in KEYWORDS.
-
KEYWORDS must be a list of strings."
(let ((subtree-end (save-excursion (org-end-of-subtree t))))
(if (member (org-get-todo-state) keywords)
@@ -224,12 +220,10 @@ KEYWORDS must be a list of strings."
(defun cj/main-agenda-display ()
"Display the main daily org-agenda view.
-
This uses all org-agenda targets and presents three sections:
- All unfinished priority A tasks
- Today's schedule, including habits with consistency graphs
- All priority B and C unscheduled/undeadlined tasks
-
The agenda is rebuilt from all sources before display, including:
- inbox-file and schedule-file
- Org-roam nodes tagged as \"Project\"
@@ -263,9 +257,14 @@ This allows a line to show in an agenda without being scheduled or a deadline."
;; Install CHIME from GitHub using use-package :vc (Emacs 29+)
(use-package chime
- :vc (:url "https://github.com/cjennings/chime.el" :rev :newest)
- :after (alert org-agenda)
:demand t
+ ;; :vc (:url "https://github.com/cjennings/chime.el" :rev :newest) ;; using latest on github
+ :after alert ; Removed org-agenda - chime.el requires it internally
+ :ensure nil ;; using local version
+ :load-path "~/code/chime.el"
+ :init
+ ;; Debug mode (set to t for troubleshooting)
+ (setq chime-debug nil)
:bind
("C-c A" . chime-check)
:config
@@ -273,13 +272,30 @@ This allows a line to show in an agenda without being scheduled or a deadline."
;; This gives two notifications per event without any after-event notifications
(setq chime-alert-time '(5 0))
- ;; Modeline display: show upcoming events within 60 minutes
- (setq chime-modeline-lookahead 120)
+ ;; Modeline display: show upcoming events within 2 hours
+ (setq chime-enable-modeline t)
+ (setq chime-modeline-lookahead-minutes (* 3 60))
(setq chime-modeline-format " ⏰ %s")
- ;; Chime sound: plays when notifications appear
- (setq chime-play-sound t)
- ;; Uses bundled chime.wav by default
+ ;; Tooltip settings: show up to 20 upcoming events (regardless of how far in future)
+ ;; chime-tooltip-lookahead-hours defaults to 8760 (1 year) - effectively unlimited
+ (setq chime-modeline-tooltip-max-events 10)
+ (setq chime-tooltip-lookahead-hours (* 6 24))
+
+ ;; Modeline content: show title and countdown only (omit event time)
+ (setq chime-notification-text-format "%t %u")
+
+ ;; Time-until format: compact style like " in 10m" or " in 1h 37m"
+ (setq chime-time-left-format-short " in %mm ") ; Under 1 hour: " in 10m"
+ (setq chime-time-left-format-long " in %hh %mm ") ; 1 hour+: " in 1h 37m"
+ (setq chime-time-left-format-at-event "now")
+
+ ;; Title truncation: limit long event titles to 15 characters
+ ;; This affects only the title, not the icon or countdown
+ (setq chime-max-title-length 25) ; "Very Long Me... ( in 10m)"
+
+ ;; Chime sound: disabled
+ (setq chime-play-sound nil)
;; Notification settings
(setq chime-notification-title "Reminder")
@@ -293,7 +309,7 @@ This allows a line to show in an agenda without being scheduled or a deadline."
(setq chime-predicate-blacklist
'(chime-done-keywords-predicate))
- ;; Enable chime-mode automatically
+ ;; Enable chime-mode - validation happens on first check after startup-delay
(chime-mode 1))
;; which-key labels