Skip to content

Commit

Permalink
(feat): add org-capture interactive options to org-roam-capture (org-…
Browse files Browse the repository at this point in the history
  • Loading branch information
lld2001 authored Aug 16, 2020
1 parent 9ee591f commit 30b2e97
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions org-roam-capture.el
Original file line number Diff line number Diff line change
Expand Up @@ -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: "
Expand All @@ -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)))))))

Expand Down

0 comments on commit 30b2e97

Please sign in to comment.