From 11e15594ccd2066b93de2cdf33bbad53f16d7ca8 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Mon, 4 May 2020 15:47:27 +0200 Subject: [PATCH] (feat): add custom face for invalid links (#564) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * (feat): add custom face for links without destinations * Rename to ‘invalid’ * Update docstring * Remove ‘typically’ --- org-roam.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/org-roam.el b/org-roam.el index bdd26db..422ad08 100644 --- a/org-roam.el +++ b/org-roam.el @@ -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)