I tried to restrict the linting to one checker with (org-lint '(link-to-local-file))
, however the parsing is still going to induce a noticable delay. Maybe limiting the linter to the current subtree or using the async
library can improve the performance. Anyways, below is a rather simple flycheck setup for org-lint
:
(flycheck-define-generic-checker 'org-lint
"Syntax checker for org-lint."
:start 'flycheck-org-lint-start
:modes '(org-mode))
(defun flycheck-org-lint-start (checker callback)
(funcall
callback 'finished
(save-excursion
(mapcar
(lambda (err)
(goto-char (car err))
(flycheck-error-new-at
(org-current-line) (1+ (current-column))
'warning (cadr err) :checker checker))
(org-lint-link-to-local-file (org-element-parse-buffer))))))
(add-to-list 'flycheck-checkers 'org-lint)