* lisp/org.el (org-in-block-p): new function.
* lisp/org-footnote.el (org-footnote-forbidden-blocks): new variable.
(org-footnote-in-valid-context-p): new function.
(org-footnote-at-reference-p): use new function. Allow inline
footnotes to start at bol.
* lisp/org-footnote.el (org-footnote-at-reference-p): verify that what
looks like a footnote doesn't belong to a link.
(org-footnote-next-reference-or-definition): check more strictly
footnote definitions.
* lisp/org-footnote.el (org-footnote-at-reference-p): first check if
point is at the beginning of a footnote. Indeed `org-in-regexp'
first checks backwards and might find an incorrect footnote if they
are side-by-side.
* lisp/org-footnote.el (org-footnote-re): avoid matching inactive
time-stamps or check-box cookies.
(org-footnote-next-reference-or-definition): adapt to the new regexp.
* lisp/org-footnote.el (org-footnote-normalize): add `org-footnote'
property to footnote markers when preparing for exportation.
* lisp/org-html.el (org-export-as-html): read new property to decide
when to export a footnote.
* lisp/org-docbook.el (org-export-as-docbook): read new property to
decide when to export a footnote.
* lisp/org-latex.el (org-export-latex-preprocess): ensure footnote at
column 0 cannot end a list containing it by adding
`original-indentation' property to it.
* lisp/org-exp.el (org-export-footnotes-markers,
org-export-footnotes-data): new variables.
(org-export-preprocess-string): use a more explicit argument.
* lisp/org-html.el (org-export-as-html): initialize new variables.
* lisp/org-docbook.el (org-export-as-docbook): initialize new variables.
* lisp/org-latex.el (org-export-latex-footmark-seen): new variable.
(org-export-as-latex): initialize new variables.
(org-export-latex-preprocess): allow to export two or more footnotes
in a row. Also permit to have footnotes refering to previously
defined footnotes.
* lisp/org-ascii.el (org-export-as-ascii): feed org-footnote-normalize
with data so it can normalize footnotes before first headline, or
footnotes with their definition outside exported region.
* lisp/org-footnote.el (org-footnote-goto-definition): now,
determining if point is at a footnote reference is entirely
determined by `org-footnote-at-reference-p'. No need to check if
pattern isn't at beginning of the line elsewhere.
* lisp/org-footnote.el (org-footnote-next-reference-or-definition):
new function.
* lisp/org.el (org-activate-footnote-links): activate the whole
footnote, but only fontify its label.
* lisp/org-footnote.el (org-footnote-normalize): make use of changes
to `org-footnote-at-reference-p' and creation of various functions..
Also comment code.
(org-footnote-get-next-reference, org-footnote-delete-references,
org-footnote-delete-definitions): new functions
(org-footnote-goto-previous-reference, org-footnote-all-labels,
org-insert-footnote-reference-near-definition, org-footnote-delete):
rewrite to use org-footnote-get-next-reference.
* lisp/org-footnote.el (org-footnote-re): don't end an inline footnote
at unrelated closing square brackets.
(org-footnote-at-reference-p): improve accuracy of the function to
determine if point is at a reference and to extract definition of an
inline footnote.
(org-footnote-all-labels, org-footnote-action, org-footnote-delete,
org-footnote-auto-adjust-maybe): make use of previous function.
PATCH-5/5 org-odt compatibility patch
From 22c4feee78ff9a1ab7cc48275ec29d322a3472a1 Mon Sep 17 00:00:00 2001
From: Jambunathan K <kjambunathan@gmail.com>
Date: Thu, 23 Jun 2011 13:17:18 +0530
Subject: [PATCH 5/5] Control insertion point for footnote definitions during pre-process.
* lisp/org-footnote.el
(org-footnote-insert-pos-for-preprocessor): New variable.
(org-footnote-normalize): Use it.
* lisp/org-footnote.el: (org-footnote-auto-label): New random option
* lisp/org-footnote.el: (org-footnote-new): Create random footnote
labels with unique ids
* lisp/org-footnote.el: (org-footnote-create-definition): Allow for
footnote sections above the current footnote insertion point.
Fixes bug in which org-mode will create a new footnote section if the
current footnote section is not beneath the current insertion point.
* lisp/org-footnote.el: (org-footnote-create-definition): Don't search
for last footnote when in org-mode file.
The recent changes to accommodate signatures in message-mode instruct
org-mode to search for the last footnote in the entire buffer when
inserting a new footnote definition. This causes problems in org
buffers, since org-footnote-goto-local-insertion-point already finds
the correct insertion point. (I.e., the insertion point is always
placed in beneath the last footnote in the buffer, even if
org-footnote-section is nil.) This patch invokes the search only if in
non org-mode buffers.
* org-footnote.el (org-footnote-create-definition): Place Footnotes
section before message-signature-separator also in modes derived
from message-mode.
* lisp/org-footnote.el (org-footnote-create-definition)
(org-footnote-goto-local-insertion-point): Add footnotes before
signature when in message-mode.