(feat): add org-roam-enable-headline-linking (#1030)
When disabled, Org-roam will not attempt to cache headlines, and will not create IDs. Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
This commit is contained in:
parent
11aac39a1b
commit
2081e1268a
2 changed files with 14 additions and 5 deletions
|
@ -39,6 +39,7 @@
|
||||||
(require 'org-roam-macs)
|
(require 'org-roam-macs)
|
||||||
|
|
||||||
(defvar org-roam-directory)
|
(defvar org-roam-directory)
|
||||||
|
(defvar org-roam-enable-headline-linking)
|
||||||
(defvar org-roam-verbose)
|
(defvar org-roam-verbose)
|
||||||
(defvar org-roam-file-name)
|
(defvar org-roam-file-name)
|
||||||
|
|
||||||
|
@ -472,7 +473,8 @@ connections, nil is returned."
|
||||||
(org-roam-db--update-tags)
|
(org-roam-db--update-tags)
|
||||||
(org-roam-db--update-titles)
|
(org-roam-db--update-titles)
|
||||||
(org-roam-db--update-refs)
|
(org-roam-db--update-refs)
|
||||||
(org-roam-db--update-headlines)
|
(when org-roam-enable-headline-linking
|
||||||
|
(org-roam-db--update-headlines))
|
||||||
(org-roam-db--update-links)))
|
(org-roam-db--update-links)))
|
||||||
(org-roam-buffer--update-maybe :redisplay t)))))
|
(org-roam-buffer--update-maybe :redisplay t)))))
|
||||||
|
|
||||||
|
@ -511,9 +513,10 @@ If FORCE, force a rebuild of the cache from scratch."
|
||||||
:values $v1]
|
:values $v1]
|
||||||
(vector file contents-hash (list :atime atime :mtime mtime)))
|
(vector file contents-hash (list :atime atime :mtime mtime)))
|
||||||
(setq file-count (1+ file-count))
|
(setq file-count (1+ file-count))
|
||||||
(when-let ((headlines (org-roam--extract-headlines file)))
|
(when org-roam-enable-headline-linking
|
||||||
(when (org-roam-db--insert-headlines headlines)
|
(when-let ((headlines (org-roam--extract-headlines file)))
|
||||||
(setq headline-count (1+ headline-count)))))
|
(when (org-roam-db--insert-headlines headlines)
|
||||||
|
(setq headline-count (1+ headline-count))))))
|
||||||
(file-error
|
(file-error
|
||||||
(setq org-roam-files (remove file org-roam-files))
|
(setq org-roam-files (remove file org-roam-files))
|
||||||
(org-roam-db--clear-file file)
|
(org-roam-db--clear-file file)
|
||||||
|
|
|
@ -244,6 +244,11 @@ space-delimited strings.
|
||||||
(symbol)))
|
(symbol)))
|
||||||
:group 'org-roam)
|
:group 'org-roam)
|
||||||
|
|
||||||
|
(defcustom org-roam-enable-headline-linking t
|
||||||
|
"Enable linking to headlines, which includes automatic :ID: creation and scanning of :ID:s for org-roam database."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'org-roam)
|
||||||
|
|
||||||
(defcustom org-roam-verbose t
|
(defcustom org-roam-verbose t
|
||||||
"Echo messages that are not errors."
|
"Echo messages that are not errors."
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
|
@ -1589,7 +1594,8 @@ M-x info for more information at Org-roam > Installation > Post-Installation Tas
|
||||||
(advice-add 'rename-file :after #'org-roam--rename-file-advice)
|
(advice-add 'rename-file :after #'org-roam--rename-file-advice)
|
||||||
(advice-add 'delete-file :before #'org-roam--delete-file-advice)
|
(advice-add 'delete-file :before #'org-roam--delete-file-advice)
|
||||||
(when (fboundp 'org-link-set-parameters)
|
(when (fboundp 'org-link-set-parameters)
|
||||||
(org-link-set-parameters "file" :face 'org-roam--file-link-face :store #'org-roam-store-link)
|
(when org-roam-enable-headline-linking
|
||||||
|
(org-link-set-parameters "file" :face 'org-roam--file-link-face :store #'org-roam-store-link))
|
||||||
(org-link-set-parameters "id" :face 'org-roam--id-link-face))
|
(org-link-set-parameters "id" :face 'org-roam--id-link-face))
|
||||||
(org-roam-db-build-cache))
|
(org-roam-db-build-cache))
|
||||||
(t
|
(t
|
||||||
|
|
Loading…
Reference in a new issue