diff options
author | Ihor Radchenko <yantar92@gmail.com> | 2020-09-26 14:24:44 +0800 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2020-09-26 10:34:59 +0200 |
commit | ab00524fc525e81ff09893f8e9b2f170892fc3d2 (patch) | |
tree | 9bfebd07e2a5a6c6b162469926e6828041dcb820 | |
parent | c20cb0993b4139e50bf9e434863521e253f9a115 (diff) | |
download | org-mode-ab00524fc525e81ff09893f8e9b2f170892fc3d2.tar.gz |
Fix `org-lint-link-to-local-file'.
* lisp/org-lint.el (org-lint-link-to-local-file): 1. Fix call to
`org-attach-expand' being called with point not at the attachment:
link. 2. Fix typo in call to `format'. File argument had to be
outside the if.
-rw-r--r-- | lisp/org-lint.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/org-lint.el b/lisp/org-lint.el index 79ad640..e4e0ef7 100644 --- a/lisp/org-lint.el +++ b/lisp/org-lint.el @@ -574,15 +574,16 @@ Use :header-args: instead" (let* ((path (org-element-property :path l)) (file (if (string= type "file") path - (org-attach-expand path)))) + (org-with-point-at (org-element-property :begin l) + (org-attach-expand path))))) (and (not (file-remote-p file)) (not (file-exists-p file)) (list (org-element-property :begin l) (format (if (org-element-lineage l '(link)) "Link to non-existent image file %S \ in description" - "Link to non-existent local file %S" - file)))))) + "Link to non-existent local file %S") + file))))) (_ nil)))))) (defun org-lint-non-existent-setupfile-parameter (ast) |