summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/org-agenda-config.el422
-rw-r--r--modules/org-capture-config.el104
-rw-r--r--modules/org-config.el311
-rw-r--r--modules/org-drill-config.el11
-rw-r--r--modules/org-noter-config.el13
-rw-r--r--modules/org-roam-config.el10
6 files changed, 293 insertions, 578 deletions
diff --git a/modules/org-agenda-config.el b/modules/org-agenda-config.el
index becd8f7a..c39945cb 100644
--- a/modules/org-agenda-config.el
+++ b/modules/org-agenda-config.el
@@ -14,287 +14,119 @@
;; watch your character, for it becomes your destiny."
;; -- Lao Tzu
;;
-;; KEYBINDINGS:
-;; f8 - MAIN AGENDA which organizes all tasks and events into:
-;; - overdue tasks (past scheduled/deadline dates)
-;; - all unfinished priority A tasks
-;; - the 8-day schedule, including the habit consistency graph
-;; - all priority B tasks
-;; C-u f8 - Force rebuild of agenda file list (ignores cache)
;;
-;; C-f8 - TASK LIST containing all tasks from all agenda targets.
-;; C-u C-f8 - Force rebuild of agenda file list before showing task list
+;; f8 - MAIN AGENDA which organizes all tasks and events into:
+;; - all unfinished priority A tasks
+;; - the weekly schedule, including the habit consistency graph
+;; - all priority B tasks
;;
-;; M-f8 - TASK LIST containing all tasks from just the current org-mode buffer.
+;; C-f8 - TASK LIST containing all tasks from all agenda targets.
;;
-;; PERFORMANCE OPTIMIZATION:
-;; The agenda file list is cached to avoid expensive directory scans on every
-;; F8 press. The cache is automatically rebuilt every 5 minutes (configurable
-;; via `cj/org-agenda-rebuild-interval'). Use C-u f8 to force an immediate
-;; rebuild if you've added new todo.org files.
+;; M-f8 - TASK LIST containing all tasks from just the current org-mode buffer.
;;
;; NOTE:
;; Files that contain information relevant to the agenda will be found in the
-;; following places: the schedule-file, gcal-file, and project todo.org files
-;; found in projects-dir (searches up to 3 levels deep).
+;; following places: the schedule-file, org-roam notes tagged as 'Projects' and
+;; project todo.org files found in project-dir and code-dir.
;;; Code:
+(require 'user-constants)
-(require 'seq) ;; for seq-filter to disable tramp-archive handlers
-
-;; Forward declarations for user-constants variables
-(eval-when-compile
- (defvar inbox-file)
- (defvar schedule-file)
- (defvar gcal-file)
- (defvar projects-dir))
-
-;; Forward declarations for org-mode variables
-(defvar org-agenda-files)
-(defvar org-done-keywords)
-(defvar org-lowest-priority)
-(defvar org-agenda-dim-blocked-tasks)
-(defvar org-agenda-use-tag-inheritance)
-(defvar org-agenda-ignore-properties)
-(defvar org-agenda-inhibit-startup)
-(defvar org-agenda-include-diary)
-(defvar org-agenda-skip-deadline-if-done)
-(defvar org-agenda-skip-scheduled-if-done)
-(defvar org-agenda-skip-scheduled-if-deadline-is-shown)
-(defvar org-habit-show-habits-only-for-today)
-(defvar org-habit-graph-column)
-(defvar org-habit-show-graphs)
-(defvar diary-file)
-
-;; Forward declarations for org-mode functions
-(declare-function org-end-of-subtree "org" (invisible-ok))
-(declare-function org-get-todo-state "org" (&optional string))
-(declare-function org-entry-get "org" (pom property &optional inherit literal-nil))
-(declare-function org-time-string-to-absolute "org" (s &optional daynr prefer buffer pos))
-(declare-function org-get-priority "org" (s))
-(declare-function org-agenda "org-agenda" (&optional arg keys restriction))
-(declare-function org-end-of-line "org" (&optional n))
-(declare-function org-agenda-todo-nextset "org-agenda" ())
-(declare-function org-agenda-todo-previousset "org-agenda" ())
-(declare-function thing-at-point "thingatpt" (thing &optional no-properties))
-
-;; Forward declarations for seq (for filtering file-name-handler-alist)
-(declare-function seq-filter "seq" (pred sequence))
-
-;; Forward declarations for alert/org-alert variables
-(defvar alert-fade-time)
-(defvar alert-default-style)
-(defvar org-alert-interval)
-(defvar org-alert-notify-cutoff)
-(defvar org-alert-notify-after-event-cutoff)
-(defvar org-alert-notification-title)
-
-;; ----------------------------- Configuration ---------------------------------
-
-(defvar cj/org-agenda-rebuild-interval 300
- "Interval in seconds between automatic org-agenda-files rebuilds.
-Set to nil to disable automatic rebuilding. Default is 300 seconds (5 minutes).")
-
-;; ------------------------------ Cache Variables ------------------------------
-
-(defvar cj/org-agenda-files-cache nil
- "Cached list of org-agenda files to avoid expensive directory scans.")
-
-(defvar cj/org-agenda-rebuild-timer nil
- "Timer object for periodic org-agenda-files rebuilding.")
-
-;; ========================= PERFORMANCE SETTINGS ==============================
-;; Set these EARLY, before org-agenda loads, for maximum performance
-
-;; CRITICAL: dim-blocked-tasks is VERY slow - checks all dependencies
-(setopt org-agenda-dim-blocked-tasks nil)
-
-;; Disable expensive features
-(setopt org-agenda-use-tag-inheritance nil) ;; don't inherit tags (much faster)
-(setopt org-agenda-ignore-properties '(effort appt category)) ;; skip property lookups
-(setopt org-agenda-inhibit-startup t) ;; don't run startup hooks per file
-
-;; CRITICAL: Disable diary integration - diary is VERY slow
-;; This must be set BEFORE org-agenda loads AND in the config block
-(setopt org-agenda-include-diary nil)
-(setopt diary-file "/dev/null") ;; Extra safety: point diary to /dev/null
-
-;; Skip completed items (fewer items to process)
-(setopt org-agenda-skip-deadline-if-done t)
-(setopt org-agenda-skip-scheduled-if-done t)
-(setopt org-agenda-skip-scheduled-if-deadline-is-shown t)
-
-;; CRITICAL PERFORMANCE: Habit graphs are VERY expensive to render
-;; Habit consistency graphs can add 5-10 seconds to agenda generation
-;; Options:
-;; - org-habit-show-graphs nil = No graphs (FAST - habits still show)
-;; - org-habit-show-graphs t = Show graphs (SLOW but shows consistency)
-;; - org-habit-show-habits-only-for-today t = Graphs only for today (MEDIUM)
-
-(setopt org-habit-show-habits nil)
-(setopt org-habit-show-habits-only-for-today t)
-(setopt org-habit-graph-column 50)
-
-;; Display agenda from the bottom (must be set before org-agenda loads)
-(with-eval-after-load 'org-agenda
+(use-package org-agenda
+ :ensure nil ;; built-in
+ :after (org)
+ :config
+ (setq org-agenda-prefix-format '((agenda . " %i %-25:c%?-12t% s")
+ (timeline . " % s")
+ (todo . " %i %-25:c")
+ (tags . " %i %-12:c")
+ (search . " %i %-12:c")))
+ (setq org-agenda-dim-blocked-tasks 'invisible)
+ (setq org-agenda-skip-scheduled-if-done nil)
+ (setq org-agenda-remove-tags t)
+ (setq org-agenda-compact-blocks t)
+
+ ;; display the agenda from the bottom
(add-to-list 'display-buffer-alist
'("\\*Org Agenda\\*"
(display-buffer-reuse-mode-window display-buffer-below-selected)
(dedicated . t)
- (window-height . fit-window-to-buffer))))
-
-(use-package org-agenda
- :ensure nil ;; built-in
- :after org
- :config
- (require 'user-constants)
- (setopt org-agenda-prefix-format '((agenda . " %i %-25:c%?-12t% s")
- (timeline . " % s")
- (todo . " %i %-25:c")
- (tags . " %i %-12:c")
- (search . " %i %-12:c")))
-
- (setopt org-agenda-remove-tags t)
- (setopt org-agenda-compact-blocks t)
- (setopt org-agenda-span 'day) ;; show only today by default (override in custom commands)
- (setopt org-agenda-start-on-weekday nil) ;; start on current day
- (setopt org-agenda-use-time-grid nil) ;; disable time grid
- (setopt org-agenda-show-log nil)
-
- ;; Ensure diary stays disabled (set again in case something re-enabled it)
- (setopt org-agenda-include-diary nil)
+ (window-height . fit-window-to-buffer)))
;; reset s-left/right each time org-agenda is enabled
- (add-hook 'org-agenda-mode-hook #'cj/org-agenda-mode-keys))
+ (add-hook 'org-agenda-mode-hook (lambda ()
+ (local-set-key (kbd "s-<right>") #'org-agenda-todo-nextset)
+ (local-set-key (kbd "s-<left>")
+ #'org-agenda-todo-previousset)))
-;; ----------------------- Org Agenda Mode Keybindings ------------------------
-
-(defun cj/org-agenda-mode-keys ()
- "Set up keybindings for org-agenda-mode."
- (local-set-key (kbd "s-<right>") #'org-agenda-todo-nextset)
- (local-set-key (kbd "s-<left>") #'org-agenda-todo-previousset))
+ ;; build org-agenda-list for the first time after emacs init completes.
+ (add-hook 'emacs-startup-hook #'cj/build-org-agenda-list))
;; ------------------------ Add Files To Org Agenda List -----------------------
;; finds files named 'todo.org' (case insensitive) and adds them to
;; org-agenda-files list.
-(defun cj/find-todo-org-files (directory)
- "Find all todo.org files in DIRECTORY using fast wildcard matching.
-Searches up to 3 levels deep for files named todo.org (case insensitive).
-Returns a list of absolute file paths.
-
-Note: Temporarily disables TRAMP archive file name handlers to prevent
-file-expand-wildcards from trying to look inside .zip, .tar.gz, etc. files,
-which would cause significant slowdown."
- (when (and directory (file-directory-p directory))
- (let ((dir (file-name-as-directory (expand-file-name directory)))
- (found-files '())
- ;; Temporarily disable tramp-archive to prevent looking inside archives
- (file-name-handler-alist
- (seq-filter (lambda (handler)
- (not (eq (cdr handler) 'tramp-archive-file-name-handler)))
- file-name-handler-alist)))
- ;; Search at multiple depth levels (faster than recursive search)
- ;; Level 0: todo.org directly in directory
- (setq found-files (append (file-expand-wildcards (concat dir "[Tt][Oo][Dd][Oo].[Oo][Rr][Gg]")) found-files))
- ;; Level 1: todo.org one level deep
- (setq found-files (append (file-expand-wildcards (concat dir "*/[Tt][Oo][Dd][Oo].[Oo][Rr][Gg]")) found-files))
- found-files)))
-
(defun cj/add-files-to-org-agenda-files-list (directory)
- "Search for files named `todo.org' and add them to `org-agenda-files'.
-DIRECTORY is a string of the path to begin the search.
-Modifies the global `org-agenda-files' variable as a side effect."
+ "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
- (append (cj/find-todo-org-files directory)
+ (append (directory-files-recursively directory
+ "^[Tt][Oo][Dd][Oo]\\.[Oo][Rr][Gg]$" t)
org-agenda-files)))
;; ---------------------------- Rebuild Org Agenda ---------------------------
;; builds the org agenda list from all agenda targets.
-;; agenda targets is the schedule, contacts, project todos, and inbox.org
-
-(defun cj/build-org-agenda-list (&optional force)
- "Build the org agenda file list, using cache when possible.
-With optional FORCE argument (or when called interactively with prefix arg),
-ignores the cache and forces a full rebuild.
-The file list is cached in `cj/org-agenda-files-cache' to avoid expensive
-directory scans on every agenda display. The cache is automatically refreshed
-every `cj/org-agenda-rebuild-interval' seconds.
-
-Begins with inbox-file, schedule-file, and gcal-file.
-Then adds all todo.org files from projects-dir.
+;; 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.
+
+Begins with the inbox-file, schedule-file, and contacts-file.
+Then adds all todo.org files from projects-dir and code-dir.
Reports elapsed time in the messages buffer."
- (interactive "P")
- (if (and (not force) cj/org-agenda-files-cache)
- (progn
- ;; Use cached file list
- (setq org-agenda-files cj/org-agenda-files-cache)
- (message "Using cached org-agenda-files (%d files)" (length org-agenda-files)))
- ;; Force rebuild or no cache exists
- (let ((start-time (current-time)))
- ;; Reset org-agenda-files to core files
- (setq org-agenda-files (list inbox-file schedule-file gcal-file))
-
- ;; Add all todo.org files from projects
- (cj/add-files-to-org-agenda-files-list projects-dir)
-
- ;; Cache the result
- (setq cj/org-agenda-files-cache org-agenda-files)
-
- (message "Rebuilt org-agenda-files in %.3f sec (%d files)"
- (float-time (time-subtract (current-time) start-time))
- (length org-agenda-files)))))
-
-;; ------------------------- Periodic Rebuild Timer ----------------------------
-
-(defun cj/start-org-agenda-rebuild-timer ()
- "Start the periodic timer to rebuild org-agenda-files.
-The timer interval is controlled by `cj/org-agenda-rebuild-interval'.
-If the interval is nil, no periodic rebuilding occurs."
- (when cj/org-agenda-rebuild-timer
- (cancel-timer cj/org-agenda-rebuild-timer)
- (setq cj/org-agenda-rebuild-timer nil))
- (when cj/org-agenda-rebuild-interval
- (setq cj/org-agenda-rebuild-timer
- (run-with-timer cj/org-agenda-rebuild-interval
- cj/org-agenda-rebuild-interval
- (lambda () (cj/build-org-agenda-list t))))))
-
-;; Initial build on startup (after 1 second idle) and start periodic timer
+ (interactive)
+ (let ((start-time (current-time)))
+ ;; reset org-agenda-files to inbox, schedule, and gcal
+ (setq org-agenda-files (list inbox-file schedule-file gcal-file))
+
+ ;; check all projects for scheduled tasks
+ (cj/add-files-to-org-agenda-files-list projects-dir)
+
+ (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
- (lambda ()
- (cj/build-org-agenda-list t)
- (cj/start-org-agenda-rebuild-timer)))))
-
-;;;###autoload
-(defun cj/todo-list-all-agenda-files (&optional force-rebuild)
- "Display an `org-agenda' todo list from all agenda files.
-With prefix argument FORCE-REBUILD, forces a complete rebuild of the
-agenda file list instead of using the cache."
- (interactive "P")
- (cj/build-org-agenda-list force-rebuild)
- (org-agenda "a" "t"))
+ (lambda ()
+ (run-with-idle-timer 1 nil #'cj/build-org-agenda-list)))
-;;;###autoload (keymap-global-set "C-<f8>" #'cj/todo-list-all-agenda-files)
+(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)
+ (cj/build-org-agenda-list)
+ (org-agenda "a" "t"))
+(global-set-key (kbd "C-<f8>") #'cj/todo-list-all-agenda-files)
;; ------------------------- Agenda List Current Buffer ------------------------
;; an agenda listing tasks from just the current buffer.
-;;;###autoload
(defun cj/todo-list-from-this-buffer ()
- "Displays an `org-agenda' todo list built from the current 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)
(let ((org-agenda-files (list buffer-file-name)))
(org-agenda "a" "t"))
- (message (format "Your org agenda request based on '%s' failed because it's not an org buffer."
- (buffer-name)))))
-
-;;;###autoload (keymap-global-set "M-<f8>" #'cj/todo-list-from-this-buffer)
+ (message (concat "Your org agenda request based on '" (buffer-name (current-buffer))
+ "' failed because it's not an org buffer."))))
+(global-set-key (kbd "M-<f8>") #'cj/todo-list-from-this-buffer)
;; -------------------------------- Main Agenda --------------------------------
;; my custom agenda command from all available agenda targets. adapted from:
@@ -312,18 +144,6 @@ If the current buffer isn't an org buffer, inform the user."
(defvar cj/main-agenda-tasks-title "PRIORITY B"
"String to announce the schedule section of the main agenda.")
-;; Cache "today" to avoid recalculating for every heading
-(defvar cj/org-agenda-today-absolute nil
- "Cached absolute day number for today, reset each agenda generation.")
-
-(defun cj/org-agenda-reset-today-cache ()
- "Reset the cached `today' value before generating agenda."
- (setq cj/org-agenda-today-absolute
- (org-time-string-to-absolute (format-time-string "%Y-%m-%d"))))
-
-;; Reset cache before each agenda generation
-(add-hook 'org-agenda-mode-hook #'cj/org-agenda-reset-today-cache)
-
(defun cj/org-skip-subtree-if-habit ()
"Skip an agenda entry if it has a STYLE property equal to \"habit\"."
(let ((subtree-end (save-excursion (org-end-of-subtree t))))
@@ -335,31 +155,30 @@ If the current buffer isn't an org buffer, inform the user."
"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.
-Performance: Uses cached `today' value to avoid recalculation per heading."
+before today, is not marked as done, and is not a habit."
(let* ((subtree-end (save-excursion (org-end-of-subtree t)))
- (todo-state (org-get-todo-state)))
+ (todo-state (org-get-todo-state))
+ (style (org-entry-get nil "STYLE"))
+ (deadline (org-entry-get nil "DEADLINE"))
+ (scheduled (org-entry-get nil "SCHEDULED"))
+ (today (org-time-string-to-absolute (format-time-string "%Y-%m-%d")))
+ (deadline-day (and deadline (org-time-string-to-absolute deadline)))
+ (scheduled-day (and scheduled (org-time-string-to-absolute scheduled))))
(if (or (not todo-state) ; no todo keyword
- (member todo-state org-done-keywords)) ; done/completed tasks
- subtree-end ; skip if done
- ;; Only check dates for non-done tasks
- (let* ((deadline (org-entry-get nil "DEADLINE"))
- (scheduled (org-entry-get nil "SCHEDULED"))
- (today (or cj/org-agenda-today-absolute
- (org-time-string-to-absolute (format-time-string "%Y-%m-%d"))))
- (deadline-day (and deadline (org-time-string-to-absolute deadline)))
- (scheduled-day (and scheduled (org-time-string-to-absolute scheduled)))
- (overdue (or (and deadline-day (< deadline-day today))
- (and scheduled-day (< scheduled-day today)))))
+ (member todo-state org-done-keywords) ; done/completed tasks
+ (string= style "habit"))
+ subtree-end ; skip if done or habit
+ (let ((overdue (or (and deadline-day (< deadline-day today))
+ (and scheduled-day (< scheduled-day today)))))
(if overdue
nil ; do not skip, keep this entry
subtree-end))))) ; skip if not overdue
(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)))
- ;; org-get-priority returns value * 1000, so we must match that scale
(pri-value (* 1000 (- org-lowest-priority priority)))
(pri-current (org-get-priority (thing-at-point 'line t))))
(if (= pri-value pri-current)
@@ -368,13 +187,14 @@ 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)
subtree-end
nil)))
-(setopt org-agenda-custom-commands
+(setq org-agenda-custom-commands
'(("d" "Daily Agenda with Tasks"
((alltodo ""
((org-agenda-skip-function #'cj/org-agenda-skip-subtree-if-not-overdue)
@@ -386,9 +206,8 @@ KEYWORDS must be a list of strings."
(org-agenda-prefix-format " %i %-15:c%?-15t% s")))
(agenda ""
((org-agenda-start-day "0d")
- (org-agenda-span 7) ;; 7-day view
+ (org-agenda-span 8)
(org-agenda-start-on-weekday nil)
- (org-agenda-include-diary nil) ;; explicitly disable diary in this view
(org-agenda-overriding-header cj/main-agenda-schedule-title)
(org-agenda-prefix-format " %i %-15:c%?-15t% s")))
(alltodo ""
@@ -403,63 +222,38 @@ KEYWORDS must be a list of strings."
((org-agenda-compact-blocks nil)))))
-;;;###autoload
-(defun cj/main-agenda-display (&optional force-rebuild)
+(defun cj/main-agenda-display ()
"Display the main daily org-agenda view.
-With prefix argument FORCE-REBUILD, forces a complete rebuild of the
-agenda file list instead of using the cache.
-This uses all org-agenda targets and presents four sections:
-- Overdue tasks (past scheduled/deadline dates)
-- All unfinished priority A tasks
-- Today's schedule (7-8 days), including habits
-- All priority B unscheduled/undeadlined tasks
-
-The agenda file list is cached and rebuilt automatically every
-`cj/org-agenda-rebuild-interval' seconds (default 5 minutes).
-Performance: Temporarily increases GC threshold during generation to reduce
-GC pauses, then restores it after 10 seconds.
-
-The agenda is built from all sources including:
-- inbox-file, schedule-file, and gcal-file
-- All todo.org files in projects-dir"
- (interactive "P")
- ;; Save current GC threshold and temporarily disable GC during agenda generation
- (let ((gc-cons-threshold-original gc-cons-threshold))
- (setq gc-cons-threshold most-positive-fixnum)
-
- ;; Generate the agenda
- (cj/build-org-agenda-list force-rebuild)
- (org-agenda "a" "d")
-
- ;; Restore GC threshold after 10 seconds (gives user time to view agenda)
- (run-at-time 10 nil
- (lambda ()
- (setq gc-cons-threshold gc-cons-threshold-original)
- (garbage-collect)))))
-
-;;;###autoload (keymap-global-set "<f8>" #'cj/main-agenda-display)
+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
-;; Set keybindings immediately when module loads
-(keymap-global-set "<f8>" #'cj/main-agenda-display)
-(keymap-global-set "C-<f8>" #'cj/todo-list-all-agenda-files)
-(keymap-global-set "M-<f8>" #'cj/todo-list-from-this-buffer)
+The agenda is rebuilt from all sources before display, including:
+- inbox-file and schedule-file
+- Org-roam nodes tagged as \"Project\"
+- All todo.org files in projects-dir and code-dir"
+ (interactive)
+ (cj/build-org-agenda-list)
+ (org-agenda "a" "d"))
+(global-set-key (kbd "<f8>") #'cj/main-agenda-display)
;; ------------------------- Add Timestamp To Org Entry ------------------------
;; simply adds a timestamp to put the org entry on an agenda
-(defvar cj/timeformat "%Y-%m-%d %a"
- "Time format for org entry timestamps.")
-
(defun cj/add-timestamp-to-org-entry (s)
"Add an event with time S to appear underneath the line-at-point.
+
This allows a line to show in an agenda without being scheduled or a deadline."
(interactive "sTime: ")
+ (defvar cj/timeformat "%Y-%m-%d %a")
(org-end-of-line)
(save-excursion
(open-line 1)
(forward-line 1)
(insert (concat "<" (format-time-string cj/timeformat (current-time)) " " s ">" ))))
+;;(global-set-key (kbd "M-t") #'cj/add-timestamp-to-org-entry)
;; --------------------------- Notifications / Alerts --------------------------
;; send libnotify notifications for agenda items
@@ -487,9 +281,9 @@ This allows a line to show in an agenda without being scheduled or a deadline."
(message "org-alert timer enabled with interval %d seconds" org-alert-interval))
;; Alert when idle post Emacs startup
-(add-hook 'emacs-startup-hook
- (lambda ()
- (run-with-idle-timer 1 nil #'cj/org-alert-enable-with-message)))
+;; (add-hook 'emacs-startup-hook
+;; (lambda ()
+;; (run-with-idle-timer 1 nil #'cj/org-alert-enable-with-message)))
(provide 'org-agenda-config)
diff --git a/modules/org-capture-config.el b/modules/org-capture-config.el
index 7b06db3c..f41d0228 100644
--- a/modules/org-capture-config.el
+++ b/modules/org-capture-config.el
@@ -14,18 +14,6 @@
;;; Code:
-(eval-when-compile (defvar drill-dir))
-(eval-when-compile (defvar inbox-file))
-(eval-when-compile (defvar gcal-file))
-(eval-when-compile (defvar schedule-file))
-
-(defvar org-capture-plist)
-(defvar org-store-link-plist)
-(defvar org-capture-templates)
-(declare-function org-parse-time-string "org")
-(declare-function org-capture-get "org-capture")
-(declare-function pdf-view-active-region-text "pdf-view")
-
;; --------------------------- Org-Capture Templates ---------------------------
;; you can bring up the org capture menu with C-c c
@@ -94,67 +82,71 @@ Intended to be called within an org capture template."
(setq org-protocol-default-template-key "L")
(setq org-capture-templates
'(("t" "Task" entry (file+headline inbox-file "Inbox")
- "* TODO %?" :prepend t)
-
- ("a" "Appointment" entry (file gcal-file)
- "* %?\n:PROPERTIES:\n:calendar-id:craigmartinjennings@gmail.com\n:END:\n:org-gcal:\n%^T--%^T\n:END:\n\n"
- :jump-to-captured t)
-
-;; trialing the use gcal appointments instead of local events
-;; ("e" "Event" entry (file+headline schedule-file "Scheduled Events")
-;; "* %?%:description
-;; SCHEDULED: %^t%(cj/org-capture-event-content)
-;; Captured On: %U"
-;; :prepend t
-;; :prepare-finalize cj/org-capture-format-event-headline)
-
- ("E" "Epub Text" entry (file+headline inbox-file "Inbox")
- "* %?
+ "* TODO %?" :prepend t)
+
+ ("a" "Appointment" entry (file gcal-file)
+ "* %?\n:PROPERTIES:\n:calendar-id:craigmartinjennings@gmail.com\n:END:\n:org-gcal:\n%^T--%^T\n:END:\n\n"
+ :jump-to-captured t)
+
+ ("e" "Event" entry (file+headline schedule-file "Scheduled Events")
+ "* %?%:description
+SCHEDULED: %^t%(cj/org-capture-event-content)
+Captured On: %U"
+ :prepend t
+ :prepare-finalize cj/org-capture-format-event-headline)
+
+ ("E" "Epub Text" entry (file+headline inbox-file "Inbox")
+ "* %?
#+BEGIN_QUOTE\n %i\n#+END_QUOTE
Source: [[%:link][%(buffer-name (org-capture-get :original-buffer))]]
Captured On: %U" :prepend t)
- ;; requires cj/org-capture-pdf-active-region function defined above
- ("P" "PDF Text" entry (file+headline inbox-file "Inbox")
- "* %?
+ ;; requires cj/org-capture-pdf-active-region function defined above
+ ("P" "PDF Text" entry (file+headline inbox-file "Inbox")
+ "* %?
#+BEGIN_QUOTE\n%(cj/org-capture-pdf-active-region)\n#+END_QUOTE
Source: [[%L][%(buffer-name (org-capture-get :original-buffer))]]
Captured On: %U" :prepend t)
- ("p" "Link with Selection" entry (file+headline inbox-file "Inbox")
- "* %?%:description
+ ("p" "Link with Selection" entry (file+headline inbox-file "Inbox")
+ "* %?%:description
#+BEGIN_QUOTE\n%i\n#+END_QUOTE
[[%:link][%:description]]
Captured On: %U\n" :prepend t :immediate-finish t)
- ("L" "Link" entry (file+headline inbox-file "Inbox")
- "* %?%:description
+ ("L" "Link" entry (file+headline inbox-file "Inbox")
+ "* %?%:description
[[%:link][%:description]]\nCaptured On: %U" :prepend t :immediate-finish t)
- ("m" "Mu4e Email" entry (file+headline inbox-file "Inbox")
- "* TODO %?
+ ("m" "Mu4e Email" entry (file+headline inbox-file "Inbox")
+ "* TODO %?
%(if (string= \"%i\" \"\") \"\" \"\n#+BEGIN_QUOTE\n%i\n#+END_QUOTE\")
[[%:link][%:description]]
Captured On: %U"
- :prepend t)
-
- ("d" "Drill Question" entry
- (file (lambda ()
- (let ((files (directory-files drill-dir nil "^[^.].*\\.org$")))
- (expand-file-name
- (completing-read "Choose file: " files)
- drill-dir))))
- "* Item :drill:\n%?\n** Answer\n%i\nSource: [[%:link][%:description]]\nCaptured On: %U" :prepend t)
-
- ("f" "Drill Question - PDF" entry
- (file (lambda ()
- (let ((files (directory-files drill-dir nil "^[^.].*\\.org$")))
- (expand-file-name
- (completing-read "Choose file: " files)
- drill-dir))))
- "* Item :drill:\n%?\n** Answer\n%(cj/org-capture-pdf-active-region)\nSource: [[%L][%(buffer-name (org-capture-get :original-buffer))]]\nCaptured On: %U" :prepend t)
-
- )) ;; end setq
+ :prepend t)
+
+ ("d" "Drill Question" entry
+ (file (lambda ()
+ (let ((files (directory-files drill-dir nil "^[^.].*\\.org$")))
+ (expand-file-name
+ (completing-read "Choose file: " files)
+ drill-dir))))
+ "* Item :drill:\n%?
+** Answer\n%i\nSource: [[%:link][%:description]
+nCaptured On: %U" :prepend t)
+
+ ("f" "Drill Question (from PDF)" entry
+ (file (lambda ()
+ (let ((files (directory-files drill-dir nil "^[^.].*\\.org$")))
+ (expand-file-name
+ (completing-read "Choose file: " files)
+ drill-dir))))
+ "* Item :drill:\n%?
+** Answer\n%(cj/org-capture-pdf-active-region)
+Source: [[%L][%(buffer-name (org-capture-get :original-buffer))]]
+Captured On: %U" :prepend t)
+
+ )) ;; end setq
) ;; end use-package org-protocol
(provide 'org-capture-config)
diff --git a/modules/org-config.el b/modules/org-config.el
index 178562f4..8fe8ed6d 100644
--- a/modules/org-config.el
+++ b/modules/org-config.el
@@ -2,60 +2,105 @@
;; author Craig Jennings <c@cjennings.net>
;;; Commentary:
-;; Setting org-modules to org-protocol, ol-eww, ol-w3m, and ol-info removes
-;; several modules that org would otherwise load automatically.
+;; note: org-archive-location is set in the :config section after org loads
;;; Code:
-;; Forward declarations
-(eval-when-compile (defvar org-dir))
-
-;; Forward declarations for org-mode variables
-(defvar org-mode-map)
-(defvar org-modules)
-(defvar org-startup-folded)
-(defvar org-cycle-open-archived-trees)
-(defvar org-outline-path-complete-in-steps)
-(defvar org-return-follows-link)
-(defvar org-list-allow-alphabetical)
-(defvar org-startup-indented)
-(defvar org-adapt-indentation)
-(defvar org-indent-indentation-per-level)
-(defvar org-startup-with-inline-images)
-(defvar org-image-actual-width)
-(defvar org-yank-image-save-method)
-(defvar org-bookmark-names-plist)
-(defvar org-file-apps)
-(defvar org-ellipsis)
-(defvar org-hide-emphasis-markers)
-(defvar org-hide-leading-stars)
-(defvar org-pretty-entities)
-(defvar org-pretty-entities-include-sub-superscripts)
-(defvar org-fontify-emphasized-text)
-(defvar org-fontify-whole-heading-line)
-(defvar org-todo-keywords)
-(defvar org-todo-keyword-faces)
-(defvar org-highest-priority)
-(defvar org-lowest-priority)
-(defvar org-default-priority)
-(defvar org-priority-faces)
-(defvar org-enforce-todo-dependencies)
-(defvar org-enforce-todo-checkbox-dependencies)
-(defvar org-deadline-warning-days)
-(defvar org-treat-insert-todo-heading-as-state-change)
-(defvar org-log-into-drawer)
-(defvar org-log-done)
-(defvar org-habit-graph-column)
-(defvar org-use-property-inheritance)
-
-;; Forward declarations for org-mode functions
-(declare-function org-eval-in-calendar "org" (form))
-(declare-function org-forward-heading-same-level "org" (arg))
-(declare-function org-backward-heading-same-level "org" (arg))
-
-;; ------------------------------- Org Constants -------------------------------
-;; note: org-archive-location is set in the :config section after org loads
+;; ---------------------------------- Org Mode ---------------------------------
+
+(use-package org
+ :defer t
+ :ensure nil ;; use the built-in package
+ :pin manual ;; never upgrade from the version built-into Emacs
+ :init
+ (defvar-keymap cj/org-table-map
+ :doc "org table operations.")
+ (keymap-global-set "C-c t" cj/org-table-map)
+ :bind
+ ("C-c c" . org-capture)
+ ("C-c a" . org-agenda)
+ (:map org-mode-map
+ ("C-c I" . org-table-field-info) ;; was C-c ?
+ ("C-\\" . org-match-sparse-tree)
+ ("C-c t" . org-set-tags-command)
+ ("C-c l" . org-store-link)
+ ("C-c C-l" . org-insert-link)
+ ("s-<up>" . org-priority-up)
+ ("s-<down>" . org-priority-down)
+ ("C-c N" . org-narrow-to-subtree)
+ ("C-c >" . cj/org-narrow-forward)
+ ("C-c <" . cj/org-narrow-backwards)
+ ("<f5>" . org-reveal)
+ ("C-c <ESC>" . widen))
+ (:map cj/org-table-map
+ ("r i" . org-table-insert-row)
+ ("r d" . org-table-kill-row)
+ ("c i" . org-table-insert-column)
+ ("c d" . org-table-delete-column))
+
+ ;; backward and forward day are ',' and '.'
+ ;; shift & meta moves by week or year
+ ;; C-. jumps to today
+ ;; original keybindings blocked by windmove keys
+ ;; these are consistent with plain-old calendar mode
+ (:map org-read-date-minibuffer-local-map
+ ("," . (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-backward-day 1))))
+ ("." . (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-forward-day 1))))
+ ("<" . (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-backward-month 1))))
+ (">" . (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-forward-month 1))))
+ ("M-," . (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-backward-year 1))))
+ ("M-." . (lambda () (interactive)
+ (org-eval-in-calendar '(calendar-forward-year 1)))))
+
+ :init
+ ;; windmove's keybindings conflict with org-agenda-todo-nextset/previousset keybindings
+ ;; solution: map the super key so that
+ ;; - super up/down increases and decreases the priority
+ ;; - super left/right changes the todo state
+ (setq org-replace-disputed-keys t)
+ (setq org-disputed-keys
+ '(([(shift left)] . [(super left)])
+ ([(shift right)] . [(super right)])
+ ([(shift up)] . [(super up)])
+ ([(shift down)] . [(super down)])
+ ([(control shift right)] . [(meta shift +)])
+ ([(control shift left)] . [(meta shift -)])))
+
+ (defun cj/org-narrow-forward ()
+ "Narrow to the next subtree at the same level."
+ (interactive)
+ (widen)
+ (org-forward-heading-same-level 1)
+ (org-narrow-to-subtree))
+
+ (defun cj/org-narrow-backwards ()
+ "Narrow to the previous subtree at the same level."
+ (interactive)
+ (widen)
+ (org-backward-heading-same-level 1)
+ (org-narrow-to-subtree))
+
+ :hook
+ (org-mode . turn-on-visual-line-mode)
+ (org-mode . (lambda () (setq-local tab-width 8)))
+
+ :config
+ ;; Load org-protocol for org-protocol:// URL handling
+ (require 'org-protocol nil t)
+
+ ;; Set archive location (must be done after org loads)
+ (setq org-archive-location
+ (concat org-dir "/archives/archive.org::datetree/"))
+
+ (cj/org-general-settings)
+ (cj/org-appearance-settings)
+ (cj/org-todo-settings))
;; ---------------------------- Org General Settings ---------------------------
@@ -68,26 +113,26 @@
;; ORG-MODULES
;; enable recognition of org-protocol:// as a parameter
- ;; add org-habits
- (setq org-modules '(org-protocol ol-eww ol-w3m ol-info org-habit))
+ (setq org-modules '(org-protocol ol-eww ol-w3m ol-info))
;; GENERAL
(setq org-startup-folded t) ;; all org files should start in the folded state
(setq org-cycle-open-archived-trees t) ;; re-enable opening headings with archive tags with TAB
- (setq org-outline-path-complete-in-steps nil)
+ (setopt org-outline-path-complete-in-steps nil)
(setq org-return-follows-link t) ;; hit return to follow an org-link
(setq org-list-allow-alphabetical t) ;; allow alpha ordered lists (i.e., a), A), a., etc.)
;; INDENTATION
(setq org-startup-indented t) ;; load org files indented
(setq org-adapt-indentation t) ;; adapt indentation to outline node level
- (setq org-indent-indentation-per-level 2) ;; indent two character-widths per level
- (setq tab-width 8) ;; org-mode complains when tabs aren't @ 8
+
+ ;; TASK: this variable doesn't exist. Remove
+ ;; (setq org-indent-indentation-per-level 2) ;; indent two character-widths per level
;; IMAGES / MEDIA
(setq org-startup-with-inline-images t) ;; preview images by default
(setq org-image-actual-width '(500)) ;; keep image sizes in check
- (setq org-yank-image-save-method 'attach) ;; attach images; save to data directory
+ (setq org-yank-image-save-method 'attach) ;; attach images; save to data directory
(setq org-bookmark-names-plist nil) ;; don't set org-capture bookmarks
@@ -134,29 +179,29 @@
;; logging task creation, task start, and task resolved states
(setq org-todo-keywords '((sequence "TODO(t)" "PROJECT(p)" "DOING(i)"
- "WAITING(w)" "VERIFY(v)" "STALLED(s)"
- "DELEGATED(x)" "|"
- "FAILED(f!)" "DONE(d!)" "CANCELLED(c!)")))
+ "WAITING(w)" "VERIFY(v)" "STALLED(s)"
+ "DELEGATED(x)" "|"
+ "FAILED(f!)" "DONE(d!)" "CANCELLED(c!)")))
(setq org-todo-keyword-faces
- '(("TODO" . "green")
- ("PROJECT" . "blue")
- ("DOING" . "yellow")
- ("WAITING" . "white")
- ("VERIFY" . "orange")
- ("STALLED" . "light blue")
- ("DELEGATED" . "green")
- ("FAILED" . "red")
- ("DONE" . "dark grey")
- ("CANCELLED" . "dark grey")))
+ '(("TODO" . "green")
+ ("PROJECT" . "blue")
+ ("DOING" . "yellow")
+ ("WAITING" . "white")
+ ("VERIFY" . "orange")
+ ("STALLED" . "light blue")
+ ("DELEGATED" . "green")
+ ("FAILED" . "red")
+ ("DONE" . "dark grey")
+ ("CANCELLED" . "dark grey")))
(setq org-highest-priority ?A)
(setq org-lowest-priority ?D)
(setq org-default-priority ?D)
(setq org-priority-faces '((?A . (:foreground "Cyan" :weight bold))
- (?B . (:foreground "Yellow"))
- (?C . (:foreground "Green"))
- (?D . (:foreground "Grey"))))
+ (?B . (:foreground "Yellow"))
+ (?C . (:foreground "Green"))
+ (?D . (:foreground "Grey"))))
(setq org-enforce-todo-dependencies t)
(setq org-enforce-todo-checkbox-dependencies t)
@@ -164,115 +209,12 @@
(setq org-treat-insert-todo-heading-as-state-change nil) ;; log task creation
(setq org-log-into-drawer nil) ;; don't log into drawer
(setq org-log-done nil) ;; don't log completions
- (setq org-habit-graph-column 75) ;; allow space for task name
;; inherit parents properties (sadly not schedules or deadlines)
(setq org-use-property-inheritance t))
-;; ---------------------------------- Org Mode ---------------------------------
-
-;; Create org-table-map prefix command
-(defvar org-table-map (make-sparse-keymap)
- "Keymap for org-table operations.")
-
-;;;###autoload (keymap-global-set "C-c T" org-table-map)
-
-(use-package org
- :defer t
- :ensure nil ;; use the built-in package
- :pin manual ;; never upgrade from the version built-into Emacs
- :bind
- ("C-c c" . org-capture)
- ("C-c a" . org-agenda)
- (:map org-mode-map
- ("C-c I" . org-table-field-info) ;; was C-c ?
- ("C-\\" . org-match-sparse-tree)
- ("C-c t" . org-set-tags-command)
- ("C-c l" . org-store-link)
- ("C-c C-l" . org-insert-link)
- ("s-<up>" . org-priority-up)
- ("s-<down>" . org-priority-down)
- ("C-c N" . org-narrow-to-subtree)
- ("C-c >" . cj/org-narrow-forward)
- ("C-c <" . cj/org-narrow-backwards)
- ("<f5>" . org-reveal)
- ("C-c <ESC>" . widen))
- (:map org-table-map
- ("r i" . org-table-insert-row)
- ("r d" . org-table-kill-row)
- ("c i" . org-table-insert-column)
- ("c d" . org-table-delete-column))
-
- ;; backward and forward day are ',' and '.'
- ;; shift & meta moves by week or year
- ;; C-. jumps to today
- ;; original keybindings blocked by windmove keys
- ;; these are consistent with plain-old calendar mode
- (:map org-read-date-minibuffer-local-map
- ("," . (lambda () (interactive)
- (org-eval-in-calendar '(calendar-backward-day 1))))
- ("." . (lambda () (interactive)
- (org-eval-in-calendar '(calendar-forward-day 1))))
- ("<" . (lambda () (interactive)
- (org-eval-in-calendar '(calendar-backward-month 1))))
- (">" . (lambda () (interactive)
- (org-eval-in-calendar '(calendar-forward-month 1))))
- ("M-," . (lambda () (interactive)
- (org-eval-in-calendar '(calendar-backward-year 1))))
- ("M-." . (lambda () (interactive)
- (org-eval-in-calendar '(calendar-forward-year 1)))))
-
- :init
- ;; windmove's keybindings conflict with org-agenda-todo-nextset/previousset keybindings
- ;; solution: map the super key so that
- ;; - super up/down increases and decreases the priority
- ;; - super left/right changes the todo state
- (setq org-replace-disputed-keys t)
- (setq org-disputed-keys
- '(([(shift left)] . [(super left)])
- ([(shift right)] . [(super right)])
- ([(shift up)] . [(super up)])
- ([(shift down)] . [(super down)])
- ([(control shift right)] . [(meta shift +)])
- ([(control shift left)] . [(meta shift -)])))
-
- (defun cj/org-narrow-forward ()
- "Narrow to the next subtree at the same level."
- (interactive)
- (widen)
- (org-forward-heading-same-level 1)
- (org-narrow-to-subtree))
-
- (defun cj/org-narrow-backwards ()
- "Narrow to the previous subtree at the same level."
- (interactive)
- (widen)
- (org-backward-heading-same-level 1)
- (org-narrow-to-subtree))
-
- :hook
- (org-mode . turn-on-visual-line-mode)
-
- :config
- ;; Load org-protocol for org-protocol:// URL handling
- (require 'org-protocol nil t)
-
- ;; Set archive location (must be done after org loads)
- (setq org-archive-location
- (concat org-dir "/archives/archive.org::datetree/"))
-
- (cj/org-general-settings)
- (cj/org-appearance-settings)
- (cj/org-todo-settings))
-
-
;; ------------------------------- Org Superstar -------------------------------
-;; Forward declarations
-(defvar org-superstar-leading-bullet)
-(declare-function org-superstar-configure-like-org-bullets "org-superstar")
-
-;; nicer bullets than simple asterisks.
(use-package org-superstar
:after org
:hook (org-mode . org-superstar-mode)
@@ -281,27 +223,22 @@
(setq org-superstar-leading-bullet ?\s))
;; ------------------------------- Org-Checklist -------------------------------
+
;; needed for org-habits to reset checklists once task is complete
;; this was a part of org-contrib which was deprecated
-
(use-package org-checklist
:ensure nil ;; in custom folder
- :after org
- :load-path "custom")
+ :load-path "custom"
+ :after org)
;; -------------------------- Org Link To Current File -------------------------
-;; get a link to the file the current buffer is associated with.
-;;;###autoload
(defun cj/org-link-to-current-buffer-file ()
"Create an Org mode link to the current file and copy it to the clipboard.
-
-The link is formatted as [[file:<file-path>][<file-name>]],
-where <file-path> is the full path to the current file and <file-name>
-is the name of the current file without any directory information.
-
-If the current buffer is not associated with a file, the function will throw an
-error."
+The link is formatted as [[file:<file-path>][<file-name>]], where <file-path>
+is the full path to the current file and <file-name> is the name of the current
+ file without any directory information. If the current buffer is not associated
+with a file, the function will throw an error."
(interactive)
(if (buffer-file-name)
(let* ((filename (buffer-file-name))
diff --git a/modules/org-drill-config.el b/modules/org-drill-config.el
index dff132e2..a3a9a3f8 100644
--- a/modules/org-drill-config.el
+++ b/modules/org-drill-config.el
@@ -16,17 +16,6 @@
;;; Code:
-(eval-when-compile (defvar drill-dir))
-(eval-when-compile (defvar cj/custom-keymap))
-
-(defvar cj/drill-map)
-(declare-function org-drill-resume "org-drill")
-(declare-function cj/drill-map "org-drill-config")
-(declare-function cj/drill-start "org-drill-config")
-(declare-function cj/drill-edit "org-drill-config")
-(declare-function cj/drill-capture "org-drill-config")
-(declare-function cj/drill-refile "org-drill-config")
-
;; --------------------------------- Org Drill ---------------------------------
(use-package org-drill
diff --git a/modules/org-noter-config.el b/modules/org-noter-config.el
index a5e1f7fc..253ed892 100644
--- a/modules/org-noter-config.el
+++ b/modules/org-noter-config.el
@@ -1,10 +1,14 @@
;;; org-noter-config.el --- -*- coding: utf-8; lexical-binding: t; -*-
;;; Commentary:
-;; Open a PDF or DjVu file, hit F6, and org-noter splits the frame with notes beside the document.
-;; Notes live under ~/sync/org-noter/reading-notes.org by default; adjust the path when prompted the first time.
-;; Use org-noter capture keys while annotating—`C-c n c` checks linked documents, and `C-c n u` rewrites stale paths after moving files.
-;; Sessions resume where you stopped thanks to automatic location saves.
+;; Org-noter configuration for taking notes on PDF and DjVu documents. Workflow:
+;; open a PDF/DjVu file in Emacs, press F6 to start org-noter session, frame
+;; splits with document on one side and notes on the other, notes are saved to
+;; ~/sync/org-noter/reading-notes.org by default, and position is automatically
+;; saved when closing session. Features include integration with pdf-tools and
+;; djvu, org-roam integration for linking notes, automatic session resumption at
+;; last position, inserting highlighted text into notes, notes following
+;; TASK: Aborted Commentary
;;; Code:
@@ -24,7 +28,6 @@
(use-package org-noter
:after (:any org pdf-tools djvu)
:commands org-noter
- :bind ("<f6>" . org-noter)
:config
;; Basic settings
(setq org-noter-always-create-frame nil)
diff --git a/modules/org-roam-config.el b/modules/org-roam-config.el
index feecebd2..c497fd4b 100644
--- a/modules/org-roam-config.el
+++ b/modules/org-roam-config.el
@@ -11,10 +11,10 @@
;; ---------------------------------- Org Roam ---------------------------------
(use-package org-roam
- :after org
- :defer 1
- :commands (org-roam-node-find org-roam-node-insert)
- :hook (after-init . org-roam-db-autosync-mode)
+ :commands (org-roam-node-find org-roam-node-insert org-roam-db-autosync-mode)
+ :config
+ ;; Enable autosync mode after org-roam loads
+ (org-roam-db-autosync-mode)
:custom
(org-roam-directory roam-dir)
(org-roam-dailies-directory journals-dir)
@@ -90,7 +90,7 @@ the arguments that org-roam-node-insert expects."
(org-roam-capture-templates (list (append (car org-roam-capture-templates)
'(:immediate-finish t)))))
(apply #'org-roam-node-insert args)))
-(global-set-key (kbd "C-c n I") 'cj/org-roam-node-insert-immediate)
+(keymap-global-set "C-c n I" #'cj/org-roam-node-insert-immediate)
;; ------------------------- Tag Listing And Filtering -------------------------