From fe42a5e83ec543b8673535574e896c5b5b24f326 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 13 Jul 2010 13:48:56 +0200 Subject: [PATCH] Export supports any list ender. Export to ascii has been fixed. * org-exp.el (org-export-mark-list-ending): Differentiate between export backends, and replace `org-list-end-re' by a blank line upon exporting. --- lisp/org-exp.el | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/lisp/org-exp.el b/lisp/org-exp.el index bfa3b464e..0ed06d19d 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1633,14 +1633,25 @@ These special cookies will later be interpreted by the backend." "Mark list endings with special cookies. These special cookies will later be interpreted by the backend. `org-list-end-re' is replaced by a blank line in the process." - ;; Backends using `org-list-parse-list' do not need this. - (unless (eq backend 'latex) - (goto-char (point-min)) - (while (org-search-forward-unenclosed (org-item-re) nil 'move) - (goto-char (org-list-bottom-point)) - (when (looking-at (org-list-end-re)) - (replace-match "\n")) - (insert "ORG-LIST-END\n")))) + (let ((process-buffer + (lambda (end-list-marker) + (goto-char (point-min)) + (while (org-search-forward-unenclosed (org-item-re) nil t) + (goto-char (org-list-bottom-point)) + (when (looking-at (org-list-end-re)) + (replace-match "\n")) + (insert end-list-marker))))) + ;; We need to divide backends into 3 categories. + (cond + ;; 1. Backends using `org-list-parse-list' do not need markers. + ((memq backend '(latex)) + nil) + ;; 2. Line-processing backends need to be told where lists end. + ((memq backend '(html docbook)) + (funcall process-buffer "ORG-LIST-END\n")) + ;; 3. Others backends do not need to know this: clean list enders. + (t + (funcall process-buffer "\n"))))) (defun org-export-attach-captions-and-attributes (backend target-alist) "Move #+CAPTION, #+ATTR_BACKEND, and #+LABEL text into text properties.