From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pierre Lorenzon Newsgroups: gmane.emacs.help Subject: Re: Template substitution in Emacs? Date: Wed, 12 Nov 2014 20:58:20 +0100 (CET) Message-ID: <20141112.205820.1403293643850220428.devel@pollock-nageoire.net> References: <87bnogc6ex.fsf@wmi.amu.edu.pl> <87oasd9jsd.fsf@robertthorpeconsulting.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1415822778 5705 80.91.229.3 (12 Nov 2014 20:06:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Nov 2014 20:06:18 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, mbork@wmi.amu.edu.pl To: rt@robertthorpeconsulting.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 12 21:06:11 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XoeB6-0006GW-NB for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Nov 2014 21:06:08 +0100 Original-Received: from localhost ([::1]:56544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoeB5-0002I0-U0 for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Nov 2014 15:06:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoeAh-0002Hb-Ll for help-gnu-emacs@gnu.org; Wed, 12 Nov 2014 15:05:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoeAc-0003fW-7b for help-gnu-emacs@gnu.org; Wed, 12 Nov 2014 15:05:43 -0500 Original-Received: from smtp05.smtpout.orange.fr ([80.12.242.127]:39359 helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoeAc-0003en-0l for help-gnu-emacs@gnu.org; Wed, 12 Nov 2014 15:05:38 -0500 Original-Received: from localhost ([92.163.91.38]) by mwinf5d62 with ME id Ek5V1p00v0pfM3Q03k5VQn; Wed, 12 Nov 2014 21:05:32 +0100 X-ME-Helo: localhost X-ME-Date: Wed, 12 Nov 2014 21:05:32 +0100 X-ME-IP: 92.163.91.38 In-Reply-To: <87oasd9jsd.fsf@robertthorpeconsulting.com> X-Mailer: Mew version 6.5 on Emacs 25.0.50 / Mule 6.0 (HANACHIRUSATO) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.12.242.127 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100902 Archived-At: From: Robert Thorpe Subject: Re: Template substitution in Emacs? Date: Wed, 12 Nov 2014 03:31:30 +0000 > Marcin Borkowski 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 >