Re: [O] org table calc and lisp for hh:mm timetable

2011-07-02 Thread Bastien
Hi all, Carsten Dominik writes: > How about introducing another flag for the formula to turn > on time string processing like this? I've implemented this. You can now use the "T" flag to compute durations: | Task 1 | Task 2 | Total | |++-| | 35:00 | 35:00 | 1:10:0

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-24 Thread Martin Halder
>> 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 a

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-23 Thread Eric Schulte
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 an

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-22 Thread Carsten Dominik
On 22.3.2011, at 05:40, Eric Schulte wrote: >> >> While this topic is raised, would it make sense for Org-mode table >> formula to automatically parse any time-like string into time units >> (i.e., base sixty). That would be the easiest for most users, and (I >> imagine) would rarely result in

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-22 Thread Christian Moe
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 an

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-21 Thread Eric Schulte
> > While this topic is raised, would it make sense for Org-mode table > formula to automatically parse any time-like string into time units > (i.e., base sixty). That would be the easiest for most users, and (I > imagine) would rarely result in surprising and unexpected behavior. > So, I took a

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-20 Thread Eric Schulte
Christian Moe writes: > Hi, > > Returning to this thread: > > 1. I love Eric's macro wrapper idea -- now time arithmetic in tables > gets truly manageable. If it's not included into Org-mode, it's a must > for Worg! > Great, if no Org-mode changes result, then I will certainly post this code up

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-20 Thread Christian Moe
Hi, Returning to this thread: 1. I love Eric's macro wrapper idea -- now time arithmetic in tables gets truly manageable. If it's not included into Org-mode, it's a must for Worg! 2. There's duplication with org-timer-hms-to-secs and org-timer-secs-to-hms. (Cf. my http://permalink.gmane.or

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-20 Thread Eric S Fraga
"Eric Schulte" writes: > I wrapped Bastien's functions below in a simple macro, which IMO results > in a very nice way to handle time values in Org-mode tables as in the > attached org file (below). > > Note, the first argument to the `with-time' macro controls whether > results are returned as a

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-20 Thread Eric Schulte
I wrapped Bastien's functions below in a simple macro, which IMO results in a very nice way to handle time values in Org-mode tables as shown below. Note, the first argument to the `with-time' macro controls whether results are returned as a time string or a numerical value. That argument may be

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-20 Thread Eric Schulte
I wrapped Bastien's functions below in a simple macro, which IMO results in a very nice way to handle time values in Org-mode tables as in the attached org file (below). Note, the first argument to the `with-time' macro controls whether results are returned as a time string or a numerical value.

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-17 Thread Bastien
Hi Martin, Martin Halder writes: > this is fantastic, already love lisp, thanks a lot.. now I have exactly > what I wanted.. additionally I needed the time format in industrial mode > (1h = 100m = 100s), implemented in ihms. thanks for these functions -- I allowed myself to add them to Worg/org

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-16 Thread Eric S Fraga
Christian Moe writes: > Hi, > > This is ingenious! But I have a different solution that borrows > conversion functions from org-timer.el. [...] Your solution is perfect. Simple and leverages the built-in functions from org. Thanks for this. -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-16 Thread Martin Halder
Hi Christian, this is fantastic, already love lisp, thanks a lot.. now I have exactly what I wanted.. additionally I needed the time format in industrial mode (1h = 100m = 100s), implemented in ihms. Thanks, Martin | Date | Start | Lunch | Back | End | Sum | Ind | |---

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-15 Thread Christian Moe
Hi, This is ingenious! But I have a different solution that borrows conversion functions from org-timer.el. To avoid an insanely long formula, I'll alias those functions with shorter names which don't seem to colide with anything in my Emacs. #+begin_src emacs-lisp (defun sec (arg) (o

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-15 Thread Eric S Fraga
Martin Halder writes: [...] > Hi Eric, > > yes and thanks for the previous help, too.. the good old printf.. I > would like to pass the result of time() directly to a lisp function, > like: > #+TBLFM: $6='(coolfunc (time(...$5)-time(...$4))) > > If I would know how to pass the result, eg as a st

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-15 Thread Martin Halder
>> I was trying to generate a simple table with time format "hh:mm" and >> auto calculate daily sum.. clocking working time was too much so I >> thought this would be easy but ended up with the following.. it works >> but is not beautiful (apply formula twice and same information >> multiple times

Re: [O] org table calc and lisp for hh:mm timetable

2011-03-15 Thread Eric S Fraga
Martin Halder writes: > Hi all, > > some words of warning: this was written by an Emacs, Org, Lisp and > Calc newbie.. and congratulations on converting a vim user btw, org > mode is great : ) > > I was trying to generate a simple table with time format "hh:mm" and > auto calculate daily sum.. cl

[O] org table calc and lisp for hh:mm timetable

2011-03-15 Thread Martin Halder
Hi all, some words of warning: this was written by an Emacs, Org, Lisp and Calc newbie.. and congratulations on converting a vim user btw, org mode is great : ) I was trying to generate a simple table with time format "hh:mm" and auto calculate daily sum.. clocking working time was too much so