mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(internal): remove file-name and header default (#1143)
This commit is contained in:
@ -49,12 +49,6 @@
|
|||||||
(declare-function org-roam-mode "org-roam")
|
(declare-function org-roam-mode "org-roam")
|
||||||
(declare-function org-roam-completion--completing-read "org-roam-completion")
|
(declare-function org-roam-completion--completing-read "org-roam-completion")
|
||||||
|
|
||||||
(defvar org-roam-capture--file-name-default "%<%Y%m%d%H%M%S>"
|
|
||||||
"The default file name format for Org-roam templates.")
|
|
||||||
|
|
||||||
(defvar org-roam-capture--header-default "#+title: ${title}\n"
|
|
||||||
"The default capture header for Org-roam templates.")
|
|
||||||
|
|
||||||
(defvar org-roam-capture--file-path nil
|
(defvar org-roam-capture--file-path nil
|
||||||
"The file path for the Org-roam capture.
|
"The file path for the Org-roam capture.
|
||||||
This variable is set during the Org-roam capture process.")
|
This variable is set during the Org-roam capture process.")
|
||||||
@ -414,13 +408,11 @@ aborted, we do the following:
|
|||||||
3. Add a function on `org-capture-before-finalize-hook' that saves
|
3. Add a function on `org-capture-before-finalize-hook' that saves
|
||||||
the file if the original value of :no-save is not t and
|
the file if the original value of :no-save is not t and
|
||||||
`org-note-abort' is not t."
|
`org-note-abort' is not t."
|
||||||
(let* ((name-templ (or (org-roam-capture--get :file-name)
|
(let* ((name-templ (org-roam-capture--get :file-name))
|
||||||
org-roam-capture--file-name-default))
|
|
||||||
(new-id (s-trim (org-roam-capture--fill-template
|
(new-id (s-trim (org-roam-capture--fill-template
|
||||||
name-templ)))
|
name-templ)))
|
||||||
(file-path (org-roam--file-path-from-id new-id))
|
(file-path (org-roam--file-path-from-id new-id))
|
||||||
(roam-head (or (org-roam-capture--get :head)
|
(roam-head (org-roam-capture--get :head))
|
||||||
org-roam-capture--header-default))
|
|
||||||
(org-template (org-capture-get :template))
|
(org-template (org-capture-get :template))
|
||||||
(roam-template (concat roam-head org-template)))
|
(roam-template (concat roam-head org-template)))
|
||||||
(unless (file-exists-p file-path)
|
(unless (file-exists-p file-path)
|
||||||
@ -494,6 +486,9 @@ This function is used solely in Org-roam's capture templates: see
|
|||||||
(let* ((key (pop rest))
|
(let* ((key (pop rest))
|
||||||
(val (pop rest))
|
(val (pop rest))
|
||||||
(custom (member key org-roam-capture--template-keywords)))
|
(custom (member key org-roam-capture--template-keywords)))
|
||||||
|
(when (and custom
|
||||||
|
(not val))
|
||||||
|
(user-error "Invalid capture template format: %s\nkey %s cannot be nil" template key))
|
||||||
(push val (if custom org-roam-plist options))
|
(push val (if custom org-roam-plist options))
|
||||||
(push key (if custom org-roam-plist options))))
|
(push key (if custom org-roam-plist options))))
|
||||||
(append converted options `(:org-roam ,org-roam-plist))))
|
(append converted options `(:org-roam ,org-roam-plist))))
|
||||||
|
Reference in New Issue
Block a user