emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Separate clocksum format for durations >= 1 day


From: Nicolas Goaziou
Subject: Re: [O] [PATCH] Separate clocksum format for durations >= 1 day
Date: Mon, 05 Nov 2012 23:45:24 +0100

Toby Cubitt <address@hidden> writes:

>> This is not far from your own suggestion to provide different functions
>> depending on which output is desired, I just happen to think that these
>> functions would all be so similar that they should be rolled into a
>> single function that can produce different outputs.  I think there'd
>> only be a handful of possible values for fmt based on the current usage
>> and that suggests just another cond form would be needed in
>> implementing this function rather than a full-blown format string
>> interpreter.
>
> It seems to me your `org--format-time' function would end up looking very
> like what I sketched. A cond to switch between "hh:mm", "hh.mm",
> "dd hh:mm" or "dd hh.mm" based only on the contents of the fmt argument
> would have to check whether fmt contains 2 or 3 %-sequences, then check
> if it contains "." or ":"

Again, these are strange and very limiting rules. What if I want to have
"5 h 32 min"? And "5,3 days"?

Achim didn't specify how he conceives the FMT argument. One possibility
would be to have a placeholder-based template with, i.e. %d, %h, %m, %w
for respectively number of days, hours, minutes and weeks. But it's
still less flexible than functions because you need to have a fixed
number of placeholders in every template.

I still think functions are the way to go. Three options in the
defcustom:

  - One to provide regular time (i.e 14:40 or 3d 18:32)

  - One to provide decimal time with the highest unit available (i.e.
    18,75 h or 2,5 d).

  - One free slot for an user-defined function.


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]