From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Mitchell Subject: Re: Effort entry and confusing effort estimates Date: Tue, 21 May 2013 12:52:58 +0100 Message-ID: <8761yc5z39.fsf@gmx.li> References: <87r4h0ehw1.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uel7z-0000aP-FA for emacs-orgmode@gnu.org; Tue, 21 May 2013 07:53:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uel7u-0000Db-7r for emacs-orgmode@gnu.org; Tue, 21 May 2013 07:53:15 -0400 Received: from plane.gmane.org ([80.91.229.3]:59800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uel7u-0000Bu-1A for emacs-orgmode@gnu.org; Tue, 21 May 2013 07:53:10 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Uel7q-0001rp-43 for emacs-orgmode@gnu.org; Tue, 21 May 2013 13:53:06 +0200 Received: from e4300lm.epcc.ed.ac.uk ([129.215.63.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 May 2013 13:53:06 +0200 Received: from wence by e4300lm.epcc.ed.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 May 2013 13:53:06 +0200 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: emacs-orgmode@gnu.org Bastien wrote: > Hi Ken, > Ken Mankoff 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