emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] org-footnote: fix inserting new footnote mangling drawers (was:


From: TRS-80
Subject: [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: Sat, 09 Jan 2021 12:12:47 -0500
User-agent: Roundcube Webmail/1.3.15

On 2021-01-03 16:27, TRS-80 wrote:
Hello!

I seem to have come across a bug today in org-footnote.

I had just learned about the variable org-footnote-auto-adjust and set
it to t.  Then I tried to test it by invoking org-footnote-new in my
Org file in between existing footnotes 2 and 3.

N.B., my Footnotes heading, prior to doing above also had a CUSTOM_ID
property set:

#+begin_src org
  ,** Footnotes
     :PROPERTIES:
     :CUSTOM_ID:            footnotes
     :END:

  [fn:1] original footnote 1

  [fn:2] original footnote 2

  [fn:3] original footnote 3

  [fn:4] original footnote 4

#+end_src

The new footnote seems to get inserted into correct place, however there
appears to be a problem if there is a property drawer:

#+begin_src org
  ,** Footnotes

  [fn:1] original footnote 1

  [fn:2] original footnote 2

  [fn:3] new footnote
     :PROPERTIES:
     :CUSTOM_ID:            footnotes
     :END:

  [fn:4] original footnote 3

  [fn:5] original footnote 4

#+end_src

Since I was just studying the org-footnote code anyway, I will attempt
to further diagnose the issue, and perhaps even send a patch.

As I was filling out bug report I realized I am on slightly dated
version of Orgmode. So I went ahead and cloned latest version and did a
diff on org-footnote.el between my affected version here locally and
latest, and the only change I saw was the copyright date.

So with that out of the way, I will start digging and see what I can
come up with.

Cheers,
TRS-80


Emacs : GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
 of 2020-05-16, modified by Debian
Package: Org mode version 9.3.6 (9.3.6-23-g01ee25-elpaplus @
/home/user/.emacs.d/elpa/org-plus-contrib-20200309/)

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?

However as it will be my first patch to Orgmode, any feedback would be
welcomed.

Cheers,
TRS-80

Attachment: 0001-org-footnote-fix-inserting-new-footnote-mangling-dra.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]