help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to replace format-like codes in a string?


From: Marcin Borkowski
Subject: Re: How to replace format-like codes in a string?
Date: Fri, 11 Nov 2016 13:19:45 +0100
User-agent: mu4e 0.9.17; emacs 26.0.50.3

On 2016-11-11, at 09:48, Joost Kremers <address@hidden> wrote:

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

Thanks a lot!  That was exactly what I needed.  (I mean, `format-spec';
I'm not sure why I would need `format-spec-make', assuming that I can
just use backquote and comma.)

Best,

-- 
Marcin Borkowski



reply via email to

[Prev in Thread] Current Thread [Next in Thread]