From 3bc997fe8f4c8c57deaa451947a733a28500fb8e Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sun, 30 Aug 2009 19:10:06 +0800 Subject: [PATCH] org-latex.el: bugfix about exporting first lines with no heading. org-export-latex-first-lines was confused when there was no heading after the first headlines. This patch fixes this. --- lisp/ChangeLog | 4 ++++ lisp/org-latex.el | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4a0ab7f47..0617f795a 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2009-08-30 Bastien Guerry + + * org-latex.el (org-export-latex-first-lines): Bugfix. + 2009-08-29 Carsten Dominik * org-clock.el (org-clock-modify-effort-estimate): Emit message diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 98f6d613e..67eab991e 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1003,10 +1003,11 @@ If BEG is non-nil, it is the beginning of the region. If END is non-nil, it is the end of the region." (save-excursion (goto-char (or beg (point-min))) - (let* ((pt (point)) - (end (if (re-search-forward "^\\*+ " end t) - (goto-char (match-beginning 0)) - (goto-char end)))) + (let* ((pt (point))) + (or end + (and (re-search-forward "^\\*+ " end t) + (setq end (match-beginning 0))) + (setq end (point-max))) (prog1 (org-export-latex-content (org-export-preprocess-string