diff options
| author | Philipp Stephani | 2020-09-13 20:21:41 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2020-09-13 20:26:47 +0200 |
| commit | da0e75e7410226d7fd6d760f0ebe8a04d815506d (patch) | |
| tree | 1c850a5c13e3af18b7ca8cfe1b785d51300d9dde /src/data.c | |
| parent | 3eb4e0db5ce247f8396daac3156087fbb7aefbd4 (diff) | |
| download | emacs-da0e75e7410226d7fd6d760f0ebe8a04d815506d.tar.gz emacs-da0e75e7410226d7fd6d760f0ebe8a04d815506d.zip | |
Add facility to make module functions interactive (Bug#23486).
* src/module-env-28.h: Add field for 'make_interactive' function.
* src/emacs-module.c (Lisp_Module_Function): Add new field holding the
interactive form.
(allocate_module_function): Adapt to structure layout change.
(module_make_interactive, module_function_interactive_form): New
functions.
(initialize_environment): Use them.
* src/eval.c (Fcommandp):
* src/data.c (Finteractive_form): Also handle interactive module
functions.
* test/data/emacs-module/mod-test.c (Fmod_test_identity): New test
function.
(emacs_module_init): Create two interactive module test functions.
* test/src/emacs-module-tests.el (module/interactive/return-t)
(module/interactive/return-t-int, module/interactive/identity):
New unit tests.
* doc/lispref/internals.texi (Module Functions): Document new
function. Rework paragraph about wrapping module functions, as the
example no longer applies.
* etc/NEWS: Document new facility.
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/data.c b/src/data.c index 59d148166fe..dae8b10ef55 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -906,6 +906,13 @@ Value, if non-nil, is a list (interactive SPEC). */) | |||
| 906 | if (PVSIZE (fun) > COMPILED_INTERACTIVE) | 906 | if (PVSIZE (fun) > COMPILED_INTERACTIVE) |
| 907 | return list2 (Qinteractive, AREF (fun, COMPILED_INTERACTIVE)); | 907 | return list2 (Qinteractive, AREF (fun, COMPILED_INTERACTIVE)); |
| 908 | } | 908 | } |
| 909 | else if (MODULE_FUNCTIONP (fun)) | ||
| 910 | { | ||
| 911 | Lisp_Object form | ||
| 912 | = module_function_interactive_form (XMODULE_FUNCTION (fun)); | ||
| 913 | if (! NILP (form)) | ||
| 914 | return form; | ||
| 915 | } | ||
| 909 | else if (AUTOLOADP (fun)) | 916 | else if (AUTOLOADP (fun)) |
| 910 | return Finteractive_form (Fautoload_do_load (fun, cmd, Qnil)); | 917 | return Finteractive_form (Fautoload_do_load (fun, cmd, Qnil)); |
| 911 | else if (CONSP (fun)) | 918 | else if (CONSP (fun)) |