(feat): add org-capture interactive options to org-roam-capture (#1035)
This commit is contained in:
parent
9ee591f7a4
commit
30b2e97426
1 changed files with 5 additions and 4 deletions
|
@ -526,10 +526,11 @@ GOTO and KEYS argument have the same functionality as
|
||||||
(funcall-interactively org-roam-capture-function))))
|
(funcall-interactively org-roam-capture-function))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun org-roam-capture ()
|
(defun org-roam-capture (&optional goto keys)
|
||||||
"Launches an `org-capture' process for a new or existing note.
|
"Launches an `org-capture' process for a new or existing note.
|
||||||
This uses the templates defined at `org-roam-capture-templates'."
|
This uses the templates defined at `org-roam-capture-templates'.
|
||||||
(interactive)
|
Arguments GOTO and KEYS see `org-capture'."
|
||||||
|
(interactive "P")
|
||||||
(unless org-roam-mode (org-roam-mode))
|
(unless org-roam-mode (org-roam-mode))
|
||||||
(let* ((completions (org-roam--get-title-path-completions))
|
(let* ((completions (org-roam--get-title-path-completions))
|
||||||
(title-with-keys (org-roam-completion--completing-read "File: "
|
(title-with-keys (org-roam-completion--completing-read "File: "
|
||||||
|
@ -542,7 +543,7 @@ This uses the templates defined at `org-roam-capture-templates'."
|
||||||
(cons 'file file-path)))
|
(cons 'file file-path)))
|
||||||
(org-roam-capture--context 'capture))
|
(org-roam-capture--context 'capture))
|
||||||
(condition-case err
|
(condition-case err
|
||||||
(org-roam-capture--capture)
|
(org-roam-capture--capture goto keys)
|
||||||
(error (user-error "%s. Please adjust `org-roam-capture-templates'"
|
(error (user-error "%s. Please adjust `org-roam-capture-templates'"
|
||||||
(error-message-string err)))))))
|
(error-message-string err)))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue