From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.help Subject: Re: Template substitution in Emacs? Date: Wed, 12 Nov 2014 03:31:30 +0000 Message-ID: <87oasd9jsd.fsf@robertthorpeconsulting.com> References: <87bnogc6ex.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415763127 14654 80.91.229.3 (12 Nov 2014 03:32:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Nov 2014 03:32:07 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 12 04:31:59 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 1XoOez-000703-TL for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Nov 2014 04:31:58 +0100 Original-Received: from localhost ([::1]:52294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoOez-0006OV-7F for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Nov 2014 22:31:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoOei-0006OA-32 for help-gnu-emacs@gnu.org; Tue, 11 Nov 2014 22:31:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoOeb-0000NS-AD for help-gnu-emacs@gnu.org; Tue, 11 Nov 2014 22:31:40 -0500 Original-Received: from outbound-smtp05.blacknight.com ([81.17.249.38]:42841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoOeb-0000N8-4c for help-gnu-emacs@gnu.org; Tue, 11 Nov 2014 22:31:33 -0500 Original-Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp05.blacknight.com (Postfix) with ESMTP id EBC3098616 for ; Wed, 12 Nov 2014 03:28:36 +0000 (UTC) Original-Received: (qmail 12908 invoked from network); 12 Nov 2014 03:31:31 -0000 Original-Received: from unknown (HELO RTLaptop) (rt@robertthorpeconsulting.com@[109.79.75.75]) by 81.17.254.9 with ESMTPSA (DHE-RSA-AES128-SHA encrypted, authenticated); 12 Nov 2014 03:31:31 -0000 In-Reply-To: <87bnogc6ex.fsf@wmi.amu.edu.pl> (message from Marcin Borkowski on Mon, 10 Nov 2014 00:15:18 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 81.17.249.38 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:100897 Archived-At: 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 part of Emacs. BR, Robert Thorpe