[−][src]Attribute Macro emacs::module
#[module]
Registers a function as the initializer, to be called when Emacs loads the module. Each dynamic module must have one and only one such function.
Options
-
name
: By default, the name of the feature provided by the module is the crate's name (with_
replaced by-
). There is no need to explicitly callprovide
inside the initializer. This option allows the initializer's name, or a string, to be used instead. Examples:#[module(name(fn))]
,#[module(name = "feature-name")]
. -
defun_prefix
andseparator
: Function names in Emacs are conventionally prefixed with the feature name followed by-
. These 2 options allow different prefix and separator to be used. Example:#[module(name = "foo-dyn", defun_prefix = "foo", separator = "/")]
. -
mod_in_name
: Whether to use Rust'smod
path to construct function names. Default totrue
. For example, supposed that the crate is namedparser
, a #[defun
] namednext_child
insidemod cursor
will have the Lisp name ofparser-cursor-next-child
. This can also be overridden for each individual function, by an option of the same name on #[defun
].