emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic loading progress


From: Aurélien Aptel
Subject: Re: Dynamic loading progress
Date: Thu, 24 Sep 2015 14:45:37 +0200

Some updates.

I haven't made any progress on errors. I was reading on
condition-case, setjmp/longjmp and how it's used for
signaling/throwing. I actually knew very little about it. I shouldnt
be the one writing this stuff I think... Anyway I was looking into how
I would set up a "catch-all" wrapping code so that we can implement a
funcall that always returns and I still haven't figured it out. You
said you would rather have an "unsafe" funcall that sometimes not
return to module code so I will try to do that. And realisticly if we
want this in emacs 25 it's the only way (I don't feel confident enough
to do that bit properly and I'm the only one working on this). We can
always fix it afterwards or simply have a "safe" and an "unsafe"
version of funcall in the API. I personally think having a clean
simple API from the module writer POV is better (least surprise
principle) so I'm in favor of wrapping, in the long term.

I think changing the API in the early stage is fine and I don't worry
too much about binary API changes because it's only going to be used
with GPL plugins (i.e. modules can be fixed and recompiled, most of
the time).

I've added [1] a tool that can generate modules basic code from
templates (Makefile, source file, ERT test file) and can run module
tests in batch. It's going to be easier to get started and easier for
me to write tests. I've put everything in the modules/ subdir, I know
its a bit messy having a python script there along with a lisp file
(common elisp functions for module test) but it's my setup right now
and it saves me time (i.e. deal with it! :). We can remove or change
it afterwards if we want.

Here's how you use it:

    # after successfully compiling emacs
    % cd modules

    % ./modhelp.py init modt-mymod
    writing modt-mymod/test.el...
    writing modt-mymod/Makefile...
    writing modt-mymod/modt-mymod.c...
    done! you can run ./modhelp.py test modt-mymod

    % ./modhelp.py test modt-mymod
    [*] ./modt-mymod: ------- start -------
    [*] ./modt-mymod: running make
    gcc -ggdb3 -Wall -I../../src -fPIC -c modt-mymod.c
    gcc -shared  -o modt-mymod.so modt-mymod.o
    ../../lib-src/make-docfile modt-mymod.c > modt-mymod.doc
    rm modt-mymod.o
    [*] ./modt-mymod: running test
    ../src/emacs -batch -L . -l ert -l ./modt-mymod/test.el -f
ert-run-tests-batch
    Running 1 tests (2015-09-24 14:33:44+0200)
       passed  1/1  modt-mymod-fun-test

    Ran 1 tests, 1 results as expected (2015-09-24 14:33:44+0200)


    [*] 1/1 MODULES OK

Running the `test` command without specifying the module tests all
module. (Hm.. I just noticed modules makefiles were ignored/not
commited by git. I've just fixed it)

I've started working on the configure.ac to make module a build time
option (still a WIP, I've only commited it to be able to work on it
from other computers).

1: 
https://github.com/aaptel/emacs-dynamic-module/commit/46c5f032ebf49275e346cae015dc39cbe3f8ebea



reply via email to

[Prev in Thread] Current Thread [Next in Thread]