From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toby Cubitt Subject: Re: [PATCH] Separate clocksum format for durations >= 1 day Date: Mon, 5 Nov 2012 13:55:28 +0100 Message-ID: <20121105125528.GA19566@c3po> References: <87wqy0ckbj.fsf@gmail.com> Reply-To: Toby Cubitt Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVMCz-0003YI-Uw for emacs-orgmode@gnu.org; Mon, 05 Nov 2012 07:55:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVMCv-0001Hv-Gj for emacs-orgmode@gnu.org; Mon, 05 Nov 2012 07:55:17 -0500 Received: from starfish.geekisp.com ([216.168.135.166]:10629) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TVMCv-0001Hk-Bc for emacs-orgmode@gnu.org; Mon, 05 Nov 2012 07:55:13 -0500 Content-Disposition: inline In-Reply-To: <87wqy0ckbj.fsf@gmail.com> 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 On Mon, Nov 05, 2012 at 01:20:48PM +0100, Nicolas Goaziou wrote: > Toby Cubitt writes: [snip] > > [...] what about getting rid of every customization option except > > `org-time-clocksum-format', and parsing the format string itself to > > decide how many and what arguments to pass to it? > > > > More precisely, if the format string contains ":", "." or "," then the > > smallest time component is minutes; otherwise it's hours. Pass as many > > time components as necessary to fill all the "%" expandos in the format > > string, from largest to smallest, with either hours or minutes as the > > smallest. If the format string contains "." or "," then pass the number > > of minutes as a fraction ("," is used as the decimal separator in many > > European languages). > > That would be over-engineering it. > > > This would simplify things, and make the format string just "do the right > > thing" in all the cases I listed above. On the other hand, it won't allow > > unusual formats that don't fit the above scheme (but they're not possible > > now, anyway). > > > > Thoughts? > > I think it's too much complicated: it requires to know about strange > formatting rules. I suggest to keep it simple: just specify a function > with fixed arguments to do the job and provide default functions to > handle most common cases. I'm fine with a function + sensible defaults, but Achim didn't like it and proposed a custom format syntax instead. org-time-clocksum-format is used all over the place in org-clock.el, often concatenated with other bits of format string. So the changes needed to change it into "one function to rule them all" are more extensive, though fairly trivial. I'd prefer to see some agreement before I waste time coding something that won't get accepted. Toby -- Dr T. S. Cubitt Mathematics and Quantum Information group Department of Mathematics Complutense University Madrid, Spain email: tsc25@cantab.net web: www.dr-qubit.org