Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Emacs extensions in Perl

21 views
Skip to first unread message

i...@wrath.odsnet.com

unread,
Mar 25, 1998, 3:00:00 AM3/25/98
to i...@wrath.odsnet.com

Hi-

I am reposting this exchange here in the hope of getting a response. It
originally occurred on perl.porters-gw, but you folks might find it an easier
request... Please cc any replies to i...@wrath.odsnet.com .

Thanks!

In article <980318211...@fahrenheit-451.media.mit.edu>,
orw...@media.mit.edu wrote:
>
> her...@BayView.COM (William R. Ward) writes:
> >
> > One pipe dream I've had for years has been an editor that is to Perl
> > as Emacs is to Lisp. Or at least a Perl interpreter embedded in Emacs
> > so that one can write Emacs extensions in Perl.
>
> John Tobey did just this: check out his "Perlmacs". Announced in TPJ
> #9 (about to be mailed), and to be the subject of an article in TPJ
> #10. Hopefully.
>

That's wonderful I admit, but am I wrong in thinking that it will increase
Emacs's already shocking memory footprint?? On my system Emacs is beaten only
by Netscape and X in its rapacity.

On the other hand I get warm fuzzies at the prospect of making Emacs
extensions in Perl. I am no fan of Lisp (even though I studied AI, or perhaps
because..), like Larry says, it has all the aesthetic appeal of toenail
clippings in a bowl of porridge.

