From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Separate clocksum format for durations >= 1 day Date: Mon, 05 Nov 2012 23:45:24 +0100 Message-ID: <87y5ifacu3.fsf@gmail.com> References: <87wqy0vth7.fsf@Rainer.invalid> <20121105181653.GA5174@c3po> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVVUB-0003l3-G9 for emacs-orgmode@gnu.org; Mon, 05 Nov 2012 17:49:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVVUA-0001Ag-Cu for emacs-orgmode@gnu.org; Mon, 05 Nov 2012 17:49:39 -0500 Received: from mail-wi0-f171.google.com ([209.85.212.171]:59680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVVUA-0001AZ-4d for emacs-orgmode@gnu.org; Mon, 05 Nov 2012 17:49:38 -0500 Received: by mail-wi0-f171.google.com with SMTP id hj13so2653885wib.12 for ; Mon, 05 Nov 2012 14:49:37 -0800 (PST) In-Reply-To: <20121105181653.GA5174@c3po> (Toby Cubitt's message of "Mon, 5 Nov 2012 19:16:53 +0100") 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 Toby Cubitt 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