From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: contrib/lisp/ox-taskjuggler.el patch Date: Mon, 29 Jun 2015 10:05:59 +0200 Message-ID: <87vbe7kkgo.fsf@nicolasgoaziou.fr> References: <1434905740.963429258@f367.i.mail.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9U3O-000659-Ef for emacs-orgmode@gnu.org; Mon, 29 Jun 2015 04:04:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9U3M-00033B-PJ for emacs-orgmode@gnu.org; Mon, 29 Jun 2015 04:04:34 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:52472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9U3M-00032k-FR for emacs-orgmode@gnu.org; Mon, 29 Jun 2015 04:04:32 -0400 In-Reply-To: <1434905740.963429258@f367.i.mail.ru> (=?utf-8?B?ItCT0LvQtdCx?= =?utf-8?B?INCR0L7RgNC+0LTRg9C70Y8iJ3M=?= message of "Sun, 21 Jun 2015 19:55:40 +0300") 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: =?utf-8?B?0JPQu9C10LEg0JHQvtGA0L7QtNGD0LvRjw==?= Cc: emacs-orgmode@gnu.org Hello, =D0=93=D0=BB=D0=B5=D0=B1 =D0=91=D0=BE=D1=80=D0=BE=D0=B4=D1=83=D0=BB=D1=8F <= mr.reg@mail.ru> writes: > I want to pull some changes in contrib/lisp/ox-taskjuggler.el file > There is patch in attach, created with git format-patch > Manually written change log here: Thank you for the patch. Comments follow. > ox-taskjuggler.el: Minor enhancements in taskjuggler export It would be better to split these enhancements into as many patches. > * contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el > (org-taskjuggler--build-project): added new custom variable > `org-taskjuggler-default-project-configuration' that can be used to > configure additional project fields. You need to capitalize the sentence. Also, it looks like you're using an outdated "ox-taskjuggler.el". See below. > (org-taskjuggler-get-end): added support for `end' property instead > only standard org deadline value. Ditto. > (org-taskjuggler--build-task): added support for multiple allocations, > specified by separators. Not sure about the usefulness of this one. According to , allocate task1, task2, task3 is valid. There's apparently no need to split the task list. > - (and deadline (org-timestamp-format deadline "%Y-%02m-%02d")))) > + (or > + (and deadline (org-timestamp-format deadline "%Y-%02m-%02d")) > + (and (memq 'end org-taskjuggler-valid-task-attributes) > + (org-element-property :END item))))) You don't need to check `org-taskjuggler-valid-task-attributes' here since you're not applying it to a task. > channel. If no start date is specified, start today. If no end > date is specified, end `org-taskjuggler-default-project-duration' > days from now." > - (format "project %s \"%s\" \"%s\" %s %s {\n}\n" > + (format "project %s \"%s\" \"%s\" %s %s {%s\n}\n" > (org-taskjuggler-get-id project info) > (org-taskjuggler-get-name project) > ;; Version is obtained through :TASKJUGGLER_VERSION: > @@ -726,7 +734,10 @@ days from now." > (format-time-string "%Y-%m-%d")) > (let ((end (org-taskjuggler-get-end project))) > (or (and end (format "- %s" end)) > - (format "+%sd" org-taskjuggler-default-project-duration)= )))) > + (format "+%sd" org-taskjuggler-default-project-duration)= )) > + (mapconcat > + 'org-element-normalize-string > + org-taskjuggler-default-project-configuration ""))) Current definition for org-taskjuggler--build-project is (concat ;; Opening project. (format "project %s \"%s\" \"%s\" %s %s {\n" (org-taskjuggler-get-id project info) (org-taskjuggler-get-name project) ;; Version is obtained through :TASKJUGGLER_VERSION: ;; property or `org-taskjuggler-default-project-version'. (or (org-element-property :VERSION project) org-taskjuggler-default-project-version) (or (org-taskjuggler-get-start project) (format-time-string "%Y-%m-%d")) (let ((end (org-taskjuggler-get-end project))) (or (and end (format "- %s" end)) (format "+%sd" org-taskjuggler-default-project-duration)))) ;; Add attributes. (org-taskjuggler--indent-string (org-taskjuggler--build-attributes project org-taskjuggler-valid-project-attributes)) ;; Closing project. "}\n") Is `org-taskjuggler-default-project-configuration' needed considering the attributes part above? > - (format " purge %s\n allocate %s\n" > - ;; Compatibility for previous TaskJuggler versions. > - (if (>=3D org-taskjuggler-target-version 3.0) "allocat= e" > - "allocations") > - allocate)) > + (concat (format " purge %s\n" > + ;; Compatibility for previous TaskJuggler versions. > + (if (>=3D org-taskjuggler-target-version 3.0) "allocate" > + "allocations")) > + ;;support for several allocations divided by separator > + (mapconcat #'(lambda (allocation) > + (format " allocate %s\n" allocation)) > + (org-split-string allocate "[ ,]* +") > + ""))) Is it really useful? Also, there's no need for #' in front of a lambda. Regards, --=20 Nicolas Goaziou