ox-taskjuggler.el: Handle the case of an empty document title

* ox-taskjuggler.el (org-taskjuggler-project-plan): Use the
project name as the title of the (default) report if the
document title is empty.

Thanks to Eric S Fraga for reporting this bug.
This commit is contained in:
Christian Egli 2013-05-03 12:15:58 +02:00
parent c36435b440
commit 40635b2b4c
1 changed files with 5 additions and 2 deletions

View File

@ -695,13 +695,16 @@ Return complete project plan as a string in TaskJuggler syntax."
(lambda (report) (org-taskjuggler--build-report report info))
main-reports "")
;; insert title in default reports
(let ((title (org-export-data (plist-get info :title) info)))
(let* ((title (org-export-data (plist-get info :title) info))
(report-title (if (string= title "")
(org-taskjuggler-get-name project)
title)))
(mapconcat
'org-element-normalize-string
(mapcar
(function
(lambda (report)
(replace-regexp-in-string "%title" title report t t)))
(replace-regexp-in-string "%title" report-title report t t)))
org-taskjuggler-default-reports) "")))))))))
(defun org-taskjuggler--build-project (project info)