From: Peter Lee <pete.a.lee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: keyboard macro create function from list
Date: Thu, 07 Jun 2007 19:33:26 GMT [thread overview]
Message-ID: <u3b13v9tl.fsf@gmail.com> (raw)
In-Reply-To: 87ejkor50b.fsf@pdrechsler.de
>>>> 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.
next prev parent reply other threads:[~2007-06-07 19:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-07 0:18 keyboard macro create function from list Patrick Drechsler
2007-06-07 19:33 ` Peter Lee [this message]
2007-06-09 7:54 ` Patrick Drechsler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=u3b13v9tl.fsf@gmail.com \
--to=pete.a.lee@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).