From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toby Cubitt Subject: Re: [PATCH] Separate clocksum format for durations >= 1 day Date: Tue, 6 Nov 2012 21:35:05 +0100 Message-ID: <20121106203505.GA7335@c3po> References: <877gpy7bhb.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]:48273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVprK-0003OO-I6 for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 15:34:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVprF-0004zM-Sx for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 15:34:54 -0500 Received: from starfish.geekisp.com ([216.168.135.166]:35892) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TVprF-0004z9-P9 for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 15:34:49 -0500 Content-Disposition: inline In-Reply-To: <877gpy7bhb.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 Tue, Nov 06, 2012 at 08:55:12PM +0100, Nicolas Goaziou wrote: > Toby Cubitt writes: > > > I doubt it can be done now, since we already allow user-defined format > > strings. > > I'm more focused on what we will be able to do. > > > Where are displayed durations formatted with org-time-clocksum-format et > > al. parsed back to a number of minutes in the current code? If there is > > anywhere, it's surely broken because a user-supplied > > `org-time-clocksum-format' or `org-time-clocksum-fractional-format' could > > already format the duration in arbitrarily bizarre ways as things are > > currently. > > In org-element.el. But that only needs to parse clock strings stored in properties/drawers, not the ones displayed in overlays (column view) or in the mode-line. Are the clock strings stored in properties/drawers formatted using the existing org-time-clocksum-* defcustoms? I can't easily tell from the org-clock.el code... The only sane answer ought to be "no" (which doesn't mean that it is ;) It would clearly be better if the clock strings stored in org buffers used a single fixed format, which could be mangled as desired for display in overlays and the mode-line. > > You mean abandon any sort of customizable format string (since that > > inherently can't be parsed back in general), and use a hard-coded > > conditional "hh:mm" or "dd hh:mm" format? (Possibly retaining one > > customisation option, org-time-clocksum-use-fractional, to switch this to > > "hh.mm" or "dd hh.mm"?) > > We can allow a limited set of conses of format strings (with or without > days), possibly defined in the same defcustom (see > `org-table-number-regexp' customize interface). If we know the format > string used, we can parse it back. Ugh. Wouldn't it be far better to make sure the customization options only affect the visual display of clocksum durations (in overlays/mode-line), and not the strings stored in the file? Then the parser can be kept simple and reliable. > > That would give me the format I want, but it's a feature regression. > > There are features more honoured in the breach than in the observance. > I want to have a parseable Org syntax, for its own good. Best way to achieve this is to separate style from content! That would allow the visual clocksum format can be customized to our hearts content, whilst keeping the parser simple and therefore reliable. Best, 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