From fddc312c2929a32b5e742857498036a27343b4be Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Sat, 15 Dec 2012 22:05:16 +0530 Subject: [PATCH] org-odt.el: Improve TOC entries --- contrib/lisp/org-e-odt.el | 43 ++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/contrib/lisp/org-e-odt.el b/contrib/lisp/org-e-odt.el index dd59af39a..41b53f8bb 100644 --- a/contrib/lisp/org-e-odt.el +++ b/contrib/lisp/org-e-odt.el @@ -1110,18 +1110,33 @@ See `org-e-odt--build-date-styles' for implementation details." (defun* org-e-odt-format-toc-headline (todo todo-type priority text tags &key level section-number headline-label &allow-other-keys) - (setq text (concat - (and org-export-with-section-numbers - (concat section-number ". ")) - text - (and tags - (concat - "" - (format "%s" - "OrgTag" tags))))) - (when todo - (setq text (format "%s" - "OrgTodo" text))) + (setq text + (concat + ;; Section number. + (when section-number (concat section-number ". ")) + ;; Todo. + (when todo + (let ((style (if (member todo org-done-keywords) + "OrgDone" "OrgTodo"))) + (format "%s " + style todo))) + (when priority + (let* ((style (format "OrgPriority-%s" priority)) + (priority (format "[#%c]" priority))) + (format "%s " + style priority))) + ;; Title. + text + ;; Tags. + (when tags + (concat + (format " [%s]" + "OrgTags" + (mapconcat + (lambda (tag) + (format + "%s" + "OrgTag" tag)) tags " : ")))))) (format "%s" headline-label text)) @@ -1720,8 +1735,8 @@ CONTENTS is nil. INFO is a plist holding contextual information." (format "%s " style todo))) (when priority - (let* ((priority (format "[#%c]" priority)) - (style (format "OrgPriority-%s" priority))) + (let* ((style (format "OrgPriority-%s" priority)) + (priority (format "[#%c]" priority))) (format "%s " style priority))) ;; Title.