Editor with perl as macro language?
: I am looking for an editor which is using perl as it's macro language. I
: think its nifty regular expressions make it most suited for this task.
: Any ideas? Is this possible?
: Of course, I could use just about any good editor and use a perl script as a
: filter to pipe marked text through, but this seems ugly and clumsy. (and it
: doesn't appeal to the Laziness in me;)
I can't answer your question directly, but if you have X capability you might
want to look at the sam editor, written by Rob Pike of Bell Labs. It has a
nice regular expression language that allows you to span lines and select any
arbitrary piece of text you can think of an expression for. I've been using
Perl for about 5 years, and sam for 1, and I feel like I have the best of
everything.
Another advantage of sam is that it has command history, unlike editors like
vi. It also has unlimited undo, meaning that you can try a command, and if
it doesn't do what you want you can undo it, edit it in place, and try again.
On those rare occasions where you can't do something in sam's language, like
do math, you can write a command to pipe each instance of an expression through
a perl script. I've done this to do things like increment every number between
brackets. Clunky, yes, but useful in a pitch.
Beirne
--
-------------------------------------------------------------------------------
Beirne Konarski | Subscribe to the Unicycling Mailing List
"Untouched by Scandal" | Unicycling Web Page:
| http://nimitz.mcs.kent.edu/~bkonarsk/
-------------------------------------------------------------------------------