unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Dumb elisp question
@ 2011-09-30  9:15 Eric Abrahamsen
  2011-09-30  9:18 ` Le Wang
  2011-09-30  9:49 ` Jambunathan K
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Abrahamsen @ 2011-09-30  9:15 UTC (permalink / raw)
  To: help-gnu-emacs

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… and…

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



-- 
GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.24.4)
 of 2011-04-04 on rothera, modified by Debian




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-01 12:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-30  9:15 Dumb elisp question Eric Abrahamsen
2011-09-30  9:18 ` Le Wang
2011-09-30  9:49 ` Jambunathan K
2011-09-30 13:12   ` Eric Abrahamsen
2011-10-01 12:11     ` Le Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).