(feat): add custom face for invalid links (#564)

* (feat): add custom face for links without destinations

* Rename to ‘invalid’

* Update docstring

* Remove ‘typically’
This commit is contained in:
Leo Vivier
2020-05-04 15:47:27 +02:00
committed by GitHub
parent f6e84caf72
commit 11e15594cc

View File

@@ -671,6 +671,12 @@ ARG is used to forward interactive calls to
"Face for Org-roam links pointing to the current buffer."
:group 'org-roam-faces)
(defface org-roam-link-invalid
'((t :inherit (error org-link)))
"Face for Org-roam links that are not valid.
This face is used for links without a destination."
:group 'org-roam-faces)
(defun org-roam--in-buffer-p ()
"Return t if in the Org-roam buffer."
(and (boundp org-roam-backlinks-mode)
@@ -697,7 +703,7 @@ currently opened Org-roam file in the backlink buffer, or
`org-roam-link-face' if PATH corresponds to any other Org-roam
file."
(cond ((not (file-exists-p path))
'error)
'org-roam-link-invalid)
((and (org-roam--in-buffer-p)
(org-roam--backlink-to-current-p))
'org-roam-link-current)