mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
fix(db): Org-roam does not store Org-ID w/ search option
add `:search-option` property to the `link` table when present. Fix: #2495 Close: #2496
This commit is contained in:
committed by
Dustin Farris
parent
f3db974bcc
commit
7dc76b708b
@ -563,12 +563,18 @@ INFO is the org-element parsed buffer."
|
|||||||
"Insert link data for LINK at current point into the Org-roam cache."
|
"Insert link data for LINK at current point into the Org-roam cache."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (org-element-property :begin link))
|
(goto-char (org-element-property :begin link))
|
||||||
(let ((type (org-element-property :type link))
|
(let* ((type (org-element-property :type link))
|
||||||
(path (org-element-property :path link))
|
(path (org-element-property :path link))
|
||||||
|
(option (and (string-match "::\\(.*\\)\\'" path)
|
||||||
|
(match-string 1 path)))
|
||||||
|
(path (if (not option) path
|
||||||
|
(substring path 0 (match-beginning 0))))
|
||||||
(source (org-roam-id-at-point))
|
(source (org-roam-id-at-point))
|
||||||
(properties (list :outline (ignore-errors
|
(properties (list :outline (ignore-errors
|
||||||
;; This can error if link is not under any headline
|
;; This can error if link is not under any headline
|
||||||
(org-get-outline-path 'with-self 'use-cache)))))
|
(org-get-outline-path 'with-self 'use-cache))))
|
||||||
|
(properties (if option (plist-put properties :search-option option)
|
||||||
|
properties)))
|
||||||
;; For Org-ref links, we need to split the path into the cite keys
|
;; For Org-ref links, we need to split the path into the cite keys
|
||||||
(when (and source path)
|
(when (and source path)
|
||||||
(if (and (boundp 'org-ref-cite-types)
|
(if (and (boundp 'org-ref-cite-types)
|
||||||
|
Reference in New Issue
Block a user