diff --git a/CHANGELOG.md b/CHANGELOG.md index 54924eb..539ee02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - [#2042](https://github.com/org-roam/org-roam/pull/2042) db: add `org-roam-db-extra-links-elements` and `org-roam-db-extra-links-exclude-keys` for fine-grained control over additional link parsing - [#2049](https://github.com/org-roam/org-roam/pull/2049) capture: allow ID to be used as part of `org-roam-capture-templates` - [#2050](https://github.com/org-roam/org-roam/pull/2050) core: add `FILTER-FN` to `org-roam-node-random` +- [#2065](https://github.com/org-roam/org-roam/pull/2065) dailies: add `keys` argument to the remaining dailies functions `org-roam-dailies-goto-yesterday`/`-today`/`-tomorrow`/`-date` and `org-roam-dailies-capture-yesterday`/`-tomorrow`/`-date` to give the abilty to get into a capture buffer bypassing the selection screen in all dailies commands. Extension of #2055 ### Removed ### Fixed - [#2055](https://github.com/org-roam/org-roam/pull/2055) dailies: removed stray f require, which was causing require and compilation errors diff --git a/extensions/org-roam-dailies.el b/extensions/org-roam-dailies.el index ab22ad5..e55dc13 100644 --- a/extensions/org-roam-dailies.el +++ b/extensions/org-roam-dailies.el @@ -139,72 +139,93 @@ In this case, interactive selection will be bypassed." (org-roam-dailies--capture (current-time) goto keys)) ;;;###autoload -(defun org-roam-dailies-goto-today () - "Find the daily-note for today, creating it if necessary." +(defun org-roam-dailies-goto-today (&optional keys) + "Find the daily-note for today, creating it if necessary. + +ELisp programs can set KEYS to a string associated with a template. +In this case, interactive selection will be bypassed." (interactive) - (org-roam-dailies-capture-today t)) + (org-roam-dailies-capture-today t keys)) ;;;; Tomorrow ;;;###autoload -(defun org-roam-dailies-capture-tomorrow (n &optional goto) +(defun org-roam-dailies-capture-tomorrow (n &optional goto keys) "Create an entry in the daily-note for tomorrow. With numeric argument N, use the daily-note N days in the future. With a `C-u' prefix or when GOTO is non-nil, go the note without -creating an entry." +creating an entry. + +ELisp programs can set KEYS to a string associated with a template. +In this case, interactive selection will be bypassed." (interactive "p") - (org-roam-dailies--capture (time-add (* n 86400) (current-time)) goto)) + (org-roam-dailies--capture (time-add (* n 86400) (current-time)) goto keys)) ;;;###autoload -(defun org-roam-dailies-goto-tomorrow (n) +(defun org-roam-dailies-goto-tomorrow (n &optional keys) "Find the daily-note for tomorrow, creating it if necessary. With numeric argument N, use the daily-note N days in the -future." +future. + +ELisp programs can set KEYS to a string associated with a template. +In this case, interactive selection will be bypassed." (interactive "p") - (org-roam-dailies-capture-tomorrow n t)) + (org-roam-dailies-capture-tomorrow n t keys)) ;;;; Yesterday ;;;###autoload -(defun org-roam-dailies-capture-yesterday (n &optional goto) +(defun org-roam-dailies-capture-yesterday (n &optional goto keys) "Create an entry in the daily-note for yesteday. With numeric argument N, use the daily-note N days in the past. -When GOTO is non-nil, go the note without creating an entry." +When GOTO is non-nil, go the note without creating an entry. + +ELisp programs can set KEYS to a string associated with a template. +In this case, interactive selection will be bypassed." (interactive "p") - (org-roam-dailies-capture-tomorrow (- n) goto)) + (org-roam-dailies-capture-tomorrow (- n) goto keys)) ;;;###autoload -(defun org-roam-dailies-goto-yesterday (n) +(defun org-roam-dailies-goto-yesterday (n &optional keys) "Find the daily-note for yesterday, creating it if necessary. With numeric argument N, use the daily-note N days in the -future." +future. + +ELisp programs can set KEYS to a string associated with a template. +In this case, interactive selection will be bypassed." (interactive "p") - (org-roam-dailies-capture-tomorrow (- n) t)) + (org-roam-dailies-capture-tomorrow (- n) t keys)) ;;;; Date ;;;###autoload -(defun org-roam-dailies-capture-date (&optional goto prefer-future) +(defun org-roam-dailies-capture-date (&optional goto prefer-future keys) "Create an entry in the daily-note for a date using the calendar. Prefer past dates, unless PREFER-FUTURE is non-nil. With a `C-u' prefix or when GOTO is non-nil, go the note without -creating an entry." +creating an entry. + +ELisp programs can set KEYS to a string associated with a template. +In this case, interactive selection will be bypassed." (interactive "P") (let ((time (let ((org-read-date-prefer-future prefer-future)) (org-read-date nil t nil (if goto "Find daily-note: " "Capture to daily-note: "))))) - (org-roam-dailies--capture time goto))) + (org-roam-dailies--capture time goto keys))) ;;;###autoload -(defun org-roam-dailies-goto-date (&optional prefer-future) +(defun org-roam-dailies-goto-date (&optional prefer-future keys) "Find the daily-note for a date using the calendar, creating it if necessary. -Prefer past dates, unless PREFER-FUTURE is non-nil." +Prefer past dates, unless PREFER-FUTURE is non-nil. + +ELisp programs can set KEYS to a string associated with a template. +In this case, interactive selection will be bypassed." (interactive) - (org-roam-dailies-capture-date t prefer-future)) + (org-roam-dailies-capture-date t prefer-future keys)) ;;;; Navigation (defun org-roam-dailies-goto-next-note (&optional n)