What I would be satisfied with is a little piece of Lisp, a function
definition equivalent to saying in the minibuffer: (courtesy of M-J Dominus in
TPJ #8)

C-u M-| perl /path/extension.pl arg1 arg2
(to apply to a selected region)

or

C-x h C-u M-| perl /path/extension.pl arg1 arg2
(to apply to the entire buffer)

or

C-u M-! perl /path/extension.pl arg1 arg2
(To take effect at cursor)


just so we don't have to do all that typing in the minibuffer each time.

To tell you the truth I don't see the advantage in embedding perl into Emacs
when we can just do this. I'm starting to write lots of extensions this way
and it requires no extra effort or know-how besides remembering the above, and
hopefully someone will post a little Lisp function template to make that
unnecessary.

Unless people want more than text processing capabilities?? So far I don't
want or need anything more than that.

Cheers,
ira


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading

Erik Naggum

unread,
Mar 25, 1998, 3:00:00 AM3/25/98
to

* i...@wrath.odsnet.com

| I am reposting this exchange here in the hope of getting a response.

*AUGH*, I _HATE_ reruns of stupid discussions with clueless people.
go away!

#:Erik, who hopes that counts as "a response"
--
religious cult update in light of new scientific discoveries:
"when we cannot go to the comet, the comet must come to us."

Dr Richard A. O'Keefe

unread,
Mar 26, 1998, 3:00:00 AM3/26/98
to

i...@wrath.odsnet.com wrote:
> > > One pipe dream I've had for years has been an editor that is to Perl
> > > as Emacs is to Lisp. Or at least a Perl interpreter embedded in Emacs
> > > so that one can write Emacs extensions in Perl.

> On the other hand I get warm fuzzies at the prospect of making Emacs


> extensions in Perl. I am no fan of Lisp (even though I studied AI, or perhaps
> because..), like Larry says, it has all the aesthetic appeal of toenail
> clippings in a bowl of porridge.

This is flame bait. I've long lost count of the languages I know,
and reckon there are only two languages with less aesthetic appeal
than Perl: InterCAL and TECO.

There is a very nice editor indeed called Alpha, which is available
for 68k and Power Macintoshes, which is very Emacs-like but uses Tcl
as its extension language. Alpha is half a megabyte on disc (I don't
know if that's the "fat" binary or just the Power version) and wants
2Mb to run, not too much! TCL was designed as an extension language;
in particular it is quite convenient for interactive use. Whatever
the merits of Perl (I've just spent a day reinstalling it simply to
run weblint, which is merit enough for me), it was't designed to be
so used. In fact, raw Tcl/Tk has very useful editable text widgets,
so it doesn't take very much to make a useful extensible editor in
Tcl/Tk. Come to that, wish on a PowerMac is tiny, and prefers 4M to
run, and claims to get by in 1M.

This leads to the obvious point that tkperl probably includes the
tk editing widget, so would make an excellent basis for a Perl Emacs.

Christopher Stacy

unread,
Mar 26, 1998, 3:00:00 AM3/26/98
to
Ira, If you or someone thinks that Perl would be a good language for writing a customizable extensible editor, then they should by all means go and do so. It doesn't have anything to do with Lisp or GNU Emacs; there's nothing about the existance of those systems that are in anyone's way. Merely complaining that Emacs is not written in Perl will not accomplish anything, except to annoy Lisp programmers and waste your time and our time. I don't think most of the existing GNU EMACS user community will be very interested in a Perl EMACS, unless it also includes a compatibility feature so that it can run the large body of GNU Emacs elisp packages. Along those lines, someone's undergraduate thesis project was implementing a GNU EMACS -> Scheme EMACS interpreter, with the test program being the GNUS newsreader. But I think that was just academic. Dr Richard A. O'Keefe" <o...@atlas.otago.ac.nz> writes: > This is flame bait. I've long lost count of the languages I know, > and reckon there are only two languages with less aesthetic appeal > than Perl: InterCAL and TECO. Yes, flame bait. However -- and I don't know whether this was intentional or not -- but I found this comment to be particularly ironic, since of course EMACS was originally implemented in TECO. Stallman wanted to use Lisp originally, but the Lisp implementations of the day were not powerful enough (lacking, for example, a string data type.) Subsequent major EMACS implementations were done in Lisp. Aesthetic is just a nearly meaningless fancy word indicating "I like it", and I think there are plenty of TECO hackers who would find this aesthetic: !^R Goto Beginning:! !^R Go to beginning of buffer (leaving mark behind). With arg from 0 to 10, goes that many tenths of the file down from the beginning. Just C-U as arg means go to end.! .: "E J0 !* No arg => go to beginning.! FS ^R ARGP &6"E ZJ 0 !* Just ^U means go to end.! *Z/10J 0L .-BFS WINDOW !* Else go to fractional position (in tenths).! In any event, if Perl is so great for this task, then by all means get to it, and let us all know when you want us to take a look at it. The proof is in the pudding. Meanwhile please go away and spare the bandwidth. I'm getting tired of seeing this thread on all Emacs and Lisp newsgroups and mailing lists. Chris

Rob Warnock

unread,
Mar 27, 1998, 3:00:00 AM3/27/98
to

Christopher Stacy <cst...@pilgrim.com> wrote:
+---------------

| If you or someone thinks that Perl would be a good language for writing a
| customizable extensible editor, then they should by all means go and do so.
+---------------

Actually, a nice framework already exists! See http://mongoose.bostic.com/vi/
for the latest "Nvi" ("new vi") which has (for more than a year now!) hooks
for both Tcl and Perl as extension languages. The Tcl/Tk example in the
distribution shows that you can put the extension language "in front of"
the editor (a la Emacs), not only write "macros" in it. Although they
don't give an explicit example of doing the "Emacs style" with Perl, one
should be able to do it much the same way as the Tcl/Tk example.

So... To the original poster [not Stacy], I strongly suggest starting with
Nvi -- already a robust, good-performing editor -- as a base, so you can
spend more time on your "extensions" and less on getting a basic editor core
to work.

+---------------


| In any event, if Perl is so great for this task, then by all means
| get to it, and let us all know when you want us to take a look at it.
| The proof is in the pudding.
| Meanwhile please go away and spare the bandwidth. I'm getting tired
| of seeing this thread on all Emacs and Lisp newsgroups and mailing lists.

+---------------

Indeed. Hopefully pointing them to Nvi will quieten things down.
(But I've always been an optimist...)


-Rob

p.s. The extension hooks in Nvi are not specific to Tcl or Perl. It looks
like one should easily be able to hook in any of the Schemes that use a
C-compatible GC as an Nvi extension language, too. "Film at 11..."

p.p.s. Nvi-1.79 is the current version, and FWIW I've been using it
instead of "vi" as my main editor for over a year (though w/o using any
of the extension-language features... yet). Seems pretty stable.

-----
Rob Warnock, 7L-551 rp...@sgi.com http://reality.sgi.com/rpw3/
Silicon Graphics, Inc. Phone: 650-933-1673 [New area code!]
2011 N. Shoreline Blvd. FAX: 650-933-4392
Mountain View, CA 94043 PP-ASEL-IA

Mike Mcdonald

unread,
Mar 27, 1998, 3:00:00 AM3/27/98
to

In article <6fbj7h$loa$1...@nnrp1.dejanews.com>,
i...@wrath.odsnet.com writes:

> On the other hand I get warm fuzzies at the prospect of making Emacs
> extensions in Perl. I am no fan of Lisp (even though I studied AI, or perhaps
> because..), like Larry says, it has all the aesthetic appeal of toenail
> clippings in a bowl of porridge.

Hmm, that's the best description of Perl I think I've
ever heard! Thanks! (Trying to start another Perl vs
Lisp flame war, are we?)

Mike McDonald
mik...@mikemac.com


Martin B. Pomije

unread,
Mar 27, 1998, 3:00:00 AM3/27/98
to i...@wrath.odsnet.com

i...@wrath.odsnet.com wrote:
(snip)

>
> On the other hand I get warm fuzzies at the prospect of making Emacs
> extensions in Perl. I am no fan of Lisp (even though I studied AI, or perhaps
> because..), like Larry says, it has all the aesthetic appeal of toenail
> clippings in a bowl of porridge.
>

I have finally seen the light. Thank you dear sir.

Perl is elegant.
Slavery is freedom.
Larry Wall is God.
--
*********************************************
Semi-encrypted email address: m_b_p_o_m_i_j_e_ a_t_ i_n_a_v_ d_o_t_
n_e_t_
All non-solicited commercial email will be billed $1,000.

Clayton Weaver

unread,
Mar 28, 1998, 3:00:00 AM3/28/98
to

\\\\[oddball character]
(perl is more handy than lisp)

(funcname (args)
;; do something with args
(;; args not mangled to flat list ...)
;; (lisp is more handy than perl)
)

[compile] (lisp is more handy than perl)

It's just a question of task context.

Regards, Clayton Weaver cgw...@eskimo.com (Seattle)


0 new messages