Hello all.
Over the weekend I had what I thought was a bright idea. While Elisp is
ummm ... fine and dandy, I figured it would be nice if it were possible to
extend XEmacs using dynamically loaded objects. For those applications
that are very CPU intensive, it would make more sense (and make for much
greater speed) if they were written in C and then loaded into emacs.
A faster HTML parser would be a good example. So I styarted hacking about
in the source and I now have rudimentary support for this. I have added
the commands for loading in .sos and I am doing almost everything right.
However, there are some problems.
I would like to enlist the help of an XEmacs internals guru to get me over
these hurdles, if you think this would be a worthwhile exercise. I already
have things set up such that compiling modules is trivial (and will work
the same way on all platforms that support dlopen()). Here is what I dont
know how to do, or do properly:
a) Getting DOC strings for variables defined correctly. When the .so is loaded
in, a special function is called which does the moral equivalent of
DEFSUBR() or DEFVAR_LISP() et al. I can see the variables defined but
I dont know how to go about making the doc string visible.
b) When i DEFSUBR() a function that was declared in the .so, and try to execute
it, I get a SIGSEGV in Fcommanp when it calls SUBRP(fun).
There is deep dark stuff I dont understand too well and would like to. Such
as:
1) What is staticpro?
2) When do I need to GCPRO and when not? Whats the difference between
GCPRO and NGCPRO?
3) Since this is all dynamic, after Emacs has dumped, how do I avoid
purespace? Do I need to? Can I use xmalloc() for internal data?
4) If there is an existing Lisp or even intern function, can I replace its
definition with a new one? How? Same thing for variables.
Any help at all would be GREATLY appreciated. If it would help to talk
by phone rather than email, let me know and I can either call or give you
a 1-800 number for you to call me at. If you can help out, I would appreciate
it if you could respond privately, as I dont read the whole list very often.
I will summarise my findings.
Thanks in advance,
--
J. Kean Johnston | "Truth and beauty, beauty and truth. This is all we know,
Engineer, SPG | and all we need ever know." -- John Keats, Endymion
Santa Cruz, CA +----------------------------------------------------------
Tel: 408-427-7569 Fax: 408-429-1887 E-mail: jkj(a)sco.com