The problem is that if you want a perl binding to be useful beyond
learning how tie language together then you want fast access to the
editor part of XEmacs, i.e. buffers, characters etc. Wouldn't you want
to be able to say.
# Disclaimer
# My Perl is rusty
# count lines in buffer not matching
BUFFER = Emacs::Buffer($name);
while (<BUFFER>)
{
count++ unless /not included/;
}
This gets you immediately into problems because the XEmacs
buffer substring would be in Mule encoding... etc...
In fact, I have plans for the BUFFER filehandle to refer automatically
to the current buffer. Filehandles can be tied in Perl. Translation
can be performed in READ, READLINE, PRINT, etc. methods. Again, for
optimization, one might eventually want something more low-level.
Likewise, STDIN and STDERR will automatically use the minibuffer, and
STDOUT will send its output to the current buffer.
I don't know any of the details of Mule, text properties, intervals,
etc., but Perl is quite flexible.
Do you have any example of a typical Perlmacs application? Maybe a
Perl port of some standard piece of elisp?
There are as yet no Perlmacs applications. One idea is a graphical
Perl debugger and data browser. Another is to use Perl's POSIX thread
support (with a global emacs mutex, of course) to download big files
in the background. Then there is Perl's network connectivity,
database drivers, etc. See
http://www.perl.com/CPAN/modules/00modlist.long.html for a long list
of possibilities.
> and the finalizer decs it. Since decrementing the refcount can
invoke
> user code, this happens after the mark bits have been cleared. I
> didn't notice whether XEmacs finalizers have this luxury..
You mean that you want the finalizers to be called after the sweep
fase has been fully completed? This could probably be handled by a
finalizer that puts the object on some "perl ojects to be freed list"
and some general mechanism for functions to be run after the end of
the sweep?
Yes. I don't see any way around that requirement.
In this case what you really want is XEmacs as a loadable module
into
perl!
uh-oh! You read my mind... ;-)