From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aaron Maxwell Newsgroups: gmane.emacs.help Subject: elisp question: format Date: Sat, 23 Jun 2007 23:56:06 -0700 Message-ID: <200706232356.06328.amax@redsymbol.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1182668190 13942 80.91.229.12 (24 Jun 2007 06:56:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 24 Jun 2007 06:56:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 24 08:56:28 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I2M1L-0005kb-Lg for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Jun 2007 08:56:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2M1K-0005yq-S9 for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Jun 2007 02:56:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I2M16-0005yk-C4 for help-gnu-emacs@gnu.org; Sun, 24 Jun 2007 02:56:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I2M13-0005ws-Uo for help-gnu-emacs@gnu.org; Sun, 24 Jun 2007 02:56:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2M13-0005wJ-NP for help-gnu-emacs@gnu.org; Sun, 24 Jun 2007 02:56:09 -0400 Original-Received: from smtp-gw5.mailanyone.net ([208.70.128.56]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I2M13-0006a5-Ab for help-gnu-emacs@gnu.org; Sun, 24 Jun 2007 02:56:09 -0400 Original-Received: from mailanyone.net by smtp-gw5.mailanyone.net with esmtpsa (TLSv1:AES256-SHA:256) (MailAnyone extSMTP redsymbol) id 1I2M12-0004vb-Ds for help-gnu-emacs@gnu.org; Sun, 24 Jun 2007 01:56:08 -0500 User-Agent: KMail/1.9.5 Content-Disposition: inline X-detected-kernel: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:45235 Archived-At: 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