[Top][All Lists]

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

Re: good examples of Emacs modules?

From: Óscar Fuentes
Subject: Re: good examples of Emacs modules?
Date: Thu, 31 Mar 2016 23:59:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux)

Aurélien Aptel <address@hidden> writes:

> Hi all,
> On Thu, Mar 31, 2016 at 10:23 PM, Óscar Fuentes <address@hidden> wrote:
>> consequences.) How objects created by the module system interact with
>> garbage collection is an start.
> Every emacs_value allocated inside a Lisp-exposed function becomes
> invalid when control of the function ends (when it exits) unless you
> return that value or you mark it global with the the
> env->make_global_ref() API call.


> As I was googling for a browseable emacs git repo to look quickly at
> emacs-module.h I've noticed that Syohei Yoshida (cc'ed) has figured a
> lot of things out by himself (kudos to you!) and has already made some
> simple and not-so-simple modules:

Thank you. The more examples, the better.

I'll like to encourage you to keep expanding the introduction, though.
The type on information it contains saves a lot of head scratching.

BTW, it is necessary to explicitly export the symbols on Windows (and on
GNU/Linux too depending on the arguments used):

int plugin_is_GPL_compatible;

should be

int __declspec(dllexport) plugin_is_GPL_compatible;


int __attribute__ ((visibility("default"))) plugin_is_GPL_compatible;

(GNU/Linux, when you compile your module with -fvisibility=hidden, which
is a Good Thing.)

This is usually implemented with a macro.

More info:


That page mentions C++ but it applies to C too.


reply via email to

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