summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-08-25 15:24:07 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-08-25 15:24:07 +0200
commitc1b9d38c892f389275e9cf6fb5a5aa12ee981bc7 (patch)
treec18ae8b0340911dbb38a3f97177b2667e743bb8e
parent2ff3101c0e555627421162a759c4342f0b923a34 (diff)
downloadorg-mode-c1b9d38c892f389275e9cf6fb5a5aa12ee981bc7.tar.gz
org-lint: Fix wrong warning with inline footnotes
* lisp/org-lint.el (org-lint-undefined-footnote-reference): Do not warn when definition is inline. * testing/lisp/test-org-lint.el (test-org-lint/undefined-footnote-reference): Add tests. Reported-by: Eric S Fraga <esflists@gmail.com> <http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00577.html>
-rw-r--r--lisp/org-lint.el2
-rw-r--r--testing/lisp/test-org-lint.el6
2 files changed, 7 insertions, 1 deletions
diff --git a/lisp/org-lint.el b/lisp/org-lint.el
index 5abda7c..9007bf8 100644
--- a/lisp/org-lint.el
+++ b/lisp/org-lint.el
@@ -724,7 +724,7 @@ Use \"export %s\" instead"
(org-element-map ast 'footnote-reference
(lambda (f)
(let ((label (org-element-property :label f)))
- (and label
+ (and (eq 'standard (org-element-property :type f))
(not (member label definitions))
(list (org-element-property :begin f)
(format "Missing definition for footnote [%s]"
diff --git a/testing/lisp/test-org-lint.el b/testing/lisp/test-org-lint.el
index 3ae42c7..3b447ec 100644
--- a/testing/lisp/test-org-lint.el
+++ b/testing/lisp/test-org-lint.el
@@ -304,6 +304,12 @@ This is not a node property
(org-lint '(undefined-footnote-reference))))
(should-not
(org-test-with-temp-text "Text[fn:1]\n[fn:1] Definition"
+ (org-lint '(undefined-footnote-reference))))
+ (should-not
+ (org-test-with-temp-text "Text[fn:1:inline reference]"
+ (org-lint '(undefined-footnote-reference))))
+ (should-not
+ (org-test-with-temp-text "Text[fn::anonymous reference]"
(org-lint '(undefined-footnote-reference)))))
(ert-deftest test-org-lint/unreferenced-footnote-definition ()