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: Peter Lee
Subject: Re: keyboard macro create function from list
Date: Thu, 07 Jun 2007 19:33:26 GMT
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (windows-nt)

>>>> 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.



reply via email to

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