Re: [O] Changes to contrib

2015-11-09 Thread Kosyrev Serge
Rasmus  writes:
> Serge Kosyrev <_deepf...@feelingofgreen.ru> writes:
>> I'm not sure how wise it would be to raise barriers for contribution,
>> given the current state of the thing..
>
> I don't know what state you refer to.

Well, I couldn't use it, without significant tweaking.

It feels as if the thing doesn't have a maintainer and slowly decomposes.

>>> Some quick comments from skimming your code (note, I have no idea what a
>>> taskjuggler is):
>>>
>>> I don’t know what you refer to explicitly.  But that should be fixed, I
>>> guess.
>>
>> I'm sorry, what should be?
>
> Sorry, I was referring to this quote by you, which seems to have
> disappeared:
>
 (One immediate nitpick, of course, is that none of the additions
  are documented..)

That is true, yes.

The question is.. the only documentation for ox-taskjuggler that exists
in Worg, seems to only cover the surface aspects of export -- none of
the existing documentation touches on the multitude of details that the
existing code does involve itself with.

The point I'm trying to make, is that producing some documentation that
would cover the details (that one actually expects to be covered, coming
from the TaskJuggler background) seems like a separate task.

That is, not in scope of my little "tweak it to work for myself" series..

>>> I think you add some more taskjuggle keywords/properties for
>>> example.

I do, indeed -- and they are undocumented in a matter that is similar to
the 80% of pre-existing properties.

>> [...]
>>> Also, you introduce a dependency on subr-x, which may or may not be an
>>> issue since it’s in contrib.
>>
>> I'm sorry, I'm not sure what do you mean?  I looked at subr-x.el, and
>> I didn't find any reference to any of those functions..
>
> You use string-join, which is in subr-x.  I think subr-x was not a
> dependency before.

Oh, indeed -- missed that!

What should I do about it?

>>> org-export-map-special-nodes and org-element-multivalued-property are not
>>> proper names, as they will supposedly only be used in ox-taskjuggler.
>>
>> Well, the functions themselves are supposed to be generic.
>>
>> There are two ways to name a function, in my mind:
>>
>>   - by intended application
>>   - by what it does
>>
>> ..it's just that I chose the second.. in the futile hope that someone,
>> sometime will move/use them. : -)
>
> Then they are in the wrong library.
>
>> If you deem it not to be an appropriate course of thought, I will
>> change the name, sure.
>
> At this point, they lack appropriate names.

Understood, will rename, then.

-- 
с уважениeм / respectfully,
Косырев Сергей



Re: [O] Changes to contrib

2015-11-09 Thread Kosyrev Serge
Hi,

Rasmus <ras...@gmx.us> writes:
> Kosyrev Serge <_deepf...@feelingofgreen.ru> writes:
>> The question is.. the only documentation for ox-taskjuggler that exists
>> in Worg, seems to only cover the surface aspects of export -- none of
>> the existing documentation touches on the multitude of details that the
>> existing code does involve itself with.
>
> OK.  There should be docstring and potentially comments, if necessary.
> Worg is a separate issue.

OK, will do.

