(feat): support file-level IDs (#1163)

Additionally cache IDs at outline-level 0, now that property drawers are supported in Org 9.4.

Update org-roam--format-link to prefer ID links wherever possible. That is, when a file has an ID, use an id link instead of file link.
This commit is contained in:
Jethro Kuan
2020-10-05 16:57:54 +08:00
committed by GitHub
parent 6759bee56b
commit d973e8f6e0
7 changed files with 89 additions and 95 deletions

View File

@ -45,7 +45,7 @@
(declare-function org-roam--get-ref-path-completions "org-roam")
(declare-function org-roam--file-path-from-id "org-roam")
(declare-function org-roam--find-file "org-roam")
(declare-function org-roam--format-link "org-roam")
(declare-function org-roam-format-link "org-roam")
(declare-function org-roam-mode "org-roam")
(declare-function org-roam-completion--completing-read "org-roam-completion")
@ -337,9 +337,9 @@ the capture)."
(type (org-roam-capture--get :link-type))
(desc (org-roam-capture--get :link-description)))
(if (eq (point) (marker-position mkr))
(insert (org-roam--format-link path desc type))
(insert (org-roam-format-link path desc type))
(org-with-point-at mkr
(insert (org-roam--format-link path desc type))))))))))
(insert (org-roam-format-link path desc type))))))))))
(when region
(set-marker beg nil)
(set-marker end nil))