unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* elisp question: format
@ 2007-06-24  6:56 Aaron Maxwell
  2007-06-28  4:39 ` Kevin Rodgers
       [not found] ` <mailman.2722.1183005606.32220.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Aaron Maxwell @ 2007-06-24  6:56 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

Is there a way to direct the format function to use a single value
repeatedly for several positional parameters?

Here's the specific example of what I mean.  In my .emacs, the
following string is used:
"/home/amax/opt/scmutils/mit-scheme/bin/scheme --band /home/amax/opt/scmutils/mit-scheme/lib/edwin-mechanics.com --heap 6000 --library /home/amax/opt/scmutils/mit-scheme/lib"

(See [1] if you're curious what it's for.)  The substring "/home/amax/opt/scmutils/mit-scheme" repeats 3 times. The idea I had is to use a format string like:

(format "%s/bin/scheme --band %s/lib/edwin-mechanics.com --heap 6000 --library %s/lib" ...(something)...)

... and to do this in a way that I only had to type that substring
once.  However, I did not find a way to do this directly.  The closest
thing I came up with is this:

(apply 'format 
       (cons "%s/bin/scheme --band %s/lib/edwin-mechanics.com --heap 6000 --library %s/lib" 
       (make-list 3 "/home/amax/opt/scmutils/mit-scheme")))

Is there a clearer way to do this? 

Thanks in advance.

[1] http://redsymbol.blogspot.com/2007/06/using-gnu-emacs-with-scmutils.html
-- 
Aaron Maxwell
http://redsymbol.net

Business Owners and Self-Employed:  You're NOT Alone!
The Business Butler - http://businessbutler.us

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

end of thread, other threads:[~2007-06-29 13:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2558.1182668174.32220.help-gnu-emacs@gnu.org>
2007-06-24  9:00 ` elisp question: format Pascal Bourguignon
2007-06-24 11:22 ` Daniel Jensen
2007-06-25  8:59   ` Aaron Maxwell
2007-06-24  6:56 Aaron Maxwell
2007-06-28  4:39 ` Kevin Rodgers
     [not found] ` <mailman.2722.1183005606.32220.help-gnu-emacs@gnu.org>
2007-06-29 13:26   ` Joel J. Adamson

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