>>> You use string-join, which is in subr-x.  I think subr-x was not a
>>> dependency before.
>>
>> Oh, indeed -- missed that!
>>
>> What should I do about it?
>
> I’d just use mapconcat TBH, since it’s just one place as I recall.
>
> (equal (string-join '("a" "b") " ")
>(mapconcat 'identity '("a" "b") " "))
>
>> Understood, will rename, then.

All done, sending mails..

-- 
с уважениeм / respectfully,
Косырев Сергей



[O] Changes to contrib

2015-11-08 Thread Kosyrev Serge
Good day folks!

I have tried to use ox-taskjuggler and faced what appeared to be a
mountain of.. infelicities and semi-broken functionality.

A need shapes the man, so I plowed through the most direct obstacles,
and finally managed to get what I want from the beast -- mostly by
adding direct Org-property -> TJ-attribute export pathways.

I don't know what is the proper way to submit patches for the contrib/
directory, so I made a branch on github:

  https://github.com/deepfire/org-mode/commits/ox-taskjuggler-fixes

Please, do tell how you would like to proceed from there.

(One immediate nitpick, of course, is that none of the additions
 are documented..)

-- 
с уважениe / respectfully,
Косырев Сергей



Re: [O] [PATCH 7/8] ox-taskjuggler.el: allow 'priority' to be a directly-specified integer

2015-11-10 Thread Kosyrev Serge
Aaron Ecay <aarone...@gmail.com> writes:
> 2015ko azaroak 8an, Kosyrev Serge-ek idatzi zuen:
>> 
>> * ox-taskjuggler.el (org-taskjuggler--build-task):  fix priority 
>> specification
>> by allowing it to be directly passed down, in case it parses as an integer.
>> ---
>>  contrib/lisp/ox-taskjuggler.el | 12 +---
>>  1 file changed, 9 insertions(+), 3 deletions(-)
>> 
>> diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
>> index 44ffeb6..d49db62 100644
>> --- a/contrib/lisp/ox-taskjuggler.el
>> +++ b/contrib/lisp/ox-taskjuggler.el
>> @@ -875,10 +875,16 @@ a unique id will be associated to it."
>> (org-taskjuggler-get-end task))
>>(org-element-property :PERIOD task)
>>   (priority
>> -  (let ((pri (org-element-property :priority task)))
>> +  (let ((pri (org-element-property :PRIORITY task)))
>>  (and pri
>> - (max 1 (/ (* 1000 (- org-lowest-priority pri))
>> -   (- org-lowest-priority 
>> org-highest-priority)))
>> +;; The exported task priority can be either specified
>> +;; via the Org priority mechahism (which is currently 
>> broken),
>
> Can you say more about what breakage you mean?  Is it something that can
> be easily fixed?

Perhaps I was unclear in this message -- it's not the Org's priority
mechanism that is broken, it's the way ox-taskjuggler uses it that is.

Org specifies priorities via a list of enums, whereas TJ expects an
integer in the range 0-1000.

The quoted little piece of math in ox-taskjuggler tried to provide a
mapping, but failed and I couldn't figure out how to make it work --
mainly because I couldn't understand how it was /supposed/ to work.

Hence I made a shortcut.

-- 
с уважениeм / respectfully,
Косырев Сергей



Re: [O] [PATCH] ox-taskjuggler.el: allow direct 'depends' specification

2015-11-10 Thread Kosyrev Serge
Aaron Ecay  writes:
> Hi Kosyrev,
>> @@ -301,7 +301,7 @@ but before any resource and task declarations."
>>:type '(string :tag "Preamble"))
>>  
>>  (defcustom org-taskjuggler-valid-task-attributes
>
> Is this an open-ended list that an average user could meaningfully add
> to?  If not, perhaps it should be a defconst.  (I don’t know anything
> about the taskjuggler format, so I’m sure whatever decision you make
> will be OK.)

Generally speaking, TaskJuggler own "attributes" and "properties" are
very numerous.  Suffice to point to the documentation:

  http://taskjuggler.org/tj3/manual/

Org is only able to provide a very limited amount of those, and the
approach it takes is by white-listing the properties that ought to
"pass through" from Org to TJP files.

So, naturally, whenever one faces a limitation in ox-taskjuggler,
the desire to extend the list arises.

I'm not sure how this relates to an average user, to be honest,
and whether I've at all helped with your question..

How do we proceed?

-- 
с уважениeм / respectfully,
Косырев Сергей



Re: [O] [PATCH 5/8] ox-taskjuggler.el: add 'org-taskjuggler-multivalued-property'

2015-11-12 Thread Kosyrev Serge
Rasmus <ras...@gmx.us> writes:
> Kosyrev Serge <_deepf...@feelingofgreen.ru> writes:
>> +(defun org-taskjuggler-multivalued-property (property element)
>> +  "Obtain PROPERTY of ELEMENT, treating it as a multi-valued property.
>
> Isn't the docstring a bit tautological?  Does property mean the same in
> the beginning and the end of the sentence?  Sorry if I’m missing something
> obvious here...

The first occurence "binds" the parameter name within the semantic
structure of the sentence, so to speak, whereas the second one provides
the description of what is done to the obtained entity.

Coming from the Common Lisp background, the uppercased argument names
are often used for this kind of semantic "binding", and in these cases
the need to explain what is done to the "bound" names isn't obviated.

It's merely a cultural default, so I have no particularly strong feeling
about the docstring.

If you have a better idea, we can discuss that : -)

-- 
с уважениeм,
Косырев Сергей
руководитель отдела технологий виртуализации
Positive Technologies



[O] [PATCH 0/8] A bunch of fixes for contrib/ox-taskjuggler.el

2015-11-09 Thread Kosyrev Serge
Good evening, folks!

This is a bunch of solutions for the most direct obstacles that
I encountered, mostly additions of direct Org-property -> TJ-attribute
export pathways.

Kosyrev Serge (8):
  ox-taskjuggler.el:  allow direct 'leaves' specification
  ox-taskjuggler.el:  factor 'org-export-map-special-nodes'
  ox-taskjuggler.el:  :POST-INCLUDES lists files to include post-section
  ox-taskjuggler.el:  :PROJECT-{END,DURATION} project attribute
  ox-taskjuggler.el:  add 'org-taskjuggler-multivalued-property'
  ox-taskjuggler.el:  interpret 'allocate' as a multivalued-property
  ox-taskjuggler.el:  allow 'priority' to be a directly-specified
integer
  ox-taskjuggler.el:  allow trimming the task ID from its title

 contrib/lisp/ox-taskjuggler.el | 122 +
 1 file changed, 88 insertions(+), 34 deletions(-)

-- 
2.5.0



[O] [PATCH 3/8] ox-taskjuggler.el: :POST-INCLUDES lists files to include post-section

2015-11-09 Thread Kosyrev Serge
* ox-taskjuggler.el (org-taskjuggler-project-plan):  allow for include
directives to be inserted after resource and task sections.
---
 contrib/lisp/ox-taskjuggler.el | 48 ++
 1 file changed, 34 insertions(+), 14 deletions(-)
diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 2cf2c78..427fb6e 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -665,19 +665,35 @@ Return complete project plan as a string in TaskJuggler 
syntax."
  main-resources info)))
(concat
 (if main-resources
-(mapconcat
- (lambda (resource) (org-taskjuggler--build-resource resource 
info))
- main-resources "")
+   (concat
+(mapconcat
+ (lambda (resource) (org-taskjuggler--build-resource resource 
info))
+ main-resources "")
+;; Allow resource-tagged node have a 'post-includes' property,
+;; that will instruct the exporter to insert an include directive
+;; after all the resource sections.
+(let ((post-includes (apply 'concat
+(org-taskjuggler-map-special-nodes
+ org-taskjuggler-resource-tag tree
+ (lambda (hl) (org-element-property 
:POST-INCLUDES hl))
+  (when post-includes
+(apply 'concat (mapcar (lambda (inc) (format "include '%s'\n" 
inc))
+   (org-split-string post-includes))
   (format "resource %s \"%s\" {\n}\n" (user-login-name) 
user-full-name))
 ;; 5. Insert tasks.
-(let ((main-tasks
-   ;; If `org-taskjuggler-keep-project-as-task' is
-   ;; non-nil, there is only one task.  Otherwise, every
-   ;; direct children of PROJECT is a top level task.
-   (if org-taskjuggler-keep-project-as-task (list project)
- (or (org-element-map (org-element-contents project) 'headline
-   'identity info nil 'headline)
- (error "No task specified")
+(let* ((main-tasks
+   ;; If `org-taskjuggler-keep-project-as-task' is
+   ;; non-nil, there is only one task.  Otherwise, every
+   ;; direct children of PROJECT is a top level task.
+   (if org-taskjuggler-keep-project-as-task (list project)
+   (or (org-element-map (org-element-contents project) 
'headline
+ 'identity info nil 'headline)
+   (error "No task specified"
+  ;; Allow task-tagged node have a 'post-includes' property,
+  ;; that will instruct the exporter to insert an include directive
+  ;; after all the task sections.
+  (post-includes (mapconcat (lambda (hl) (org-element-property 
:POST-INCLUDES hl))
+main-tasks " ")))
   ;; Assign a unique ID to each task.  Add it to
   ;; `:taskjuggler-unique-ids' property in INFO.
   (setq info
@@ -694,9 +710,13 @@ Return complete project plan as a string in TaskJuggler 
syntax."
  (car main-tasks) :ALLOCATE
  (or (org-taskjuggler-get-id (car main-resources) info)
  (user-login-name
-  (mapconcat
-   (lambda (task) (org-taskjuggler--build-task task info))
-   main-tasks ""))
+ (concat
+  (mapconcat
+   (lambda (task) (org-taskjuggler--build-task task info))
+   main-tasks "")
+  (when post-includes
+(apply 'concat (mapcar (lambda (inc) (format "include '%s'\n" inc))
+   (org-split-string post-includes))
 ;; 6. Insert reports.  If no report is defined, insert default
 ;;reports.
 (let ((main-reports
-- 
2.5.0



[O] [PATCH 6/8] ox-taskjuggler.el: interpret 'allocate' as a multivalued-property

2015-11-09 Thread Kosyrev Serge

* ox-taskjuggler.el (org-taskjuggler--build-task):  interpret 'allocate'
as a multivalued property, to pave the way for future completion-enabled
entry of this property.
---
 contrib/lisp/ox-taskjuggler.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 8036af3..44ffeb6 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -856,7 +856,7 @@ All valid attributes from TASK are inserted.  If TASK 
defines
 a property \"task_id\" it will be used as the id for this task.
 Otherwise it will use the ID property.  If neither is defined
 a unique id will be associated to it."
-  (let* ((allocate (org-element-property :ALLOCATE task))
+  (let* ((allocate (org-taskjuggler-multivalued-property :ALLOCATE task))
  (complete
   (if (eq (org-element-property :todo-type task) 'done) "100"
 (org-element-property :COMPLETE task)))
@@ -892,8 +892,8 @@ a unique id will be associated to it."
   (format "  purge %s\n  allocate %s\n"
   ;; Compatibility for previous TaskJuggler versions.
   (if (>= org-taskjuggler-target-version 3.0) "allocate"
-"allocations")
-  allocate))
+ "allocations")
+  (mapconcat 'identity allocate ", ")))
  (and complete (format "  complete %s\n" complete))
  (and effort
   (format "  effort %s\n"
-- 
2.5.0



[O] [PATCH 2/8] ox-taskjuggler.el: factor 'org-export-map-special-nodes'

2015-11-09 Thread Kosyrev Serge

* ox-taskjuggler.el (org-taskjuggler-map-special-nodes):
new function to capture mapping over tagged special nodes.
(org-taskjuggler-project-plan): factor to use the new function.
---
 contrib/lisp/ox-taskjuggler.el | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index ce4a8ab..2cf2c78 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -625,6 +625,12 @@ doesn't include leading \"depends\"."
 
 

 ;;; Translator Functions
+(defun org-taskjuggler-map-special-nodes (tag tree f)
+  (org-element-map tree 'headline
+(lambda (hl)
+  (and (member tag (org-export-get-tags hl info))
+  (funcall f hl)))
+info nil 'headline))
 
 (defun org-taskjuggler-project-plan (contents info)
   "Build TaskJuggler project plan.
@@ -647,13 +653,10 @@ Return complete project plan as a string in TaskJuggler 
syntax."
 ;; `org-taskjuggler-resource-tag'.  Only gather top level
 ;; resources.
 (apply 'append
-   (org-element-map tree 'headline
- (lambda (hl)
-   (and (member org-taskjuggler-resource-tag
-(org-export-get-tags hl info))
-(org-element-map (org-element-contents hl) 
'headline
-  'identity info nil 'headline)))
- info nil 'headline
+  (org-taskjuggler-map-special-nodes
+   org-taskjuggler-resource-tag tree
+   (lambda (hl) (org-element-map (org-element-contents hl) 
'headline
+  'identity info nil 'headline))
;; Assign a unique ID to each resource.  Store it under
;; `:taskjuggler-unique-ids' property in INFO.
(setq info
-- 
2.5.0



[O] [PATCH 8/8] ox-taskjuggler.el: allow trimming the task ID from its title

2015-11-09 Thread Kosyrev Serge

* ox-taskjuggler.el (org-taskjuggler-trim-ids-from-titles): new custom
(org-taskjuggler--build-task): trim task ids from titles, when the new
custom variable asks for this (enabled by default).
---
 contrib/lisp/ox-taskjuggler.el | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index d49db62..bca3dc1 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -374,6 +374,11 @@ task buckets, while still sharing the same resources pool."
   :group 'org-export-taskjuggler
   :type 'boolean)
 
+(defcustom org-taskjuggler-trim-ids-from-titles t
+  "Non-NIL trims the part detected as prefix from resulting task titles."
+  :group 'org-export-taskjuggler
+  :type 'boolean)
+
 
 

 ;;; Hooks
@@ -887,9 +892,16 @@ a unique id will be associated to it."
   (- org-lowest-priority 
org-highest-priority)
 (concat
  ;; Opening task.
- (format "task %s \"%s\" {\n"
- (org-taskjuggler-get-id task info)
- (org-taskjuggler-get-name task))
+ (let* ((id   (org-taskjuggler-get-id task info))
+   (raw-name (org-taskjuggler-get-name task))
+   (id-len   (length id))
+   (raw-name-len (length raw-name))
+   (name (if org-taskjuggler-trim-ids-from-titles
+ (if (= raw-name-len id-len)
+ raw-name
+ (subseq raw-name (1+ id-len)))
+ raw-name)))
+   (format "task %s \"%s\" {\n" id name))
  ;; Add default attributes.
  (and depends
   (format "  depends %s\n"
-- 
2.5.0



[O] [PATCH 7/8] ox-taskjuggler.el: allow 'priority' to be a directly-specified integer

2015-11-09 Thread Kosyrev Serge

* ox-taskjuggler.el (org-taskjuggler--build-task):  fix priority specification
by allowing it to be directly passed down, in case it parses as an integer.
---
 contrib/lisp/ox-taskjuggler.el | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 44ffeb6..d49db62 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -875,10 +875,16 @@ a unique id will be associated to it."
(org-taskjuggler-get-end task))
   (org-element-property :PERIOD task)
  (priority
-  (let ((pri (org-element-property :priority task)))
+  (let ((pri (org-element-property :PRIORITY task)))
 (and pri
- (max 1 (/ (* 1000 (- org-lowest-priority pri))
-   (- org-lowest-priority org-highest-priority)))
+;; The exported task priority can be either specified
+;; via the Org priority mechahism (which is currently broken),
+;; or it can be specified directly -- by providing it as an 
integer.
+(let ((integer-pri (ignore-errors (parse-integer pri
+  (or integer-pri
+  (max 1
+   (/ (* 1000 (- org-lowest-priority pri))
+  (- org-lowest-priority 
org-highest-priority)
 (concat
  ;; Opening task.
  (format "task %s \"%s\" {\n"
-- 
2.5.0



[O] [PATCH] ox-taskjuggler.el: allow direct 'depends' specification

2015-11-09 Thread Kosyrev Serge

* ox-taskjuggler.el (org-taskjuggler-valid-task-attributes): add depends
to the list of valid task attributes
---
 contrib/lisp/ox-taskjuggler.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 2bd47e6..cfb28f2 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -301,7 +301,7 @@ but before any resource and task declarations."
   :type '(string :tag "Preamble"))
 
 (defcustom org-taskjuggler-valid-task-attributes
-  '(account start note duration endbuffer endcredit end
+  '(account depends start note duration endbuffer endcredit end
flags journalentry length limits maxend maxstart minend
minstart period reference responsible scheduling
startbuffer startcredit statusnote chargeset charge)
-- 
2.5.0



[O] [PATCH 1/8] ox-taskjuggler.el: allow direct 'leaves' specification

2015-11-09 Thread Kosyrev Serge

* ox-taskjuggler.el (org-taskjuggler-valid-resource-attributes): add leaves
to the list of valid resource attributes
---
 contrib/lisp/ox-taskjuggler.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index cfb28f2..ce4a8ab 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -327,7 +327,7 @@ list."
   :group 'org-export-taskjuggler)
 
 (defcustom org-taskjuggler-valid-resource-attributes
-  '(limits vacation shift booking efficiency journalentry rate
+  '(limits leaves vacation shift booking efficiency journalentry rate
   workinghours flags)
   "Valid attributes for Taskjuggler resources.
 If one of these appears as a property for a headline, it will be
-- 
2.5.0



[O] [PATCH 5/8] ox-taskjuggler.el: add 'org-taskjuggler-multivalued-property'

2015-11-09 Thread Kosyrev Serge

* ox-taskjuggler.el (org-taskjuggler-multivalued-property): new function
to operate on multivalued properties.
---
 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 82aaa7e..8036af3 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -836,6 +836,16 @@ channel."
;; Closing report.
"}\n"))
 
+(defun org-taskjuggler-multivalued-property (property element)
+  "Obtain PROPERTY of ELEMENT, treating it as a multi-valued property.
+
+See `org-entry-get-multivalued-property' for details."
+  (let ((prop (org-element-property property element)))
+(and prop
+(mapcar 'org-entry-restore-space
+(org-split-string prop
+  "[ \t]")
+
 (defun org-taskjuggler--build-task (task info)
   "Return a task declaration.
 
-- 
2.5.0



[O] [PATCH 4/8] ox-taskjuggler.el: :PROJECT-{END, DURATION} project attribute

2015-11-09 Thread Kosyrev Serge

* ox-taskjuggler.el (org-taskjuggler--build-project): Allow the project
end and duration to be specified via properties of the root node.
---
 contrib/lisp/ox-taskjuggler.el | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 427fb6e..82aaa7e 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -765,10 +765,13 @@ days from now."
   org-taskjuggler-default-project-version)
   (or (org-taskjuggler-get-start project)
   (format-time-string "%Y-%m-%d"))
-  (let ((end (org-taskjuggler-get-end project)))
+  ;; The 'project-end' and 'project-duration' root node properties 
allow
+  ;; the project end date / duration to be specified directly in the 
Org file.
+  (let ((end  (org-element-property :PROJECT-END project))
+(duration (org-element-property :PROJECT-DURATION project)))
 (or (and end (format "- %s" end))
-(format "+%sd"
-org-taskjuggler-default-project-duration
+(and duration (format "+%s" duration))
+(format "+%sd" org-taskjuggler-default-project-duration
;; Add attributes.
(org-taskjuggler--indent-string
 (org-taskjuggler--build-attributes
-- 
2.5.0



[O] [PATCH 7/8] ox-taskjuggler.el: allow 'priority' to be a directly-specified integer

2015-11-09 Thread Kosyrev Serge

* ox-taskjuggler.el (org-taskjuggler--build-task):  fix priority specification
by allowing it to be directly passed down, in case it parses as an integer.
---
 contrib/lisp/ox-taskjuggler.el | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 44ffeb6..d49db62 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -875,10 +875,16 @@ a unique id will be associated to it."
(org-taskjuggler-get-end task))
   (org-element-property :PERIOD task)
  (priority
-  (let ((pri (org-element-property :priority task)))
+  (let ((pri (org-element-property :PRIORITY task)))
 (and pri
- (max 1 (/ (* 1000 (- org-lowest-priority pri))
-   (- org-lowest-priority org-highest-priority)))
+;; The exported task priority can be either specified
+;; via the Org priority mechahism (which is currently broken),
+;; or it can be specified directly -- by providing it as an 
integer.
+(let ((integer-pri (ignore-errors (parse-integer pri
+  (or integer-pri
+  (max 1
+   (/ (* 1000 (- org-lowest-priority pri))
+  (- org-lowest-priority 
org-highest-priority)
 (concat
  ;; Opening task.
  (format "task %s \"%s\" {\n"
-- 
2.5.0