From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Patrick Drechsler Newsgroups: gmane.emacs.help Subject: keyboard macro create function from list Date: Thu, 07 Jun 2007 02:18:44 +0200 Organization: none Message-ID: <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 1181176832 6910 80.91.229.12 (7 Jun 2007 00:40:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Jun 2007 00:40:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 07 02:40:29 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 1Hw63B-0003Q3-2q for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Jun 2007 02:40:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hw63A-0001A8-Hn for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Jun 2007 20:40:28 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!storethat.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEUAAACtra19fX3y8vKA gID///9AQEBawxxrAAABeUlEQVR4nHXSwXKDIBAA0G3a8Vw05JxY9E4MObeK3h1Cz2qt//8J3UWj ppIdBxmfu4sC2CcB070+PQHDuAcyhQPzwLVFuSlfqQK7eOFirfQ2ly7JC8a3Kip1sx6QLOaRB0wo IUg8gFUa2D2BIFVb+OYGhC23cB4aUDbaQt4AgifjCACt9HwgQfrjWZWDwNPjEwHbtBu44kPC5D9Y FknMgFf8aZFawDDGIuoTkAYndYczzd5hjqAYwXzQ/QCraB2401HvHyQhKMb2tbw0M7whuBNoIs4M W/Xh056fQzwLPF/g14FkrcLN4nKp9WLByIMImSwyycLjDDsOF93pVFdC6yofHkEjxDhWumtWsMdH edc7SOf2/QiYQiByUU0gSldKD4LyBLUbK+kCaoI+diNlxgOGmIFWhVDpe5RgqEiPRR6Buwx8PxXE G3CGzeMVmAnctUB5h3Hsthljp34Ne/wjbu4+cIovBVbqfH4vFdOkoI2SzEWUZdMMQ9k/5csXnnRd prMAAAAASUVORK5CYII= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux) Cancel-Lock: sha1:xu8U/vaWvgcLlmhpYij4ERDeIV0= Original-Lines: 51 Original-NNTP-Posting-Date: 07 Jun 2007 02:18:00 CEST Original-NNTP-Posting-Host: 458d5cf3.newsspool1.arcor-online.net Original-X-Trace: DXC=3WHcV:1EBb0T2Rfi64Fo<]lROoR1Fl8W>\BH3Y2\g3D2?JP?]7C1UHZo1ChO=2Rbn7O`4E930Gb20UCf_e6MQ94Em]JF35 Original-X-Complaints-To: usenet-abuse@arcor.de Original-Xref: shelby.stanford.edu gnu.emacs.help:149141 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:44729 Archived-At: Hi, I often have a list of variable names and need to create similar code from this list. Here is an example: The List (imagine 6-10 myvar's): --8<---------------cut here---------------start------------->8--- myvar_Asometext myvar_B1foo --8<---------------cut here---------------end--------------->8--- Lets say the code layout should look like: --8<---------------cut here---------------start------------->8--- m_.SetBounds(0, 0, m_.Width, m_.Height) m_.Show() SplitContainer.Panel2.Controls.Add(m_) --8<---------------cut here---------------end--------------->8--- The output should look like this: --8<---------------cut here---------------start------------->8--- m_Asometext.SetBounds(0, 0, m_Asometext.Width, m_Asometext.Height) m_Asometext.Show() SplitContainer.Panel2.Controls.Add(m_Asometext) m_B1foo.SetBounds(0, 0, m_B1foo.Width, m_B1foo.Height) m_B1foo.Show() SplitContainer.Panel2.Controls.Add(m_B1foo) --8<---------------cut here---------------end--------------->8--- At the moment I copy the list from another IDE into an Emacs scratch buffer. Then I append one example layout to the scratch buffer. After copying and marking the relevant region(s) I follow up by a multitude of invocations of `M-x replace-string'. Although this is still faster than working in the IDE I copy from, I feel that there is a better way of using Emacs' abilities... So, any ideas for accomplishing this more efficiently (using a current Emacs version) are more than welcome ;-) TIA Patrick -- I never used a logarithm in my life, and could not undertake to extract the square root of four without misgivings. (Georg Bernhard Shaw)