summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Egli <christian.egli@alumni.ethz.ch>2013-05-03 10:15:58 (GMT)
committer Christian Egli <christian.egli@alumni.ethz.ch>2013-05-03 10:15:58 (GMT)
commit40635b2b4c3e718622a5a006c1addf0a7b3d0009 (patch)
tree961a6a5a7aef738d2db73aad4c8170a2745b9619
parentc36435b44072e12173b3035543096298f5aea284 (diff)
downloadorg-mode-40635b2b4c3e718622a5a006c1addf0a7b3d0009.zip
org-mode-40635b2b4c3e718622a5a006c1addf0a7b3d0009.tar.gz
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.
-rw-r--r--contrib/lisp/ox-taskjuggler.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 3458e06..f831d7c 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -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)