[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/org 1806abd 2/2: org-footnote: Fix inserting ne
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/org 1806abd 2/2: org-footnote: Fix inserting new footnote mangling drawers |
Date: |
Thu, 14 Jan 2021 00:57:11 -0500 (EST) |
branch: externals-release/org
commit 1806abdc396d4987ed5e563c0204a13d14c25e1d
Author: TRS-80 <lists.trs-80@isnotmyreal.name>
Commit: Kyle Meyer <kyle@kyleam.com>
org-footnote: Fix inserting new footnote mangling drawers
* org-footnote.el (org-footnote-create-definition): Replace
`forward-line' with `org-end-of-meta-data' to skip over any
properties and/or drawers that may be present on the
`org-footnote-section' heading (default "Footnotes").
TINYCHANGE
---
lisp/org-footnote.el | 2 +-
testing/lisp/test-org-footnote.el | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index 3d42421..47ad4aa 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -704,7 +704,7 @@ function doesn't move point."
(concat "^\\*+[ \t]+" (regexp-quote org-footnote-section) "[ \t]*$")
nil t))
(goto-char (match-end 0))
- (forward-line)
+ (org-end-of-meta-data t)
(unless (bolp) (insert "\n")))
(t (org-footnote--clear-footnote-section)))
(when (zerop (org-back-over-empty-lines)) (insert "\n"))
diff --git a/testing/lisp/test-org-footnote.el
b/testing/lisp/test-org-footnote.el
index eca24d3..50a4307 100644
--- a/testing/lisp/test-org-footnote.el
+++ b/testing/lisp/test-org-footnote.el
@@ -138,7 +138,20 @@
(org-test-with-temp-text
"Paragraph<point>\n# Local Variables:\n# foo: t\n# End:"
(let ((org-footnote-section "Footnotes")) (org-footnote-new))
- (buffer-string)))))
+ (buffer-string))))
+ (should
+ (equal "Para[fn:1]
+* Footnotes
+:properties:
+:custom_id: id
+:end:
+
+\[fn:1]"
+ (org-test-with-temp-text
+ "Para<point>\n* Footnotes\n:properties:\n:custom_id: id\n:end:"
+ (let ((org-footnote-section "Footnotes"))
+ (org-footnote-new))
+ (org-trim (buffer-string))))))
(ert-deftest test-org-footnote/delete ()
"Test `org-footnote-delete' specifications."