all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pascal Bourguignon <spam@mouse-potato.com>
Subject: Re: Get the content of a list?
Date: Sun, 20 Nov 2005 18:40:15 +0100	[thread overview]
Message-ID: <87k6f3z08w.fsf@thalassa.informatimago.com> (raw)
In-Reply-To: mailman.16026.1132498841.20277.help-gnu-emacs@gnu.org

"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.

       reply	other threads:[~2005-11-20 17:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.16026.1132498841.20277.help-gnu-emacs@gnu.org>
2005-11-20 17:40 ` Pascal Bourguignon [this message]
2005-11-20 15:00 Get the content of a list? Herbert Euler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k6f3z08w.fsf@thalassa.informatimago.com \
    --to=spam@mouse-potato.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.