Editor with perl as macro language? 
Author Message
 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;)

If such a beast doesn't exist _yet_, would it be possible, to tear apart an
existing editor like JOE, JED (with the permission of their authors, of
course) and integrate perl?

Seems like a project to gain a lot of fame with ;-)

--
Lars Marowsky-Bree   Voice: +49-571-63663  PGP-key via return receipt

Quote:
>           Certainly I am arrogant - the best usually are          <



Sat, 19 Jul 1997 07:03:14 GMT  
 Editor with perl as macro language?

Quote:

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

 [...]

Quote:
>If such a beast doesn't exist _yet_, would it be possible, to tear apart an
>existing editor like JOE, JED (with the permission of their authors, of
>course) and integrate perl?

>Seems like a project to gain a lot of fame with ;-)

Was Tom thinking of putting perl in as a macro language for nvi?

Mike

--
The "usual disclaimers" apply.    | Meiko
Mike Stok                         | 130C Baker Ave. Ext

Meiko tel: (508) 371 0088 x124    |



Mon, 21 Jul 1997 22:26:43 GMT  
 Editor with perl as macro language?

Quote:

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

Although this is largely irrelevant to the UNIX world, Pete Keleher

Macintosh that supports respectable Perl4.36 integration.

The TCL is interpreted internally (and makes up much of the code for the
editor) and the Perl is handed over to another process, along with any
relevant blocks of text. You can also select a block of perl code and
instruct the editor to get it executed for you.

I've played with a number of text processing scripts, and one can
acheive an adequate degree of Laziness(*) with this system. It would seem
worthwhile to work at integrating perl into more editors.

(*) See the glossary to _Programming_Perl_, by Wall and Schwartz.

Cheers,
Eric

--

http://coos.dartmouth.edu/



Thu, 24 Jul 1997 10:53:55 GMT  
 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/
-------------------------------------------------------------------------------



Thu, 24 Jul 1997 11:45:18 GMT  
 Editor with perl as macro language?

Beirne, where can we find "same"?

:}... if you have X capability you might
:}want to look at the sam editor, written by Rob Pike of Bell Labs. ....

--
#include <disclaimer.h>

/*     Mentor Graphics Corporation   |   ADT Engineering                 */
/*     Wilsonville, OR, 97070-7777   |   Phone  : 503.685.1240           */
___________________________________________________________________________



Mon, 28 Jul 1997 08:01:43 GMT  
 Editor with perl as macro language?

: Beirne, where can we find "same"?


: :}... if you have X capability you might
: :}want to look at the sam editor, written by Rob Pike of Bell Labs. ....

Here is the location to ftp sam:

        ftp://netlib.att.com/netlib/research/sam.msg.Z

To give  you an idea of sam's regular expressions, here is a command to
remove all comments from a file of C code:

,x#/\*([^*/]|\n|[^*]/|\*[^/]|\*\n)+\*/#d

Now, this is an ugly looking command, but since sam has command history and
unlimited undo, you can keep working at commands like this until you get
them right.

Beirne

--
-------------------------------------------------------------------------------
Beirne Konarski         | Subscribe to the Unicycling Mailing List

"Untouched by Scandal"        | Unicycling Web Page:
                        | http://nimitz.mcs.kent.edu/~bkonarsk/
-------------------------------------------------------------------------------



Wed, 30 Jul 1997 08:48:08 GMT  
 Editor with perl as macro language?
: To give  you an idea of sam's regular expressions, here is a command to
: remove all comments from a file of C code:
:
: ,x#/\*([^*/]|\n|[^*]/|\*[^/]|\*\n)+\*/#d
:
: Now, this is an ugly looking command, but since sam has command history and
: unlimited undo, you can keep working at commands like this until you get
: them right.

It's a lot easier to get s</\*.*?\*/><>sg right the first time.

Larry Wall



Mon, 04 Aug 1997 06:35:06 GMT  
 Editor with perl as macro language?

Beirne> ,x#/\*([^*/]|\n|[^*]/|\*[^/]|\*\n)+\*/#d

Beirne> Now, this is an ugly looking command, but since sam has command history and
Beirne> unlimited undo, you can keep working at commands like this until you get
Beirne> them right.

You didn't work long enough. :-)  This one fails on:

        /* in **/ out /* in */

because it considers "out" part of the comment.  You have to be really
really careful not to match two stars in a row when you're looking for
a star followed by a not-slash, because the not-slash could be the
star that closes the comment.

I think the Perl5 solution is much nicer.

        s#/\*.*?\*/##sg;

print "Just another Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying

Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>



Thu, 07 Aug 1997 01:47:20 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Editor with Perl as macro language?

2. Codewright Programmer's Editor Supports Perl As Macro Language

3. emacs-like editor with perl as its extension language

4. Announce: Macro.pm - macro pre-processor with embedded perl capability

5. ANNOUNCE: HTML::Macro HTML macro processor (templating system)

6. Macro preprocessor -- how do I say $macro = regexp_match

7. Announce: Macro.pm & macro - A macro pre-processor with embedded perl capability

8. Natural selection of languages (was: JAVA papers [re: oak] [re: features for systems programming languages]) [LONG]

9. psychology of language choice (was Re: language war ...)

10. natural language vs. computer language

11. natural language vs. computer language

12. Does Perl have regexpr macros?

 

 
Powered by phpBB® Forum Software