From mboxrd@z Thu Jan  1 00:00:00 1970
From: Nicolas Goaziou <n.goaziou@gmail.com>
Subject: Re: [PATCH] Separate clocksum format for durations >= 1 day
Date: Mon, 05 Nov 2012 10:14:27 +0100
Message-ID: <878vage7ik.fsf@gmail.com>
References: <20121027140156.GA5003@c3po>
Mime-Version: 1.0
Content-Type: text/plain
Return-path: <emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org>
Received: from eggs.gnu.org ([208.118.235.92]:49789)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <n.goaziou@gmail.com>) id 1TVIpR-0004dZ-V1
	for emacs-orgmode@gnu.org; Mon, 05 Nov 2012 04:18:49 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <n.goaziou@gmail.com>) id 1TVIpN-0006Ms-Fv
	for emacs-orgmode@gnu.org; Mon, 05 Nov 2012 04:18:45 -0500
Received: from mail-wi0-f171.google.com ([209.85.212.171]:38719)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <n.goaziou@gmail.com>) id 1TVIpN-0006Mo-97
	for emacs-orgmode@gnu.org; Mon, 05 Nov 2012 04:18:41 -0500
Received: by mail-wi0-f171.google.com with SMTP id hj13so2088772wib.12
	for <emacs-orgmode@gnu.org>; Mon, 05 Nov 2012 01:18:40 -0800 (PST)
In-Reply-To: <20121027140156.GA5003@c3po> (Toby Cubitt's message of "Sat, 27
	Oct 2012 16:01:56 +0200")
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=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

Hello,

Toby Cubitt <tsc25@cantab.net> writes:

> Personally, I find the time duration "123:15" much harder to parse
> mentally than "5d 3:15".
>
> The attached patch adds a new customization option
> `org-time-clocksum-days-format'. When non-nil, this is used instead of
> `org-time-clocksum-format' for clocksum durations longer than 1 day. It
> gets passed three values: # days, # hours, # mins. (Note that you don't
> have to use all three in the format if, say, you don't feel the need to
> display the minutes for such long durations.)
>
> In the patch, I've set the default value for this new customization
> option to a non-nil value. If you prefer to keep the current behaviour as
> the default, just make the default value nil.
>
> Toby
>
>
> PS: I guess the logical extrapolation of this is to add even more
> `org-time-clocksum-[months|years|decades]-format' options. (Or, probably
> better, abandon printf formats for long durations and just add an
> `org-time-clocksum-format-function' option, leaving it up users to define
> a function to format the time as they wish.)
>
> I haven't done this in the patch, because I think "64d 3:15" is no harder
> to parse than "2m 4d 3:15" (plus there's the thorny issue of how many
> days should be in a month). And by the time you get to "535d 3:15"
> vs. "2y 5d 3:15", the duration is so long that you probably don't care
> much about the exact value, except that it's a very long-running task
> indeed!

Thanks for your patch.

I like the idea, but it would be better to avoid introducing yet another
defcustom for this. There is already:

  - org-time-clocksum-format
  - org-time-clocksum-use-fractional
  - org-time-clocksum-fractional-format

As you suggest, I think a better plan is to replace all of them with
a single `org-time-clocksum-display-function'. Its expected value would
be a function accepting 2 arguments: hours and minutes, as numbers and
it should return a string.

We can also provide default functions for current behaviour (i.e.
fractional time and Hs:MM) and for the one you suggest.

It's more work, but it simplifies the whole thing in the end.

What do you think? Do you want to give it a try?


Regards,

-- 
Nicolas Goaziou