Aurélien Aptel <aurelien.aptel+emacs@gmail.com> schrieb am Do., 31. März 2016 um 16:49 Uhr:
On Thu, Mar 31, 2016 at 1:17 AM, Paul Eggert <eggert@cs.ucla.edu> wrote:
> I am thinking of assigning a programming problem for students to use the new
> Emacs module facility. Are there good examples of how module-load can be
> used, that I can point people at? Ideally the examples would work on RHEL 7,
> since that's the standard instructional environment around here. Thanks for
> any pointers you can provide.

I'm in the process of writing an introduction. You can find a draft here:

http://diobla.info/blog-archive/modules-tut.html

It should get them started. Everything else is documented in the
emacs-module.h header.


Thanks. I'd suggest the following additions:
1. Please discuss error handling early on. How errors are handled is arguably the most subtle point of the API.
2. Please discuss the lifetime of environments and values. This is also extremely subtle and can easily lead to undefined behavior.
3. Please add explicit checks for the size of structures. If the actual structure passed from Emacs is smaller than the expected structure, undefined behavior will happen if one of the "excess" members is accessed.
4. You should also mention how Emacs deals with stack overflow, because that can lead to inconsistent data structures and undefined behavior as well.

I'm writing a reference and a set of caveats for modules, unfortunately progress is very slow on my part.