From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.help Subject: Re: Dumb elisp question Date: Fri, 30 Sep 2011 15:19:21 +0530 Message-ID: <81oby24axq.fsf@gmail.com> References: <87ty7uz8zr.fsf@ericabrahamsen.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1317376189 20001 80.91.229.12 (30 Sep 2011 09:49:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Sep 2011 09:49:49 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Eric Abrahamsen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 30 11:49:46 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R9Ziz-00015w-Lg for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Sep 2011 11:49:45 +0200 Original-Received: from localhost ([::1]:44891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9Ziy-0002jf-NN for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Sep 2011 05:49:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:50141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9Ziq-0002jP-Df for help-gnu-emacs@gnu.org; Fri, 30 Sep 2011 05:49:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9Zim-0007Fe-Ce for help-gnu-emacs@gnu.org; Fri, 30 Sep 2011 05:49:36 -0400 Original-Received: from mail-yx0-f169.google.com ([209.85.213.169]:64720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9Zim-0007FZ-8w for help-gnu-emacs@gnu.org; Fri, 30 Sep 2011 05:49:32 -0400 Original-Received: by yxi19 with SMTP id 19so1724641yxi.0 for ; Fri, 30 Sep 2011 02:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=tUcI4Qe3RKy8LXcNXmXeXdO2GOonTlyTIF3QtZDmxSE=; b=Sm7y/JYLU8kewztcqG6CjwFWCHiLNo3KNaF1FmzFYRtnMsrJ9q1V77TSespKzkPM5p vdZTjSCWLKRG0i4d64oft+XzcbynPAmW7dhRov0viHDIg0NcsiOx0hHDh9d/SngJ7quJ fCXTkkxy8PulFn52/1b3oAfczDF5AkGN9IWCk= Original-Received: by 10.68.20.135 with SMTP id n7mr57219964pbe.125.1317376171176; Fri, 30 Sep 2011 02:49:31 -0700 (PDT) Original-Received: from JAMBU-NETBOOK ([115.242.162.99]) by mx.google.com with ESMTPS id ml4sm16456067pbc.0.2011.09.30.02.49.26 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Sep 2011 02:49:29 -0700 (PDT) In-Reply-To: <87ty7uz8zr.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Fri, 30 Sep 2011 17:15:36 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.213.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82386 Archived-At: I think you are looking for this: (apply 'format "%s %s" '("one" "two")) > I've made a function that takes as arguments an arbitrary format string > and a list of arguments to that string. The list of arguments is of > varying length, and the args need to be mapped through a function before > they're passed to the format string. So in the bowels of the function > there's something like: > > (format fmt-str-var (mapcar (lambda (arg) (do-thing-with arg)) > list-of-arguments)) > > Obviously, the problem is that mapcar returns a single list of strings, > not the series of atomic strings that format requires. > I've tried to solve this problem many different ways, including turning > this into a macro and using ",@", and using ",@" even when it's not a > macro, and looking at other mapping functions, and trying to make some > sort of "splice" function of my own, and=E2=80=A6 and=E2=80=A6 > > Nothing works quite right. This can't be a macro because elsewhere it > needs to pass `commandp'. I can't make any of the other fixes work > properly. > > Can anyone provide an elegant solution? > > Thanks, > Eric --=20