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

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

Re: getting output from external process in a variable


From: Kai Grossjohann
Subject: Re: getting output from external process in a variable
Date: Thu, 05 Feb 2004 09:01:20 +0100
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.2 (gnu/linux)

Daan Hoogland <emacs@onecht.net> writes:

> I'm doing some application programming in elisp. I read /etc/group
> with grep and edit the temporary buffer with results. now I end up
> with groupname:member1,member2 and I want it in a list:
> (list "groupname" (list "member1" "member2"))
> now I can edit the buffer to cantain the lisp expression and then
> evaluate it like:
> (set 'var (list "groupname" (list "member1" "member2")))
> and use var. But I was wondering wether there was somewhere maybe an
> api that can set a var to a region in the current buffer directly.

I don't know what it means to "set a var to a region in the current
buffer directly".  Maybe you mean that you want a variable that
contains a string which is a part of the current buffer?  See the
buffer-substring and buffer-substring-no-properties functions.

Maybe you mean that you want to have ("groupname" ("member1"
"member2")) in the buffer and then "directly", in some manner,
transfer this list into a Lisp variable.  In that case, investigate
the function read.  Basically, you put point in front of the open
paren, call read once, and the return value of read will be the sexp
at point.

Kai


reply via email to

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