From 4636453e93ded40507205faa5b2607f9493e5ed2 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 18 Jan 2011 22:36:49 +0100 Subject: [PATCH] Do not enforce type of ordered lists upon exporting * lisp/org-docbook.el (org-export-docbook-list-line): even with alphabetical lists, Org shouldn't enforce a particular list type to exporters. This is a job for style files. * lisp/org-html.el (org-html-export-list-line): ib idem. --- lisp/org-docbook.el | 18 ++++-------------- lisp/org-html.el | 18 +++--------------- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index f2518cd4b..256bafec3 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -1391,27 +1391,17 @@ the alist of previous items." ;; case list is ill-formed. (type (funcall get-type list-beg struct prevs)) ;; Special variables for ordered lists. - (order-type (let ((bullet (org-list-get-bullet list-beg struct))) - (cond - ((not (equal type "ordered")) nil) - ((string-match "[a-z]" bullet) "loweralpha") - ((string-match "[A-Z]" bullet) "upperalpha") - (t "arabic")))) (counter (let ((count-tmp (org-list-get-counter pos struct))) (cond ((not count-tmp) nil) - ((and (member order-type '("loweralpha" "upperalpha")) - (string-match "[A-Za-z]" count-tmp)) - count-tmp) - ((and (equal order-type "arabic") - (string-match "[0-9]+" count-tmp)) + ((string-match "[A-Za-z]" count-tmp) + (- (string-to-char (upcase count-tmp)) 64)) + ((string-match "[0-9]+" count-tmp) count-tmp))))) ;; When FIRSTP, a new list or sub-list is starting. (when firstp (org-export-docbook-close-para-maybe) - (insert (if (equal type "ordered") - (concat "\n") - (format "<%slist>\n" type)))) + (insert (format "<%slist>\n" type))) (insert (cond ((equal type "variable") (format "%s" desc-tag)) diff --git a/lisp/org-html.el b/lisp/org-html.el index 7411ea8d1..4a6bde98b 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -2446,28 +2446,16 @@ the alist of previous items." ;; Always refer to first item to determine list type, in ;; case list is ill-formed. (type (funcall get-type list-beg struct prevs)) - ;; Special variables for ordered lists. - (order-type (let ((bullet (org-list-get-bullet list-beg struct))) - (cond - ((not (equal type "o")) nil) - ((string-match "[a-z]" bullet) "a") - ((string-match "[A-Z]" bullet) "A") - (t "1")))) (counter (let ((count-tmp (org-list-get-counter pos struct))) (cond ((not count-tmp) nil) - ((and (member order-type '("a" "A")) - (string-match "[A-Za-z]" count-tmp)) + ((string-match "[A-Za-z]" count-tmp) (- (string-to-char (upcase count-tmp)) 64)) - ((and (equal order-type "1") - (string-match "[0-9]+" count-tmp)) + ((string-match "[0-9]+" count-tmp) count-tmp))))) (when firstp (org-close-par-maybe) - ;; Treat ordered lists differently because of ORDER-TYPE. - (insert (if (equal type "o") - (concat "
    \n") - (format "<%sl>\n" type)))) + (insert (format "<%sl>\n" type))) (insert (cond ((equal type "d") (format "
    %s
    \n" desc-tag))