Bastien wrote: > Hi Ken, > Ken Mankoff <mank...@gmail.com> writes:
>> But I'm still confused what 'org-set-effort' expects/interprets >> compared to 'org-clock-modify-effort-estimate'. Any clarification >> will be much appreciated. > `org-set-effort' allows you to _set_ the effort value. > `org-clock-modify-effort-estimate' allows you to either set the effort > value (e.g. if you enter 1:30, the old value will be replaced by this > one) or to increment/decrement the effort value by using +mm or > +n[hdwmy] -- e.g. entering +1d will increment the current value by 1 > day. "1 day" is interpreted depending on `org-effort-durations', > which see. I think the problem is slightly more complicated. org-set-effort does: read some effort duration (org-entry-put nil "Effort" duration-we-just-read) org-clock-modify-effort-estimate does: read some effort duration (org-duration-string-to-minutes value) convert this duration in minutes back to a string (org-minutes-to-clocksum-string minutes-corresponding-to-value) (org-entry-put nil "Effort" duration-we-just-calculated) So org-set-effort doesn't do any conversion of the effort string we enter. org-clock-modify-effort-estimate does do conversion. However, it does it badly. org-duration-string-to-minutes always uses org-effort-durations to convert the input string to minutes. However, org-minutes-to-clocksum-string /only/ uses org-effort-durations if org-time-clocksum-use-effort-durations is non-nil (not the default). The problem boils down to: (let ((org-time-clocksum-use-effort-durations nil)) (= (org-duration-string-to-minutes "3d 2h") ;; what the user entered (org-duration-string-to-minutes ;; what gets inserted (org-minutes-to-clocksum-string (org-duration-string-to-minutes "3d 2h"))))) => nil (let ((org-time-clocksum-use-effort-durations t)) (= (org-duration-string-to-minutes "3d 2h") ;; what the user entered (org-duration-string-to-minutes ;; what gets inserted (org-minutes-to-clocksum-string (org-duration-string-to-minutes "3d 2h"))))) => t I would argue that (org-duration-string-to-minutes (org-minutes-to-clocksum-string (org-duration-string-to-minutes some-value))) Should be a no-op. But that is only the case if org-time-clocksum-use-effort-durations is t. Lawrence -- Lawrence Mitchell <we...@gmx.li>