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

2015-11-12 Thread Kosyrev Serge
Rasmus  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



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

2015-11-12 Thread Rasmus
Kosyrev Serge <_deepf...@feelingofgreen.ru> writes:

> * 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.

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

-- 
Vote for proprietary math!




[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