From 6ad53828cc1400ece04043c624d478047f2d0b87 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 24 Mar 2012 20:34:41 +0100 Subject: [PATCH] org-footnote: Fix LaTeX export error when a src block produces fake footnotes * lisp/org-footnote.el (org-footnote-delete-definitions): Fix LaTeX export error when a src block produces fake footnotes. --- lisp/org-footnote.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index 612c0558b..34fc31f39 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -864,8 +864,9 @@ Return the number of footnotes removed." (ndef 0)) (while (re-search-forward def-re nil t) (let ((full-def (org-footnote-at-definition-p))) - (delete-region (nth 1 full-def) (nth 2 full-def))) - (incf ndef)) + (when full-def + (delete-region (nth 1 full-def) (nth 2 full-def)) + (incf ndef)))) ndef))) (defun org-footnote-delete (&optional label)