diff options
| author | Eli Zaretskii | 2015-11-21 12:49:57 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-11-21 12:49:57 +0200 |
| commit | 3858b7949fdf5af8dd94cefc5a2684ad285e2cdf (patch) | |
| tree | f7e4566d0b46d076166bb13d6c6200e089819174 /etc | |
| parent | 2299267805bbf5ece023908922383677b5d4a44b (diff) | |
| download | emacs-3858b7949fdf5af8dd94cefc5a2684ad285e2cdf.tar.gz emacs-3858b7949fdf5af8dd94cefc5a2684ad285e2cdf.zip | |
Improve documentation of dynamic modules
* src/fns.c (Frequire): Doc fix to include the dynamic module
support.
* src/lread.c (Fload, Vload_suffixes): Doc fixes to include the
dynamic module support.
(Fload): Treat the module suffix the same as '*.el' and '*.elc'
wrt the MUST-SUFFIX argument.
* etc/NEWS: Expand documentation of dynamically loaded modules.
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/NEWS | 40 |
1 files changed, 33 insertions, 7 deletions
| @@ -305,13 +305,39 @@ header. | |||
| 305 | which specifies an alternative printing method which is faster when | 305 | which specifies an alternative printing method which is faster when |
| 306 | few or no entries have changed. | 306 | few or no entries have changed. |
| 307 | 307 | ||
| 308 | ** Emacs can now load shared/dynamic libraries (modules) that expose a | 308 | ** Emacs can now load shared/dynamic libraries (modules). |
| 309 | C interface. Such modules can provide additional functions or | 309 | A dynamic Emacs module is a shared library that provides additional |
| 310 | otherwise interact with Emacs just like Lisp code. Modules have to | 310 | functionality for use in Emacs Lisp programs, just like a package |
| 311 | export a function `emacs_module_init' and conform to the API laid out | 311 | written in Emacs Lisp would. The functions `load' and `require' were |
| 312 | in emacs-module.h. Modules are disabled by default and need to be | 312 | extended to load such modules, as they do with Emacs Lisp packages. |
| 313 | enabled using the --with-modules configure flag. They are | 313 | |
| 314 | experimental and subject to change. | 314 | A module should export a C-callable function named |
| 315 | `emacs_module_init', which Emacs will call as part of the call to | ||
| 316 | `load' or `require' which loads the module. It should also export a | ||
| 317 | symbol named `plugin_is_GPL_compatible' to indicate that its code is | ||
| 318 | released under the GPL or compatible license; Emacs will refuse to | ||
| 319 | load modules that don't export such a symbol. | ||
| 320 | |||
| 321 | If a module needs to call Emacs functions, it should do so through the | ||
| 322 | API defined and documented in the header file `emacs-module.h'. Note | ||
| 323 | that any module that provides Lisp-callable functions will have to use | ||
| 324 | Emacs functions such as `fset' and `funcall', in order to register its | ||
| 325 | functions with the Emacs Lisp interpreter. | ||
| 326 | |||
| 327 | Modules can create `user-ptr' Lisp objects that embed pointers to C | ||
| 328 | struct's defined by the module. This is useful for keeping around | ||
| 329 | complex data structures created by a module, to be passed back to the | ||
| 330 | module's functions. User-ptr objects can also have associated | ||
| 331 | "finalizers" -- functions to be run when the object is GC'ed; this is | ||
| 332 | useful for freeing any resources allocated for the underlying data | ||
| 333 | structure, such as memory, open file descriptors, etc. A new | ||
| 334 | predicate `user-ptr-p' returns non-nil if its argument is a `usr-ptr' | ||
| 335 | object. | ||
| 336 | |||
| 337 | Loadable modules in Emacs are an experimental feature, and subject to | ||
| 338 | change in future releases. For that reason, their support is disabled | ||
| 339 | by default, and must be enabled by using the `--with-modules' option | ||
| 340 | at configure time. | ||
| 315 | 341 | ||
| 316 | 342 | ||
| 317 | * Editing Changes in Emacs 25.1 | 343 | * Editing Changes in Emacs 25.1 |