* Get the content of a list?
@ 2005-11-20 15:00 Herbert Euler
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Euler @ 2005-11-20 15:00 UTC (permalink / raw)
Hello everyone,
I'm wanting to create a customized function to
wrap the standard 'call-process-region'. 'Call-
process-region' requires several arguments for
the program it called:
(call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY
&rest ARGS)
That is, several strings may be given as ARGS.
For example, the arguments can be
"1" "2" "3"
But I don't know how to construct this series
of arguments. I can create a list
("1" "2" "3")
easily, but don't know how to convert it into
the former one. Any suggestions?
Thanks in advance.
Regards,
Guanpeng Xu
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
^ permalink raw reply [flat|nested] 2+ messages in thread
[parent not found: <mailman.16026.1132498841.20277.help-gnu-emacs@gnu.org>]
* Re: Get the content of a list?
[not found] <mailman.16026.1132498841.20277.help-gnu-emacs@gnu.org>
@ 2005-11-20 17:40 ` Pascal Bourguignon
0 siblings, 0 replies; 2+ messages in thread
From: Pascal Bourguignon @ 2005-11-20 17:40 UTC (permalink / raw)
"Herbert Euler" <herberteuler@hotmail.com> writes:
> Hello everyone,
>
> I'm wanting to create a customized function to
> wrap the standard 'call-process-region'. 'Call-
> process-region' requires several arguments for
> the program it called:
>
> (call-process-region START END PROGRAM &optional DELETE BUFFER
> DISPLAY &rest ARGS)
>
> That is, several strings may be given as ARGS.
> For example, the arguments can be
>
> "1" "2" "3"
>
> But I don't know how to construct this series
> of arguments. I can create a list
>
> ("1" "2" "3")
>
> easily, but don't know how to convert it into
> the former one. Any suggestions?
You can use apply to pass a list as the rest arguments:
(setf args '("1" "2" "3'))
(apply (function call-process-region)
start end program delete buffer display args)
You can also put some or all previous arguments in the list too:
(setf args (list start end program delete buffer display "1" "2" "3'))
(apply (function call-process-region) args)
--
__Pascal Bourguignon__ http://www.informatimago.com/
Nobody can fix the economy. Nobody can be trusted with their finger
on the button. Nobody's perfect. VOTE FOR NOBODY.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-11-20 17:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-20 15:00 Get the content of a list? Herbert Euler
[not found] <mailman.16026.1132498841.20277.help-gnu-emacs@gnu.org>
2005-11-20 17:40 ` Pascal Bourguignon
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.