[−][src]Attribute Macro emacs_macros::defun
#[defun]
Exports a function to the Lisp runtime. The function is bound at initialization, even if it is defined inside another function which is never called.
Naming
By default, the function's Lisp name has the form <feature-prefix>[mod-prefix]<base-name>
.
feature-prefix
is the feature's name, followed by-
. This can be customized by thename
andseparator
options on#[module]
.mod-prefix
is constructed from the function's Rust module path (with_
replaced by-
). This can be turned off crate-wide, or for individual function, using the optionmod_in_name
.base-name
is the function's Rust name (with_
replaced by-
). This can be overridden with the optionname
, e.g.#[defun(name = "foo:bar")]
.