all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joost Kremers <joostkremers@fastmail.fm>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: How to replace format-like codes in a string?
Date: Fri, 11 Nov 2016 09:48:26 +0100	[thread overview]
Message-ID: <877f8afllx.fsf@fastmail.fm> (raw)
In-Reply-To: <87mvh677a4.fsf@mbork.pl>


On Fri, Nov 11 2016, Marcin Borkowski wrote:
> I want to write a function like `format', which gets a string 
> with some
> codes embedded (like "%a", "%b" etc., and "%%" to get a 
> percentage
> sign), and convert them to something (say, "%a" to the value of 
> var-a,
> "%b" to var-b etc.).  Is there any facility in Elisp to help 
> with that
> or do I have to do a search-and-replace manually?

See `format-spec' and `format-spec-make'.

-- 
Joost Kremers
Life has its moments



  reply	other threads:[~2016-11-11  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11  8:25 How to replace format-like codes in a string? Marcin Borkowski
2016-11-11  8:48 ` Joost Kremers [this message]
2016-11-11 12:19   ` Marcin Borkowski
2016-11-13 10:29     ` Joost Kremers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877f8afllx.fsf@fastmail.fm \
    --to=joostkremers@fastmail.fm \
    --cc=help-gnu-emacs@gnu.org \
    --cc=mbork@mbork.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.