emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Separate clocksum format for durations >= 1 day
Date: Mon, 05 Nov 2012 10:14:27 +0100	[thread overview]
Message-ID: <878vage7ik.fsf@gmail.com> (raw)
In-Reply-To: <20121027140156.GA5003@c3po> (Toby Cubitt's message of "Sat, 27 Oct 2012 16:01:56 +0200")

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

  reply	other threads:[~2012-11-05  9:18 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-27 14:01 [PATCH] Separate clocksum format for durations >= 1 day Toby Cubitt
2012-11-05  9:14 ` Nicolas Goaziou [this message]
2012-11-05 10:25   ` Toby Cubitt
2012-11-05 10:47   ` Achim Gratz
2012-11-05 11:01     ` Toby Cubitt
2012-11-05 11:13       ` Achim Gratz
2012-11-05 12:10         ` Toby Cubitt
2012-11-05 12:20           ` Nicolas Goaziou
2012-11-05 12:55             ` Toby Cubitt
2012-11-05 13:14               ` Nicolas Goaziou
2012-11-05 17:40                 ` Achim Gratz
2012-11-05 18:16                   ` Toby Cubitt
2012-11-05 22:45                     ` Nicolas Goaziou
2012-11-06 10:35                       ` Toby Cubitt
2012-11-06 10:57                         ` Nicolas Goaziou
2012-11-06 12:01                           ` Toby Cubitt
2012-11-06 12:29                             ` Nicolas Goaziou
2012-11-06 13:04                               ` Toby Cubitt
2012-11-06 17:41                                 ` Nicolas Goaziou
2012-11-06 19:26                                   ` Toby Cubitt
2012-11-06 19:55                                     ` Nicolas Goaziou
2012-11-06 20:35                                       ` Toby Cubitt
2012-11-08  0:26                                         ` Nicolas Goaziou
2012-11-08 11:28                                           ` Toby Cubitt
2012-11-09  8:04                                             ` Nicolas Goaziou
2012-11-13 13:03                                               ` Toby Cubitt
2012-11-14 15:04                                                 ` Nicolas Goaziou
2012-11-14 15:37                                                   ` Toby Cubitt
2012-11-14 16:09                                                     ` Nicolas Goaziou
2012-11-14 16:20                                                       ` Toby Cubitt
2012-11-16 15:12                                                         ` Toby Cubitt
2012-11-17  8:48                                                           ` Nicolas Goaziou
2012-11-17 14:00                                                             ` Toby Cubitt
2012-11-17 14:42                                                               ` Nicolas Goaziou
2012-11-17 16:02                                                                 ` Toby Cubitt
2012-11-20 16:12                                                                   ` Mike McLean
2012-11-20 17:28                                                                     ` Toby Cubitt
2012-11-20 19:24                                                                       ` Nicolas Goaziou
2012-11-21 23:29                                                                         ` Mike McLean
2012-11-30 11:22                                                                 ` [bug] " Sebastien Vauban
2012-11-06 18:42                       ` [PATCH] " Achim Gratz
2012-11-06 20:10                         ` Toby Cubitt
2012-11-06 20:49                           ` Achim Gratz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878vage7ik.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).