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

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

Re: Template substitution in Emacs?


From: Robert Thorpe
Subject: Re: Template substitution in Emacs?
Date: Wed, 12 Nov 2014 03:31:30 +0000

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
> Hi there,
>
> assume that I want to insert an (almost) constant string in Emacs
> buffer.  For instance, it may be a string of the form
>
> "I am a {my-variable}."
>
> However, I want the "{my-variable}" part to be, well, variable: I want
> to substitute the current value of `my-variable' for this.  So that
>
> (setq my-variable "sentence")
> (insert (template-substitute "I am a {my-variable}."))
>
> would insert "I am a sentence." at point.

As well as the things others have mentioned there's skeleton.el which is
part of Emacs.

BR,
Robert Thorpe



reply via email to

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