lang/org: highlight broken file: links with error face

This commit is contained in:
Henrik Lissner 2018-03-12 13:24:23 -04:00
parent 62025c8107
commit 88d3e91ee4
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -199,6 +199,13 @@ unfold to point on startup."
(file-relative-name path)
path))
;; highlight broken links
(org-link-set-parameters
"file"
:face (lambda (path)
(unless (file-remote-p path)
(if (file-exists-p path) 'org-link 'error))))
(defmacro def-org-file-link! (key dir)
`(org-link-set-parameters
,key
@ -207,7 +214,7 @@ unfold to point on startup."
:face (lambda (link)
(if (file-exists-p (expand-file-name link ,dir))
'org-link
'(:inherit (error underline))))))
'error))))
(def-org-file-link! "org" +org-dir)
(def-org-file-link! "doom" doom-emacs-dir)