mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
default title to file-relative-name for file-nodes if title is empty
This commit is contained in:
@ -278,8 +278,9 @@ first encapsulating ID."
|
||||
(org-with-point-at 1
|
||||
(when-let ((id (org-id-get)))
|
||||
(let ((file (buffer-file-name (buffer-base-buffer)))
|
||||
(title (cadr (assoc "TITLE" (org-collect-keywords '("title"))
|
||||
#'string-equal)))
|
||||
(title (or (cadr (assoc "TITLE" (org-collect-keywords '("title"))
|
||||
#'string-equal))
|
||||
(file-relative-name file org-roam-directory)))
|
||||
(pos (point))
|
||||
(todo nil)
|
||||
(priority nil)
|
||||
|
@ -158,13 +158,12 @@ is the `org-roam-node'."
|
||||
:left-join nodes
|
||||
:on (= aliases:node-id nodes:id)]))
|
||||
collect (pcase-let* ((`(,file ,pos ,alias ,title ,id) row)
|
||||
(fname (file-name-nondirectory file))
|
||||
(node (org-roam-node-create :id id
|
||||
:file file
|
||||
:title (or title fname)
|
||||
:title title
|
||||
:point pos
|
||||
:tags (gethash id tags-table))))
|
||||
(cons (propertize (or alias fname) 'node node) node)))))
|
||||
(cons (propertize alias 'node node) node)))))
|
||||
|
||||
(defun org-roam-node-read (&optional initial-input filter-fn require-match)
|
||||
"Read and return an `org-roam-node'.
|
||||
|
Reference in New Issue
Block a user