diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aae1c8..240b8ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Features - [#1183](https://github.com/org-roam/org-roam/pull/1183) add interactive functions for managing aliases and tags in Org-roam file, namely `org-roam-alias-add`, `org-roam-alias-delete`, `org-roam-tag-add`, and `org-roam-tag-delete`. +- [#1238](https://github.com/org-roam/org-roam/pull/1238) add `org-roam-prefer-id-links` variable to select linking method ### Bugfixes diff --git a/org-roam.el b/org-roam.el index bb62be3..73aa1ba 100644 --- a/org-roam.el +++ b/org-roam.el @@ -147,6 +147,11 @@ Formatter may be a function that takes title as its only argument." (function :tag "Custom function")) :group 'org-roam) +(defcustom org-roam-prefer-id-links t + "If non-nil, use ID for linking instead where available." + :type 'boolean + :group 'org-roam) + (defcustom org-roam-list-files-commands (if (member system-type '(windows-nt ms-dos cygwin)) nil @@ -806,7 +811,8 @@ backlinks." TYPE defaults to \"file\". Here, we also check if there is an ID for the file." (setq type (or type "file")) - (when-let ((id (and (string-equal type "file") + (when-let ((id (and org-roam-prefer-id-links + (string-equal type "file") (caar (org-roam-db-query [:select [id] :from ids :where (= file $s1) :and (= level 0)