From c3631aae7e68565978433cad8c4a2b286e91dfac Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 30 Jul 2011 12:38:06 +0200 Subject: [PATCH] org-footnote: prevent LaTeX export from catching footnotes in protect environment * lisp/org-footnote.el (org-footnote-in-valid-context-p): check `org-protected' property before allowing to match a footnote. (org-footnote-at-reference-p): remove an obsolete test. It's now done in the previous function. --- lisp/org-footnote.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index 6fadd28ab..68b14127e 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -171,8 +171,10 @@ extracted will be filled again." (save-match-data (not (or (org-in-commented-line) (org-in-indented-comment-line) - (org-in-verbatim-emphasis) + ;; Avoid protected environments (LaTeX export) + (get-text-property (point) 'org-protected) ;; Avoid literal example. + (org-in-verbatim-emphasis) (save-excursion (beginning-of-line) (looking-at "[ \t]*:[ \t]+")) @@ -223,8 +225,7 @@ positions, and the definition, when inlined." ;; optional argument of the command. Thus, check ;; the `org-protected' property of that command. (or (not (org-inside-latex-macro-p)) - (and (get-text-property (1- beg) 'org-protected) - (not (get-text-property beg 'org-protected))))) + (get-text-property (1- beg) 'org-protected))) (list label beg end ;; Definition: ensure this is an inline footnote first. (and (or (not label) (match-string 1))