Perl embedded in Emacs
Stavros Macrakis <macrakis <at> alum.mit.edu>
2000-08-05 16:08:14 GMT
To pick up on an old thread:
merlyn <at> stonehenge.com (Randal L. Schwartz):
> Well, there's already a Perl-embedded-in-Emacs
flee <at> teleport.com replied:
> it doesn't do anything special for buffers. if you want to
manipulate a buffer in perl, you either have to call the
lisp routines, or use buffer-string to convert the buffer to
a string that perl can use, which is ... icky.
move_gap(ZV) will get you a contiguous string. If Perl represents strings as
{char *start; int length} or something, this is all you need to do. Of
course, you can only modify it "in-place" (not change its length). But
that's true of Emacs strings, too.
If you do want to manipulate the buffer directly, you need to use some sort
of buffer API. Does Perl allow you to wrapper Emacs buffers up so that they
look like Perl strings? It would be pretty straightforward to call the
appropriate Emacs routines as necessary. I think you could do that in
Python, but I haven't tried. (I'm an old-time Emacs Lisp hacker....)
-s