[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Template substitution in Emacs?
From: |
Pierre Lorenzon |
Subject: |
Re: Template substitution in Emacs? |
Date: |
Wed, 12 Nov 2014 20:58:20 +0100 (CET) |
From: Robert Thorpe <rt@robertthorpeconsulting.com>
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
If it is enough it might be good. Notice that srecode is now
part of gnu emacs. In particular srecode was intended to
extend skeleton. So if skeleton is enough stay with that but
if you want more try srecode.
Pierre
> part of Emacs.
>
> BR,
> Robert Thorpe
>