diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9048e6463..d1f3d5a1e 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2009-06-07 Carsten Dominik + * org-docbook.el (org-export-docbook-close-lists-maybe): New function. + (org-export-as-docbook): Close lists when original indentation + mandates it. + * org-html.el (org-export-html-close-lists-maybe): New function. (org-export-as-html): Close lists when original indentation mandates it. diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index a9e56e2fa..929af4909 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -644,6 +644,7 @@ publishing directory." ;; Protected HTML (when (get-text-property 0 'org-protected line) + (org-export-docbook-close-lists-maybe line) (let (par) (when (re-search-backward "\\(\\)\\([ \t\r\n]*\\)\\=" (- (point) 100) t) @@ -1144,6 +1145,25 @@ publishing directory." (insert "\n") (insert "\n"))) +(defvar in-local-list) +(defvar local-list-indent) +(defun org-export-docbook-close-lists-maybe (line) + (let ((ind (get-text-property 0 'original-indentation line)) + didclose) + (when ind + (while (and in-local-list + (<= ind (car local-list-indent))) + (setq didclose t) + (let ((listtype (car local-list-type))) + (org-export-docbook-close-li listtype) + (insert (cond + ((equal listtype "o") "\n") + ((equal listtype "u") "\n") + ((equal listtype "d") "\n")))) + (pop local-list-type) (pop local-list-indent) + (setq in-local-list local-list-indent)) + (and didclose (org-export-docbook-open-para))))) + (defun org-export-docbook-level-start (level title) "Insert a new level in DocBook export. When TITLE is nil, just close all open levels."