|
|
|
|
@ -349,7 +349,7 @@ If PREFIX, downcase the title before insertion." |
|
|
|
|
(setq org-roam-capture-additional-template-props (list :region region |
|
|
|
|
:link-description link-description |
|
|
|
|
:capture-fn 'org-roam-insert)) |
|
|
|
|
(org-roam-capture)))))) |
|
|
|
|
(org-roam--capture)))))) |
|
|
|
|
|
|
|
|
|
;;;; org-roam-find-file |
|
|
|
|
(defun org-roam--get-title-path-completions () |
|
|
|
|
@ -382,7 +382,7 @@ INITIAL-PROMPT is the initial title prompt." |
|
|
|
|
(cons 'slug (org-roam--title-to-slug title)))) |
|
|
|
|
(org-roam-capture--context 'title)) |
|
|
|
|
(add-hook 'org-capture-after-finalize-hook #'org-roam-capture--find-file-h) |
|
|
|
|
(org-roam-capture)))))) |
|
|
|
|
(org-roam--capture)))))) |
|
|
|
|
|
|
|
|
|
;;;; org-roam-find-ref |
|
|
|
|
(defun org-roam--get-ref-path-completions () |
|
|
|
|
@ -427,6 +427,23 @@ INFO is an alist containing additional information." |
|
|
|
|
:require-match t))) |
|
|
|
|
(switch-to-buffer (cdr (assoc name names-and-buffers)))))) |
|
|
|
|
|
|
|
|
|
;;;; org-roam-capture |
|
|
|
|
(defun org-roam-capture () |
|
|
|
|
"Launches an org-capture process for a new or existing note. |
|
|
|
|
This uses the templates defined at `org-roam-capture-templates'." |
|
|
|
|
(interactive) |
|
|
|
|
(when org-roam-capture--in-process |
|
|
|
|
(user-error "Nested Org-roam capture processes not supported")) |
|
|
|
|
(let* ((completions (org-roam--get-title-path-completions)) |
|
|
|
|
(title (org-roam-completion--completing-read "File: " completions)) |
|
|
|
|
(file-path (cdr (assoc title completions)))) |
|
|
|
|
(let ((org-roam-capture--info (list (cons 'title title) |
|
|
|
|
(cons 'slug (org-roam--title-to-slug title)) |
|
|
|
|
(cons 'file file-path))) |
|
|
|
|
(org-roam-capture--context 'capture)) |
|
|
|
|
(setq org-roam-capture-additional-template-props (list :capture-fn 'org-roam-capture)) |
|
|
|
|
(org-roam--capture)))) |
|
|
|
|
|
|
|
|
|
;;;; Daily notes |
|
|
|
|
(defcustom org-roam-date-title-format "%Y-%m-%d" |
|
|
|
|
"Format string passed to `format-time-string' for getting a date file's title." |
|
|
|
|
@ -463,7 +480,7 @@ INFO is an alist containing additional information." |
|
|
|
|
(org-roam-capture--info (list (cons 'title title) |
|
|
|
|
(cons 'filename filename)))) |
|
|
|
|
(add-hook 'org-capture-after-finalize-hook #'org-roam-capture--find-file-h) |
|
|
|
|
(org-roam-capture))))) |
|
|
|
|
(org-roam--capture))))) |
|
|
|
|
|
|
|
|
|
(defun org-roam-today () |
|
|
|
|
"Create and find file for today." |
|
|
|
|
|