help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inserting output from a program into a buffer


From: Tim X
Subject: Re: Inserting output from a program into a buffer
Date: Mon, 22 Feb 2010 18:22:32 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux)

Tim Johnson <tim@johnsons-web.com> writes:

> On 2010-02-21, Tim X <timx@nospam.dev.null> wrote:
>>>   Thanks
>>
>> I'm just interested in what the external program you need to call is and
>> what it does?
>>
>> I only mention this as I handle some timeclock/timecard requirements I
>> have using existing emacs functionality. Maybe there is an alternative
>> way to approach this issue that would give a better result. 
>   Hi Tim:
>       The following data structure:
>       [[13:22 13:41][14:50 15:04][15:58 16:03][16:53 16:58]]
>       Is a nested block or list recognized by the rebol programming
>       language. Each value: 13:22, 15:04 etc is a value of datatype "time!"
>       and rebol has the ability of easily doing math on such datatypes.
>       Regardless of what programming language that I might be working in,
>       I use this approach to "pipe" such a data structure to a simple
>       application that I have written. That application then returns
>       the sum, which is inserted into the buffer. (See my initial post)
>
>       The rebol binary is very easy to install. Small footprint, no
>       external libraries are necessary. I would be happy to provide
>       the application as well as the elisp code to manipulate it.
>
>       As for the elisp code, I now have a function that grabs the data
>       structure and puts it in the kill-ring.
>
>       I now have to ask another question myself, related to this subject.
>       I'd like to copy _only_ the text at the car of the kill ring to a
>       variable, for further processing use:
>       Example:
>       alt-: (car kill-ring) => 
>       #("[0:58 1:42 0:43 1:41]" 0 20 (fontified t) 20 21 (rear-nonsticky t
>       fontified t))
>       How I can copy the first item
>       "[0:58 1:42 0:43 1:41]"
>       from the car of kill-ring into a variable?


OK, just in case you don't know, emacs already has all this
functional,functionality. At its simplest, you have timeclock.el, which
enables you to keep a data file to clock time and provide basic
summaries etc. 

In addition to that, various packages, such as org-mode, provide support
for tracking time done on projects, and tasks and can even be used to do
basic billing etc. 

With respect to your other question, if you only need the first element
from the list, I'd extract that before putting it on the kill ring. 

Tim


-- 
tcross (at) rapttech dot com dot au


reply via email to

[Prev in Thread] Current Thread [Next in Thread]