mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
lang/org: highlight broken file: links with error face
This commit is contained in:
@ -199,6 +199,13 @@ unfold to point on startup."
|
|||||||
(file-relative-name path)
|
(file-relative-name path)
|
||||||
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)
|
(defmacro def-org-file-link! (key dir)
|
||||||
`(org-link-set-parameters
|
`(org-link-set-parameters
|
||||||
,key
|
,key
|
||||||
@ -207,7 +214,7 @@ unfold to point on startup."
|
|||||||
:face (lambda (link)
|
:face (lambda (link)
|
||||||
(if (file-exists-p (expand-file-name link ,dir))
|
(if (file-exists-p (expand-file-name link ,dir))
|
||||||
'org-link
|
'org-link
|
||||||
'(:inherit (error underline))))))
|
'error))))
|
||||||
|
|
||||||
(def-org-file-link! "org" +org-dir)
|
(def-org-file-link! "org" +org-dir)
|
||||||
(def-org-file-link! "doom" doom-emacs-dir)
|
(def-org-file-link! "doom" doom-emacs-dir)
|
||||||
|
Reference in New Issue
Block a user