help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: keyboard macro create function from list


From: Patrick Drechsler
Subject: Re: keyboard macro create function from list
Date: Sat, 09 Jun 2007 09:54:58 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux)

Peter Lee <pete.a.lee@gmail.com> writes:
> 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

Very nice, thanks a lot Peter!

Cheers,

Patrick
-- 
"Science knows only one commandment: contribute to science."
   -- Bertolt Brecht, "Galileo".


reply via email to

[Prev in Thread] Current Thread [Next in Thread]