From 5d70b8f7611d532fb1b5ebe75c7db8df179c5530 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 10 Jun 2008 09:02:57 +0200 Subject: [PATCH] Fix bug with removing xomments during export. Reported by Adam Spiers. --- lisp/ChangeLog | 5 +++++ lisp/org-exp.el | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8558f4618..acbfbedef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-06-10 Carsten Dominik + + * org-exp.el (org-export-handle-comments): Fix bug with several + comment lines after each other. + 2008-06-09 Carsten Dominik * org-exp.el (org-export-protect-examples): Catch the case of a diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 691977b20..b310af0ae 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1571,10 +1571,12 @@ These special cookies will later be interpreted by the backend." (defun org-export-handle-comments (commentsp) "Remove comments, or convert to backend-specific format. COMMENTSP can be a format string for publishing comments. -When it is nit, all comments will be removed." - (let (pos) +When it is nil, all comments will be removed." + (let ((re "^#\\(.*\n?\\)") + pos) (goto-char (point-min)) - (while (re-search-forward "^#\\(.*\n?\\)" nil t) + (while (or (looking-at re) + (re-search-forward re nil t)) (setq pos (match-beginning 0)) (if commentsp (progn (add-text-properties @@ -1583,8 +1585,7 @@ When it is nit, all comments will be removed." (goto-char (1+ pos)) (org-if-unprotected (replace-match "") - (goto-char (max (point-min) (1- pos)))) - (end-of-line 1))))) + (goto-char (max (point-min) (1- pos)))))))) (defun org-export-mark-radio-links () "Find all matches for radio targets and turn them into internal links." -- 2.11.4.GIT