Hi Sébastien,
Sebastien Vauban
wxhgmqzgwmuf-genee64ty+gs+fvcfc7...@public.gmane.org writes:
For 6 weeks now, since the commit a00a7b2 of Toby, things have changed when
generating clock tables. For example, instead of getting this (for some sample
files I have):
Indeed, there is a problem here.
Please try the attached patch against master, together with
(setq org-time-clocksum-use-effort-durations t)
(or :effort-durations t as a parameter in the clocktable.)
Thanks,
From 9c31d781e9e770a584a9fc04737d3fd352f6a40b Mon Sep 17 00:00:00 2001
From: Bastien Guerry b...@altern.org
Date: Sat, 5 Jan 2013 18:21:55 +0100
Subject: [PATCH] New option `org-time-clocksum-use-effort-durations'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* org.el (org-time-clocksum-format): Add a version tag and add
to the 'org-clock group.
(org-time-clocksum-use-fractional): Ditto.
(org-time-clocksum-use-effort-durations): New option to allow
using `org-effort-durations' when computing clocksum durations.
(org-minutes-to-clocksum-string): Use the new option.
* org-clock.el (org-clocktable-write-default): Let-bind
`org-time-clocksum-use-effort-durations' to a new clocktable
parameter :effort-durations.
Thanks to Sébastien Vauban for pointing the inconsistency.
---
lisp/org-clock.el | 2 ++
lisp/org.el | 90 ---
2 files changed, 61 insertions(+), 31 deletions(-)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 83ff459..5e74332 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2316,6 +2316,8 @@ 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 78429a7..88d13a0 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -2774,6 +2774,8 @@ means durations longer than a day will be expressed in days and
minutes, and durations less than a day will be expressed entirely
in minutes (even for durations longer than an hour).
:group 'org-time
+ :group 'org-clock
+ :version 24.3
:type '(choice (string :tag Format string)
(set :tag Plist
(group :inline t (const :tag Years :years)
@@ -2808,9 +2810,24 @@ in minutes (even for durations longer than an hour).
(const t)
(defcustom org-time-clocksum-use-fractional nil
- If non-nil, \\[org-clock-display] uses fractional times.
-org-mode generates a time duration.
+ When non-nil, \\[org-clock-display] uses fractional times.
+See `org-time-clocksum-format' for more on time clock formats.
:group 'org-time
+ :group 'org-clock
+ :version 24.3
+ :type 'boolean)
+
+(defcustom org-time-clocksum-use-effort-durations t
+ 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.3
:type 'boolean)
(defcustom org-time-clocksum-fractional-format %.2f
@@ -16873,72 +16890,83 @@ If there is already a time stamp at the cursor position, update it.
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'.
- (let ((clocksum ) fmt n)
+`org-time-clocksum-fractional-format' and
+`org-time-clocksum-use-effort-durations'.
+ (let ((clocksum ) 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))
;; fractional format
(if org-time-clocksum-use-fractional
(cond
;; single format string
((stringp org-time-clocksum-fractional-format)
- (format org-time-clocksum-fractional-format (/ m 60.0)))
+ (format org-time-clocksum-fractional-format (/ m (float h
;; choice of fractional formats for different time units
((and (setq fmt (plist-get org-time-clocksum-fractional-format :years))
- ( (/ (truncate m) (* 365 24 60)) 0))
- (format fmt (/ m (* 365 24 60.0
+ ( (/ (truncate m)