if (!VECTORP (cu->data_fdoc_v))
xsignal2 (Qnative_lisp_file_inconsistent, cu->file,
build_string ("missing documentation vector"));
- return AREF (cu->data_fdoc_v, XSUBR (function)->doc);
+ EMACS_INT doc = XSUBR (function)->doc;
+ if (doc < 0)
+ return AREF (cu->data_fdoc_v, -doc - 1);
+ return make_fixnum (doc);
}
static Lisp_Object
x->s.symbol_name = xstrdup (SSDATA (symbol_name));
x->s.intspec.native = intspec;
x->s.command_modes = command_modes;
- x->s.doc = XFIXNUM (doc_idx);
+ x->s.doc = -XFIXNUM (doc_idx) - 1;
+ eassert (x->s.doc < 0);
#ifdef HAVE_NATIVE_COMP
x->s.native_comp_u = comp_u;
x->s.native_c_name = xstrdup (SSDATA (c_name));
fun = XCDR (fun);
/* Lisp_Subrs have a slot for it. */
if (SUBRP (fun))
- XSUBR (fun)->doc = offset;
+ {
+ XSUBR (fun)->doc = offset;
+ eassert (XSUBR (fun)->doc >= 0);
+ }
else if (CLOSUREP (fun))
{
/* This bytecode object must have a slot for the docstring, since
Lisp_Object native;
} intspec;
Lisp_Object command_modes;
+ /* positive values: offset into etc/DOC. Negative values: one's
+ complement of index into the native comp unit's function
+ documentation vector. */
EMACS_INT doc;
#ifdef HAVE_NATIVE_COMP
Lisp_Object native_comp_u;