(feat): add org-capture interactive options to org-roam-capture (#1035)

This commit is contained in:
lld2001 2020-08-16 06:51:37 -05:00 committed by GitHub
parent 9ee591f7a4
commit 30b2e97426
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -526,10 +526,11 @@ GOTO and KEYS argument have the same functionality as
(funcall-interactively org-roam-capture-function))))
;;;###autoload
(defun org-roam-capture ()
(defun org-roam-capture (&optional goto keys)
"Launches an `org-capture' process for a new or existing note.
This uses the templates defined at `org-roam-capture-templates'."
(interactive)
This uses the templates defined at `org-roam-capture-templates'.
Arguments GOTO and KEYS see `org-capture'."
(interactive "P")
(unless org-roam-mode (org-roam-mode))
(let* ((completions (org-roam--get-title-path-completions))
(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)))
(org-roam-capture--context 'capture))
(condition-case err
(org-roam-capture--capture)
(org-roam-capture--capture goto keys)
(error (user-error "%s. Please adjust `org-roam-capture-templates'"
(error-message-string err)))))))