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

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

Re: Wrapping code in a try/except


From: Andreas Röhler
Subject: Re: Wrapping code in a try/except
Date: Wed, 03 Nov 2010 11:51:01 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6

Am 03.11.2010 11:13, schrieb Andrea Crotti:
It would be nice sometimes to be able to wrap multiple lines

istruction1();
istruction2();

in something like

try {
     istruction1();
     istruction2();
} except ...

I can use for example
(kill-region (point) (mark))

then insert what the construct and yank what I killed, but I would
rather use a yasnippet snippet for it, but I can't use a snippet since
while I'm writing I don't have a region selected...

Should I create a command instead? Or is there something for these kind
of things?




Hi Andrea,

if its just about editing and that simple as shown
M-x query-replace-regexp

should do all you need.

Maybe narrow the buffer to region before.


Andreas

--
https://code.launchpad.net/~a-roehler/python-mode/python-mode-components
https://code.launchpad.net/s-x-emacs-werkstatt/




reply via email to

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