From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Mitchell Subject: [PATCH] Remove org-time-clocksum-use-effort-durations Date: Tue, 28 May 2013 12:13:21 +0100 Message-ID: <87ehcr4asu.fsf_-_@gmx.li> References: <87r4h0ehw1.fsf@bzg.ath.cx> <8761yc5z39.fsf@gmx.li> <87ppwkbk08.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhHqZ-0006ls-0c for emacs-orgmode@gnu.org; Tue, 28 May 2013 07:13:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhHqP-0006JM-VD for emacs-orgmode@gnu.org; Tue, 28 May 2013 07:13:42 -0400 Received: from plane.gmane.org ([80.91.229.3]:38720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhHqP-0006JB-Lh for emacs-orgmode@gnu.org; Tue, 28 May 2013 07:13:33 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UhHqO-0001dB-1m for emacs-orgmode@gnu.org; Tue, 28 May 2013 13:13:32 +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, 28 May 2013 13:13:32 +0200 Received: from wence by e4300lm.epcc.ed.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 May 2013 13:13:32 +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 Cc: Carsten Dominik * lisp/org.el (org-time-clocksum-use-effort-durations): Remove variable. (org-minutes-to-clocksum-string): Remove references. * lisp/org-clock.el (org-clocktable-write-default): Remove references. We would like the following identity to hold: (= (org-duration-string-to-minutes "3d 2h") (org-duration-string-to-minutes (org-minutes-to-clocksum-string (org-duration-string-to-minutes "3d 2h"))))) Previously, this was only true if org-time-clocksum-use-effort-durations was non-nil (not the default), since org-duration-string-to-minutes unconditionally looks at org-effort-durations, whereas org-minutes-to-clocksum-string only considers it if org-time-clocksum-use-effort-durations is non-nil. To remove confusion, since org uses org-effort-durations unconditionally everywhere else when interpreting duration strings, just remove this customisation option and use org-effort-durations in org-minutes-to-clocksum-string as well. --- lisp/org-clock.el | 2 -- lisp/org.el | 32 ++++++-------------------------- 2 files changed, 6 insertions(+), 28 deletions(-) Bastien wrote: > Hi Lawrence, > Lawrence Mitchell writes: >> 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. > Agreed. Thanks for the clear explanations. Can you provide a patch > to get the correct behavior? At the time, I could not closely watch > the side-effect of introducing `org-time-clocksum-use-effort-durations' > and this is clearly one of them. Here we go. I think the right thing to do is just remove org-time-clocksum-use-effort-durations completely. If this is wanted, I can add the appropriate entry to ORG-NEWS as well. Lawrence diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 8ac215e..cc6b9c1 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -2337,8 +2337,6 @@ from the dynamic block definition." (maxlevel (or (plist-get params :maxlevel) 3)) (emph (plist-get params :emphasize)) (level-p (plist-get params :level)) - (org-time-clocksum-use-effort-durations - (plist-get params :effort-durations)) (timestamp (plist-get params :timestamp)) (properties (plist-get params :properties)) (ntcol (max 1 (or (plist-get params :tcolumns) 100))) diff --git a/lisp/org.el b/lisp/org.el index adb5fb1..581536d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -2978,20 +2978,6 @@ See `org-time-clocksum-format' for more on time clock formats." :version "24.3" :type 'boolean) -(defcustom org-time-clocksum-use-effort-durations nil - "When non-nil, \\[org-clock-display] uses effort durations. -E.g. by default, one day is considered to be a 8 hours effort, -so a task that has been clocked for 16 hours will be displayed -as during 2 days in the clock display or in the clocktable. - -See `org-effort-durations' on how to set effort durations -and `org-time-clocksum-format' for more on time clock formats." - :group 'org-time - :group 'org-clock - :version "24.4" - :package-version '(Org . "8.0") - :type 'boolean) - (defcustom org-time-clocksum-fractional-format "%.2f" "The format string used when creating CLOCKSUM lines, or when Org mode generates a time duration, if @@ -17521,21 +17507,15 @@ effort string \"2hours\" is equivalent to 120 minutes." "Format number of minutes as a clocksum string. The format is determined by `org-time-clocksum-format', `org-time-clocksum-use-fractional' and -`org-time-clocksum-fractional-format' and -`org-time-clocksum-use-effort-durations'." +`org-time-clocksum-fractional-format'." (let ((clocksum "") (m (round m)) ; Don't allow fractions of minutes h d w mo y fmt n) - (setq h (if org-time-clocksum-use-effort-durations - (cdr (assoc "h" org-effort-durations)) 60) - d (if org-time-clocksum-use-effort-durations - (/ (cdr (assoc "d" org-effort-durations)) h) 24) - w (if org-time-clocksum-use-effort-durations - (/ (cdr (assoc "w" org-effort-durations)) (* d h)) 7) - mo (if org-time-clocksum-use-effort-durations - (/ (cdr (assoc "m" org-effort-durations)) (* d h)) 30) - y (if org-time-clocksum-use-effort-durations - (/ (cdr (assoc "y" org-effort-durations)) (* d h)) 365)) + (setq h (or (cdr (assoc "h" org-effort-durations)) 60) + d (or (/ (cdr (assoc "d" org-effort-durations)) h) 24) + w (or (/ (cdr (assoc "w" org-effort-durations)) (* d h)) 7) + mo (or (/ (cdr (assoc "m" org-effort-durations)) (* d h)) 30) + y (or (/ (cdr (assoc "y" org-effort-durations)) (* d h)) 365)) ;; fractional format (if org-time-clocksum-use-fractional (cond -- 1.8.2-rc3