[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/org 17e4fe9093: lint: Fix false positive with i
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/org 17e4fe9093: lint: Fix false positive with inline footnote definitions |
Date: |
Sun, 13 Feb 2022 16:57:46 -0500 (EST) |
branch: externals-release/org
commit 17e4fe90930596ba5cdf82223b9f5de9040a9581
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Commit: Nicolas Goaziou <mail@nicolasgoaziou.fr>
lint: Fix false positive with inline footnote definitions
* lisp/org-lint.el (org-lint-invalid-macro-argument-and-template):
Take into consideration inline definitions.
* testing/lisp/test-org-lint.el
(test-org-lint/undefined-footnote-reference):
Add test.
Reported-by: Timothy <tecosaur@gmail.com>
---
lisp/org-lint.el | 8 ++++++--
testing/lisp/test-org-lint.el | 3 +++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/lisp/org-lint.el b/lisp/org-lint.el
index 0894951b65..83c2d08a90 100644
--- a/lisp/org-lint.el
+++ b/lisp/org-lint.el
@@ -784,8 +784,12 @@ Use \"export %s\" instead"
reports))
(defun org-lint-undefined-footnote-reference (ast)
- (let ((definitions (org-element-map ast 'footnote-definition
- (lambda (f) (org-element-property :label f)))))
+ (let ((definitions
+ (org-element-map ast '(footnote-definition footnote-reference)
+ (lambda (f)
+ (and (or (eq 'footnote-definition (org-element-type f))
+ (eq 'inline (org-element-property :type f)))
+ (org-element-property :label f))))))
(org-element-map ast 'footnote-reference
(lambda (f)
(let ((label (org-element-property :label f)))
diff --git a/testing/lisp/test-org-lint.el b/testing/lisp/test-org-lint.el
index e57993c0ab..d293e27324 100644
--- a/testing/lisp/test-org-lint.el
+++ b/testing/lisp/test-org-lint.el
@@ -358,6 +358,9 @@ This is not a node property
(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:1:inline reference] [fn:1]"
+ (org-lint '(undefined-footnote-reference))))
(should-not
(org-test-with-temp-text "Text[fn::anonymous reference]"
(org-lint '(undefined-footnote-reference)))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals-release/org 17e4fe9093: lint: Fix false positive with inline footnote definitions,
ELPA Syncer <=