mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(fix): autoloaded commands load org-roam-mode (#712)
Users should not have to explicitly enable the minor mode before using autoloaded commands.
This commit is contained in:
@ -45,7 +45,9 @@
|
||||
"Capture templates for daily notes in Org-roam.")
|
||||
|
||||
;; Declarations
|
||||
(defvar org-roam-mode)
|
||||
(declare-function org-roam--file-path-from-id "org-roam")
|
||||
(declare-function org-roam-mode "org-roam")
|
||||
|
||||
(defun org-roam-dailies--file-for-time (time)
|
||||
"Create and find file for TIME."
|
||||
@ -59,18 +61,21 @@
|
||||
(defun org-roam-dailies-today ()
|
||||
"Create and find the daily note for today."
|
||||
(interactive)
|
||||
(unless org-roam-mode (org-roam-mode))
|
||||
(org-roam-dailies--file-for-time (current-time)))
|
||||
|
||||
(defun org-roam-dailies-tomorrow (n)
|
||||
"Create and find the daily note for tomorrow.
|
||||
With numeric argument N, use N days in the future."
|
||||
(interactive "p")
|
||||
(unless org-roam-mode (org-roam-mode))
|
||||
(org-roam-dailies--file-for-time (time-add (* n 86400) (current-time))))
|
||||
|
||||
(defun org-roam-dailies-yesterday (n)
|
||||
"Create and find the file for yesterday.
|
||||
With numeric argument N, use N days in the past."
|
||||
(interactive "p")
|
||||
(unless org-roam-mode (org-roam-mode))
|
||||
(org-roam-dailies-tomorrow (- n)))
|
||||
|
||||
(defun org-roam-dailies-date ()
|
||||
|
Reference in New Issue
Block a user