diff --git a/lisp/org-lint.el b/lisp/org-lint.el index bb8e7c7c2..0e0bbea66 100644 --- a/lisp/org-lint.el +++ b/lisp/org-lint.el @@ -584,11 +584,16 @@ Use :header-args: instead" path))))))))) (defun org-lint-invalid-id-link (ast) + (org-id-update-id-locations nil t) (org-element-map ast 'link (lambda (link) (let ((id (org-element-property :path link))) (and (equal (org-element-property :type link) "id") - (not (org-id-find id)) + ;; The locations are up-to-date with file changes after + ;; the call to `org-id-update-id-locations'. We do not + ;; need to double-check if recorded ID is still present + ;; in the file. + (not (org-id-find-id-file id)) (list (org-element-begin link) (format "Unknown ID \"%s\"" id)))))))