* 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
* Re: elisp question: format
2007-06-24 6:56 elisp question: format Aaron Maxwell
@ 2007-06-28 4:39 ` Kevin Rodgers
[not found] ` <mailman.2722.1183005606.32220.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 6+ messages in thread
From: Kevin Rodgers @ 2007-06-28 4:39 UTC (permalink / raw)
To: help-gnu-emacs
Aaron Maxwell wrote:
> 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?
(let ((scheme-home "/home/amax/opt/scmutils/mit-scheme"))
(format "%s/bin/scheme --band %s/lib/edwin-mechanics.com --heap 6000
--library %s/lib"
scheme-home scheme-home scheme-home))
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <mailman.2722.1183005606.32220.help-gnu-emacs@gnu.org>]
[parent not found: <mailman.2558.1182668174.32220.help-gnu-emacs@gnu.org>]
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 --
2007-06-24 6:56 elisp question: format 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
[not found] <mailman.2558.1182668174.32220.help-gnu-emacs@gnu.org>
2007-06-24 9:00 ` Pascal Bourguignon
2007-06-24 11:22 ` Daniel Jensen
2007-06-25 8:59 ` Aaron Maxwell
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.