Kosyrev Serge <_deepf...@feelingofgreen.ru> writes:

> * ox-taskjuggler.el (org-taskjuggler-trim-ids-from-titles): new custom

You should capitalize after the colon and end with a period.
Also, custom → defcustom (IMO).

> (org-taskjuggler--build-task): trim task ids from titles, when the new
> custom variable asks for this (enabled by default).

As above.

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

I don’t think you need to capitalize nil.  Also, why is it plural?

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

I would use eq, but I’m not sure it’s important.  Why does
org-taskjuggler-get-name potentially return the ID?  Isn’t that closer to
the misbehavior here?  (Keep in mind I’m not familiar with the codebase in
question).

Rasmus

-- 
And I faced endless streams of vendor-approved Ikea furniture. . .




Reply via email to