mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(fix): fall back to org-id search ID face computation (#1195)
* (fix): fall back to org-id search ID face computation Fixes the scenario where the face is reported as invalid although it is part of Org's ID files (e.g. in the agenda). Fixes #1191. This can however slow face computation a lot (when there are many org id/agenda files). Here, we choose to focus on correctness. * Document faces, default to only applying to Org-roam notes
This commit is contained in:
12
org-roam.el
12
org-roam.el
@ -1190,7 +1190,7 @@ This is active when `org-roam-completion-everywhere' is non-nil."
|
||||
;;;; Function Faces
|
||||
;; These faces are used by `org-link-set-parameters', which take one argument,
|
||||
;; which is the path.
|
||||
(defcustom org-roam-link-use-custom-faces 'everywhere
|
||||
(defcustom org-roam-link-use-custom-faces t
|
||||
"Define where to apply custom faces to Org-roam links.
|
||||
|
||||
Valide values are:
|
||||
@ -1202,9 +1202,9 @@ everywhere Apply custom faces everywhere.
|
||||
|
||||
Otherwise, do not apply custom faces to Org-roam links."
|
||||
:type '(choice
|
||||
(const :tag "Use custom faces inside Org-roam notes" t)
|
||||
(const :tag "Apply custom faces everywhere" everywhere)
|
||||
(const :tag "Do not apply custom faces" nil))
|
||||
(const :tag "Use custom faces inside Org-roam notes" t)
|
||||
(const :tag "Apply custom faces everywhere" everywhere)
|
||||
(const :tag "Do not apply custom faces" nil))
|
||||
:group 'org-roam)
|
||||
|
||||
(defun org-roam--file-link-face (path)
|
||||
@ -1243,7 +1243,9 @@ file."
|
||||
(custom (or (and in-note org-roam-link-use-custom-faces)
|
||||
(eq org-roam-link-use-custom-faces 'everywhere))))
|
||||
(cond ((and custom
|
||||
(not (org-roam-id-get-file id)))
|
||||
(not (org-roam-id-get-file id))
|
||||
(not (and (eq org-roam-link-use-custom-faces 'everywhere)
|
||||
(org-id-find id))))
|
||||
'org-roam-link-invalid)
|
||||
((and (org-roam--in-buffer-p)
|
||||
(org-roam--backlink-to-current-p))
|
||||
|
Reference in New Issue
Block a user