From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Lee Newsgroups: gmane.emacs.help Subject: Re: keyboard macro create function from list Date: Thu, 07 Jun 2007 19:33:26 GMT Organization: x Message-ID: References: <87ejkor50b.fsf@pdrechsler.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1181299495 11522 80.91.229.12 (8 Jun 2007 10:44:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 8 Jun 2007 10:44:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 08 12:44:54 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hwbxd-0003GX-8X for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Jun 2007 12:44:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hwbxc-0006Rm-U8 for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Jun 2007 06:44:52 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!newscon04.news.prodigy.net!prodigy.net!newsdst01.news.prodigy.net!prodigy.com!postmaster.news.prodigy.com!newssvr13.news.prodigy.net.POSTED!404941e6!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (windows-nt) Cancel-Lock: sha1:YWwWcKpGyssD7VB8XEdt22MNlVk= Original-Lines: 23 Original-NNTP-Posting-Host: 75.55.119.229 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: newssvr13.news.prodigy.net 1181244806 ST000 75.55.119.229 (Thu, 07 Jun 2007 15:33:26 EDT) Original-NNTP-Posting-Date: Thu, 07 Jun 2007 15:33:26 EDT X-UserInfo1: OH]YBTSEJCUYRTH]]ZN@_TDAYZOZ@GXOXZ^D]\YIJYWZUYICD^RAQBKZQTZTX\_I[^G_KGFNON[ZOE_AZNVO^\XGGNTCIRPIJH[@RQKBXLRZ@CD^HKANYVW@RLGEZEJN@\_WZJBNZYYKVIOR]T]MNMG_Z[YVWSCH_Q[GPC_A@CARQVXDSDA^M]@DRVUM@RBM Original-Xref: shelby.stanford.edu gnu.emacs.help:149176 X-Mailman-Approved-At: Fri, 08 Jun 2007 06:44:07 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:44781 Archived-At: >>>> Patrick Drechsler writes: > So, any ideas for accomplishing this more efficiently (using a current > Emacs version) are more than welcome ;-) You could use a regexp... (defun name-me () (interactive) (when mark-active (replace-regexp "myvar_\\(.*\\) *" "m_\\1.SetBounds(0, 0, m_\\1.Width, m_\\1.Height)\nm_\\1.Show()\nSplitContainer.Panel2.Controls.Add(m_\\1)\n" nil (region-beginning) (region-end)) )) Paste your var declarations.. myvar_Asometext myvar_B1foo Select them in a region... and run M-x name-me You could probably use templates/skeletons for this as well.