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 Borchmann 2020-05-15 11:13:26 +02:00
parent 1be7f0e171
commit 8cb39ec9e2
Signed by: exot
GPG Key ID: 1C7071A75BB72D64

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 ;; Reset checkboxes if the RESET_CHECK_BOXES property is set
(add-hook 'org-after-todo-state-change-hook 'org-reset-checkbox-state-maybe) (add-hook 'org-after-todo-state-change-hook 'org-reset-checkbox-state-maybe)
;; Color links to file according to whether they exist or not ;; Statically color links sponding to whether the file exists, but
(org-link-set-parameters ;; this turns out to be slow on Windows; we can use `org-lint' for
"file" ;; this when necessary)
:face (lambda (path) (if (file-exists-p path) 'org-link 'org-warning))) (org-link-set-parameters "file" :face 'org-link)
;; File Apps ;; File Apps