[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] org-footnote: fix inserting new footnote mangling drawers (w
From: |
Kyle Meyer |
Subject: |
Re: [PATCH] org-footnote: fix inserting new footnote mangling drawers (was: Re: Bug: inserting footnote when Footnotes heading has property drawer [9.3.6 (9.3.6-23-g01ee25-elpaplus @ /home/user/.emacs.d/elpa/org-plus-contrib-20200309/)]) |
Date: |
Mon, 11 Jan 2021 00:57:09 GMT |
Thanks for the initial report and the patch.
TRS-80 writes:
> Attached please find a very simple (one line) patch that I believe
> should fix this issue.
>
> This patch is of course based on latest git (not my personal outdated
> version) and also maint branch. I think I've got that right?
Looks good to me.
> Subject: [PATCH] org-footnote: fix inserting new footnote mangling drawers
convention nit: s/fix/Fix/ (no need to resend)
> * 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 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
I'm planning to squash the following test in when applying. Look okay
to you?
diff --git a/testing/lisp/test-org-footnote.el
b/testing/lisp/test-org-footnote.el
index eca24d315..50a430785 100644
--- a/testing/lisp/test-org-footnote.el
+++ b/testing/lisp/test-org-footnote.el
@@ -138,7 +138,20 @@ (ert-deftest test-org-footnote/new ()
(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."