all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ox-taskjuggler : Correct a small typo and deal with Scheduled and deadline in task
@ 2013-04-19 16:55 Baptiste
  2013-04-20  7:21 ` Bastien
  2013-04-21 20:20 ` Christian Egli
  0 siblings, 2 replies; 6+ messages in thread
From: Baptiste @ 2013-04-19 16:55 UTC (permalink / raw)
  To: Org-mode

Hi,

hereafter a small typo correction,  plus the capability to use DEADLINE:
and SCHEDULED: in task (special export format for milestones).
--

: ~^v^~ Bat

ox-taskjuggler : Correct a small typo and deal with Scheduled and deadline in task
diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 16f0e8d..113aa29 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -754,16 +754,18 @@ 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))
+           ((and start) (format "  start %s\n" start))
+           ((and 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)))
@@ -790,7 +800,7 @@ a unique id will be associated to it."
                   (let* ((minutes (org-duration-string-to-minutes effort))
                          (hours (/ minutes 60.0)))
                     (format "%.1fh" hours))))
-     (and priority (format "  priority %s\n" complete))
+     (and priority (format "  priority %s\n" priority))
      (and milestone "  milestone\n")
      ;; Add other valid attributes.
      (org-taskjuggler--indent-string

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: ox-taskjuggler : Correct a small typo and deal with Scheduled and deadline in task
  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
  1 sibling, 0 replies; 6+ messages in thread
From: Bastien @ 2013-04-20  7:21 UTC (permalink / raw)
  To: Baptiste; +Cc: Org-mode

Hi Baptiste,

Baptiste <bateast@bat.fr.eu.org> writes:

> hereafter a small typo correction,  plus the capability to use DEADLINE:
> and SCHEDULED: in task (special export format for milestones).

I applied the code typo fix, thanks!
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=774b53

As for the other part, I'll let Christian review/apply it.
If you can, send this change as a git commit with git format-patch,
with a proper changelog, that's far easier for the reviewer.

See http://orgmode.org/worg/org-contribute.html#sec-4-2

Best,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ox-taskjuggler : Correct a small typo and deal with Scheduled and deadline in task
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Christian Egli @ 2013-04-21 20:20 UTC (permalink / raw)
  To: emacs-orgmode

Hi Baptiste

Thanks for the patch. It fixes a pretty bad oversight that you currently
apparently cannot define a start and an end using SCHEDULED and DEADLINE
(I thought this worked in the old exporter and was maybe lost in the
translation). I would like to use the patch but there are a couple of
issues:

Baptiste <bateast@bat.fr.eu.org> writes:

>           (effort (org-element-property :EFFORT task))
> +         (start (org-taskjuggler-get-start task))
> +         (end (org-taskjuggler-get-end task))

This is obviously OK.

> @@ -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))

Are you saying that if we have a milestone, a start and an end date we
should define the start and use the end date as a maxend? This seems
like an interesting approach. Unfortunately currently `milestone' is
true only if there is not both and start and an end date. We should
probably also change the definition of milestone (see
http://orgmode.org/cgit.cgi/org-mode.git/tree/contrib/lisp/ox-taskjuggler.el#n757).

> +           ((and start) (format "  start %s\n" start))

This looks a bit fishy. Shouldn't this be 

((start) (format "  start %s\n" start))

> +           ((and end) (format "  start %s\n" end))))
Ditto

Also we should probably change the definition of
`org-taskjuggler-get-start' to also look for a "start" attribute but
that's another story.

Can you fix these issues and resend?

Thanks
Christian

-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ox-taskjuggler : Correct a small typo and deal with Scheduled and deadline in task
  2013-04-21 20:20 ` Christian Egli
@ 2013-04-21 22:13   ` Bastien
  2013-04-22  7:42     ` Christian Egli
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2013-04-21 22:13 UTC (permalink / raw)
  To: Christian Egli; +Cc: emacs-orgmode

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))

Otherwise (start) will bite as not being a function.

>> +           ((and end) (format "  start %s\n" end))))
> Ditto

-- 
 Bastien

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ox-taskjuggler : Correct a small typo and deal with Scheduled and deadline in task
  2013-04-21 22:13   ` Bastien
@ 2013-04-22  7:42     ` Christian Egli
  2013-04-22  9:20       ` Baptiste
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Egli @ 2013-04-22  7:42 UTC (permalink / raw)
  To: emacs-orgmode

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.

-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ox-taskjuggler : Correct a small typo and deal with Scheduled and deadline in task
  2013-04-22  7:42     ` Christian Egli
@ 2013-04-22  9:20       ` Baptiste
  0 siblings, 0 replies; 6+ messages in thread
From: Baptiste @ 2013-04-22  9:20 UTC (permalink / raw)
  To: Org Mode dev list

[-- 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-22  8:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.