From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yann Hodique Subject: [PATCH 05/10] org-taskjuggler: introduce a global header, for early macros Date: Sun, 5 Aug 2012 12:53:59 +0200 Message-ID: <1344164044-15059-6-git-send-email-yann.hodique@gmail.com> References: <1344164044-15059-1-git-send-email-yann.hodique@gmail.com> Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxyUK-0001by-J2 for emacs-orgmode@gnu.org; Sun, 05 Aug 2012 06:55:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SxyUJ-00010V-Aa for emacs-orgmode@gnu.org; Sun, 05 Aug 2012 06:55:12 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:41571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxyUJ-00010N-4D for emacs-orgmode@gnu.org; Sun, 05 Aug 2012 06:55:11 -0400 Received: by wibhm2 with SMTP id hm2so718763wib.0 for ; Sun, 05 Aug 2012 03:55:10 -0700 (PDT) In-Reply-To: <1344164044-15059-1-git-send-email-yann.hodique@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Yann Hodique * org-taskjuggler.el (org-export-taskjuggler-default-global-header): new custom variable (org-export-as-taskjuggler): insert global header before anything else --- lisp/org-taskjuggler.el | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el index f668e7f..3f829b3 100644 --- a/lisp/org-taskjuggler.el +++ b/lisp/org-taskjuggler.el @@ -221,6 +221,14 @@ with `org-export-taskjuggler-project-tag'" :version "24.1" :type '(repeat (string :tag "Report"))) +(defcustom org-export-taskjuggler-default-global-header + "" + "Default global header for the project. This goes before +project declaration, and might be useful for early macros" + :group 'org-export-taskjuggler + :version "24.1" + :type '(string :tag "Preamble")) + (defcustom org-export-taskjuggler-default-global-properties "shift s40 \"Part time shift\" { workinghours wed, thu, fri off @@ -331,11 +339,6 @@ defined in `org-export-taskjuggler-default-reports'." (setcar tasks (push (cons "version" version) task)))) (with-current-buffer buffer (erase-buffer) - (org-clone-local-variables old-buffer "^org-") - (org-taskjuggler-open-project (car tasks)) - (insert org-export-taskjuggler-default-global-properties) - (insert "\n") - (dolist (resource resources) (org-install-letbind) ;; create local variables for all options, to make sure all called ;; functions get the correct information @@ -344,6 +347,12 @@ defined in `org-export-taskjuggler-default-reports'." (plist-get opt-plist (car x)))) org-export-plist-vars) + (org-clone-local-variables old-buffer "^org-") + (insert org-export-taskjuggler-default-global-header) + (org-taskjuggler-open-project (car tasks)) + (insert org-export-taskjuggler-default-global-properties) + (insert "\n") + (dolist (resource resources) (let ((level (cdr (assoc "level" resource)))) (org-taskjuggler-close-maybe level) (org-taskjuggler-open-resource resource) -- 1.7.11.3