* lisp/org-footnote.el (org-footnote-goto-previous-reference): Only
add to mark ring on a successful match. Improve error message when
reference is outside visible part of buffer.
(org-footnote-get-next-reference): Avoid using
`org-footnote-at-reference-p', which is inaccurate, due to
`org-footnote-in-valid-context-p'.
* testing/lisp/test-org-footnote.el (test-org-footnote/goto-previous-reference):
New test.
* lisp/org-footnote.el (org-footnote-re):
(org-footnote-definition-re): Do not match [1]-like constructs.
(org-footnote): Fix typo.
(org-footnote-auto-label): Do not offer to create [1]-like constructs
anymore.
(org-footnote-new): Remove reference to obsolete value in
`org-footnote-auto-label'.
(org-footnote-at-reference-p):
(org-footnote-get-next-reference):
(org-footnote-next-reference-or-definition):
(org-footnote-goto-definition):
(org-footnote-goto-previous-reference): Use new regexp.
(org-footnote-normalize-label): Remove "fn:" prefix instead of adding
it.
(org-footnote-get-definition):
(org-footnote-all-labels):
(org-footnote-unique-label): Small refactoring.
(org-footnote-create-definition):
(org-footnote-delete-definitions):
(org-footnote--clear-footnote-section):
(org-footnote--collect-references):
(org-footnote--collect-definitions):
(org-footnote--set-label):
(org-footnote-sort): New functions.
(org-footnote-auto-adjust-maybe):
(org-footnote-action): Use new functions. Small refactoring.
(org-footnote-renumber-fn:N): Refactor code. Handle nested footnotes.
(org-footnote-normalize): Turn footnotes into [fn:N] construct instead
of [N].
* testing/lisp/test-org-footnote.el (test-org-footnote/delete):
(test-org-footnote/goto-definition):
(test-org-footnote/normalize): Update test
(test-org-footnote/sort):
(test-org-footnote/renumber-fn:N): New tests.
(test-org-footnote/normalize-outside-org): Remove test.
* lisp/org-footnote.el (org-footnote-goto-definition): Move to location
appropriate for further editing.
* testing/lisp/test-org-footnote.el (test-org-footnote/delete): Update
test.
* lisp/org-footnote.el (org-footnote--goto-local-insertion-point):
Renamed from `org-footnote-goto-local-insertion-point'.
(org-footnote-normalize): Use function above. Small refactoring.
* testing/lisp/test-org-footnote.el (test-org-footnote/normalize-in-org):
Small refactoring.
* lisp/org-footnote.el (org-footnote-goto-definition): Throw an error
when definition is outside narrowed part of buffer. Do not move
point either.
* testing/lisp/test-org-footnote.el (test-org-footnote/goto-definition):
New test.
Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/97158>
* lisp/org-footnote.el (org-footnote--allow-reference-p): Allow new
footnotes in headlines.
* testing/lisp/test-org-footnote.el (test-org-footnote/new): Add test.
Reported-by: Thomas S. Dye <tsd@tsdye.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/96843>
* lisp/org-footnote.el (org-footnote--allow-reference-p): New
function.
(org-footnote-new): Use new function.
* testing/lisp/test-org-footnote.el (test-org-footnote/new): New test.
In particular, Org now refuses to add a footnote reference in
a keyword, e.g., TITLE.
* lisp/org-element.el (org-element-footnote-definition-parser):
Require 2 blank lines to separate footnote definition.
* lisp/org-footnote.el (org-footnote-at-definition-p): Require 2 blank
lines to separate footnote definition.
* doc/org.texi: Update documentation for footnotes.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-org-footnote.el: Add tests.
Footnote definitions can still be separated with other footnote
definitions and headlines. This change allows to have multiple
paragraphs in a footnote definition without resorting to the "\par"
trick.
* lisp/org-footnote.el (org-footnote-delete-definitions): Remove blank
lines before the footnote definition instead of removing those after
it.
* testing/lisp/test-org-footnote.el: Adapt tests.
* lisp/org-footnote.el (org-footnote-normalize): Fix normalization of
inline footnotes with no footnote section.
* testing/lisp/test-org-footnote.el: New test file.
Thanks to Samuel Wales for reporting this.