diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-07-30 12:38:06 +0200 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-07-30 12:38:06 +0200 |
commit | c3631aae7e68565978433cad8c4a2b286e91dfac (patch) | |
tree | 463218143a7d32fb20ae5d38ffc3b7bd5abf5e41 | |
parent | 8c6c6a4f3d66b39c06f8ac6dfb1e2af0111da098 (diff) | |
download | org-mode-c3631aae7e68565978433cad8c4a2b286e91dfac.tar.gz |
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.
-rw-r--r-- | lisp/org-footnote.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index 6fadd28..68b1412 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)) |