From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yann Hodique Subject: [PATCH v2 05/11] org-taskjuggler: introduce a global header, for early macros Date: Wed, 15 Aug 2012 21:11:51 +0200 Message-ID: <1345057917-69300-7-git-send-email-yann.hodique@gmail.com> References: <1345057917-69300-1-git-send-email-yann.hodique@gmail.com> Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1j0z-0004gs-Bv for emacs-orgmode@gnu.org; Wed, 15 Aug 2012 15:12:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1j0y-0002a0-6j for emacs-orgmode@gnu.org; Wed, 15 Aug 2012 15:12:25 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:38760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1j0x-0002VT-W7 for emacs-orgmode@gnu.org; Wed, 15 Aug 2012 15:12:24 -0400 Received: by mail-we0-f169.google.com with SMTP id s10so1410328wey.0 for ; Wed, 15 Aug 2012 12:12:23 -0700 (PDT) In-Reply-To: <1345057917-69300-1-git-send-email-yann.hodique@gmail.com> In-Reply-To: <1344164044-15059-1-git-send-email-yann.hodique@gmail.com> References: <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 a18cdf8..c997da7 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 @@ -332,11 +340,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 @@ -345,6 +348,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.4