From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: org table calc and lisp for hh:mm timetable Date: Wed, 23 Mar 2011 19:18:43 -0600 Message-ID: <87wrjpiado.fsf@gmail.com> References: <9999237C-1FBD-481E-AF8D-D68DB85080CE@gmail.com> <87lj0gqjd3.fsf@ucl.ac.uk> <0DDD90AF-9B9A-4FE3-8080-74EF01E6E292@gmail.com> <4D7FDE8C.1030103@christianmoe.com> <00BD91C6-C610-4CDD-B3E0-E9FECDAA372C@gmail.com> <87k4fynog3.fsf@altern.org> <87lj09llzd.fsf@gmail.com> <4D866AD7.4020701@christianmoe.com> <87fwqhl5mu.fsf@gmail.com> <87mxknhioh.fsf@gmail.com> <4D886D8B.10401@christianmoe.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=44054 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2ZCP-0002L2-Rl for emacs-orgmode@gnu.org; Wed, 23 Mar 2011 21:18:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2ZCO-0002SU-Jw for emacs-orgmode@gnu.org; Wed, 23 Mar 2011 21:18:53 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:34886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2ZCO-0002SJ-EF for emacs-orgmode@gnu.org; Wed, 23 Mar 2011 21:18:52 -0400 Received: by iyf13 with SMTP id 13so11915206iyf.0 for ; Wed, 23 Mar 2011 18:18:51 -0700 (PDT) In-Reply-To: <4D886D8B.10401@christianmoe.com> (Christian Moe's message of "Tue, 22 Mar 2011 10:36:11 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: mail@christianmoe.com Cc: Bastien , emacs-orgmode@gnu.org, Martin Halder Christian Moe writes: > Hi, > > If we're not just looking for a neat workaround for some special cases > anymore, but looking at making org-tables aware of time-like strings > by default, a better strategy than to convert them into integers might > be to translate them into Calc time format and back again. > > After all, Calc and hence the Org spreadsheet already handles time > arithmetic perfectly well, it's just that it would be nice to have > this functionality with the extra option to enter and display times as > =12:45= rather than =12@ 45'= or =12h 45m=. > I did not realize that calc (and hence Org) already supported operating on time values. The =7@ 30'= format does indeed work well for time table formulas (although the =12h 5m= format does not), e.g., | 1@ 20' | 2 | 0@ 40' 0." | | 2@ 5' | 3 | 0@ 41' 40." | #+TBLFM: $3=$1/$2 Maybe all that is needed is explicit mention of this syntax somewhere in the table section of the Org-mode manual. The only remaining reason to support a %d:%d time format is that it is what I (and I expect most users) would first think of to represent time, and supporting such a format would allow time calculation in a table to "just work" -- meaning users could likely manipulate time without having to first look in the manual for the appropriate Calc format. However as Carsten mentioned such an automatic translation of e.g., =7:20= to =7@ 20'= would be a bit bold, and (as mentioned elsewhere) it would result in having to make some denomination decisions, namely does =7:20= convert to =7@ 20'= or =7' 20"=. For now I've posted my `with-time' macro up to Worg. Cheers -- Eric