Statically choose face for Org Mode links

Checking whether the file exists or not and choosing the face accordingly may be
slow on Windows, where file operations seem to be expensive.
This commit is contained in:
Daniel - 2020-05-15 11:13:26 +02:00
parent 1be7f0e171
commit 8cb39ec9e2
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 4 additions and 4 deletions

View File

@ -831,10 +831,10 @@ With given ARG, display files in `db/important-document-path."
;; Reset checkboxes if the RESET_CHECK_BOXES property is set
(add-hook 'org-after-todo-state-change-hook 'org-reset-checkbox-state-maybe)
;; Color links to file according to whether they exist or not
(org-link-set-parameters
"file"
:face (lambda (path) (if (file-exists-p path) 'org-link 'org-warning)))
;; Statically color links sponding to whether the file exists, but
;; this turns out to be slow on Windows; we can use `org-lint' for
;; this when necessary)
(org-link-set-parameters "file" :face 'org-link)
;; File Apps