emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Baptiste <bateast@bat.fr.eu.org>
To: Org Mode dev list <emacs-orgmode@gnu.org>
Subject: Re: ox-taskjuggler : Correct a small typo and deal with Scheduled and deadline in task
Date: Mon, 22 Apr 2013 11:20:57 +0200	[thread overview]
Message-ID: <87r4i33p5h.fsf@bat.fr.eu.org> (raw)
In-Reply-To: <877gjvvwni.fsf@sbs.ch> (Christian Egli's message of "Mon, 22 Apr 2013 09:42:41 +0200")

[-- Attachment #1: Type: text/plain, Size: 834 bytes --]

Hi,

you will find hereafter the patch after the little cleanup.

BTW, there is a  way (by code reading, not tested)  to force a milestone
with both  start and end : if  I am not  wrong, you may use  a :milestone
property of an org-entry to create a milestone task.

Not to  say that  it is not  advised to both  use :start  properties and
:SCHEDULED mechanism  in an  org entry  (you would  end with two /start/
elements in tj3).

*Le lun., avril 22 2013, Christian Egli a écrit*

        Bastien <bzg@gnu.org> writes:

  > Hi Baptiste and Christian,
  >
  > Christian Egli <christian.egli@sbs.ch> writes:
  >
  >> This looks a bit fishy. Shouldn't this be
  >>
  >> ((start) (format "  start %s\n" start))
  >
  > I guess this should be
  >
  >  (start (format "  start %s\n" start))

        Doh, yes of course.
--

: ~^v^~ Bat


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-taskjuggler.el-use-SCHEDULED-and-DEADLINE-as-star.patch --]
[-- Type: text/x-diff, Size: 1893 bytes --]

From d36be8faf6ecbc722d75950f5bc664f2b9d87e27 Mon Sep 17 00:00:00 2001
From: Baptiste Fouques <bateast@bat.fr.eu.org>
Date: Mon, 22 Apr 2013 10:59:15 +0200
Subject: [PATCH] ox-taskjuggler.el: use :SCHEDULED and :DEADLINE as start and
 end for tasks

as a special behavior, for milestones, if both :SCHEDULED and :DEADLINE ar specified, then :SCHEDULED will be mark as the milestone date, and :DEADLINE will be checked against actual scheduled date by TJ3.

TINYCHANGE
---
 contrib/lisp/ox-taskjuggler.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 4724ec3..2c1dee7 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -754,6 +754,8 @@ a unique id will be associated to it."
             (org-element-property :COMPLETE task)))
          (depends (org-taskjuggler-resolve-dependencies task info))
          (effort (org-element-property :EFFORT task))
+         (start (org-taskjuggler-get-start task))
+         (end (org-taskjuggler-get-end task))
          (milestone
           (or (org-element-property :MILESTONE task)
               (not (or (org-element-map (org-element-contents task) 'headline
@@ -775,6 +777,14 @@ a unique id will be associated to it."
              (org-taskjuggler-get-id task info)
              (org-taskjuggler-get-name task))
      ;; Add default attributes.
+     (and milestone
+          (cond
+           ((and start end) (format "  start %s\n  maxend %s\n" start end))
+           (start (format "  start %s\n" start))
+           (end (format "  start %s\n" end))))
+     (and start (not milestone) (format "  start %s\n" start))
+     (and end (not milestone) (format "  end %s\n" end))
+
      (and depends
           (format "  depends %s\n"
                   (org-taskjuggler-format-dependencies depends task info)))
--
1.8.1.2

      reply	other threads:[~2013-04-22  8:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19 16:55 ox-taskjuggler : Correct a small typo and deal with Scheduled and deadline in task Baptiste
2013-04-20  7:21 ` Bastien
2013-04-21 20:20 ` Christian Egli
2013-04-21 22:13   ` Bastien
2013-04-22  7:42     ` Christian Egli
2013-04-22  9:20       ` Baptiste [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r4i33p5h.fsf@bat.fr.eu.org \
    --to=bateast@bat.fr.eu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).