summaryrefslogtreecommitdiff
path: root/src/data.c
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-03-19 15:11:15 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2022-03-19 15:11:37 +0100
commit71b8f1fc635d9bbe00ca89457065e0c83456ac43 (patch)
tree49edc7bebd20340555baf2a28ef8a4dcd05504db /src/data.c
parentc79e0188e849715a7c4dc306c93ad8d0b3517d32 (diff)
downloademacs-71b8f1fc635d9bbe00ca89457065e0c83456ac43.tar.gz
Make `command-modes' work for (native-compiled) subrs, too
* lisp/emacs-lisp/comp.el (comp-func): Add a command-modes slot. (comp-spill-lap-function, comp-intern-func-in-ctxt): Fill it. (comp-emit-for-top-level, comp-emit-lambda-for-top-level): Use it. * src/alloc.c (mark_object): Mark the command_modes slot. * src/comp.c (make_subr): Add a command_modes parameter. (Fcomp__register_lambda): Use it. (Fcomp__register_subr): Ditto. * src/data.c (Fcommand_modes): Output the command_modes data for subrs (bug#54437). * src/lisp.h (GCALIGNED_STRUCT): Add a command_modes slot. * src/pdumper.c (dump_subr): Update hash. (dump_subr): Dump the command_modes slot.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/data.c b/src/data.c
index 23b0e7c29d9..5894340aba3 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1167,7 +1167,11 @@ The value, if non-nil, is a list of mode name symbols. */)
fun = Fsymbol_function (fun);
}
- if (COMPILEDP (fun))
+ if (SUBRP (fun))
+ {
+ return XSUBR (fun)->command_modes;
+ }
+ else if (COMPILEDP (fun))
{
if (PVSIZE (fun) <= COMPILED_INTERACTIVE)
return Qnil;