From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yann Hodique Subject: [PATCH v2 03/11] org-taskjuggler: make use of org properties Date: Wed, 15 Aug 2012 21:11:48 +0200 Message-ID: <1345057917-69300-4-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]:39413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1j0s-0004MB-L4 for emacs-orgmode@gnu.org; Wed, 15 Aug 2012 15:12:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1j0r-0002Xp-EI for emacs-orgmode@gnu.org; Wed, 15 Aug 2012 15:12:18 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:64351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1j0r-0002WH-7e for emacs-orgmode@gnu.org; Wed, 15 Aug 2012 15:12:17 -0400 Received: by mail-wi0-f171.google.com with SMTP id hq4so4695497wib.12 for ; Wed, 15 Aug 2012 12:12:17 -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-taskjuggler-date): new function, produce a taskjuggler-compatible date (org-taskjuggler-components): make use of SCHEDULED/DEADLINE properties infer start and end date from SCHEDULED/DEADLINE information --- lisp/org-taskjuggler.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el index 529cda0..93f0cc7 100644 --- a/lisp/org-taskjuggler.el +++ b/lisp/org-taskjuggler.el @@ -138,8 +138,6 @@ ;; :END: ;; ;;;; * TODO -;; - Use SCHEDULED and DEADLINE information (not just start and end -;; properties). ;; - Look at org-file-properties, org-global-properties and ;; org-global-properties-fixed ;; - What about property inheritance and org-property-inherit-p? @@ -385,6 +383,10 @@ with the TaskJuggler GUI." (save-excursion (and (org-up-heading-safe) (org-entry-get (point) "ORDERED")))) +(defun org-taskjuggler-date (date) + (let ((time (parse-time-string date))) + (format "%d-%02d-%02d" (nth 5 time) (nth 4 time) (nth 3 time)))) + (defun org-taskjuggler-components () "Return an alist containing all the pertinent information for the current node such as the headline, the level, todo state @@ -396,6 +398,12 @@ information, all the properties, etc." (replace-regexp-in-string "\"" "\\\"" (nth 4 components) t t)) ; quote double quotes in headlines (parent-ordered (org-taskjuggler-parent-is-ordered-p))) + (let ((scheduled (assoc "SCHEDULED" props)) + (deadline (assoc "DEADLINE" props))) + (when scheduled + (push (cons "start" (org-taskjuggler-date (cdr scheduled))) props)) + (when deadline + (push (cons "end" (org-taskjuggler-date (cdr deadline))) props))) (push (cons "level" level) props) (push (cons "headline" headline) props) (push (cons "parent-ordered" parent-ordered) props))) -- 1.7.11.4