emacs/test/src
Philipp Stephani d28b004768 Add a module function to open a file descriptor connected to a pipe.
A common complaint about the module API is that modules can't
communicate asynchronously with Emacs.  While it isn't possible to
call arbitrary Emacs functions asynchronously, writing to a pipe
should always be fine and is a pretty low-hanging fruit.

This patch implements a function that adapts an existing pipe
process.  That way, users can use familiar tools like process filters
or 'accept-process-output'.

* src/module-env-28.h: Add 'open_channel' module function.

* src/emacs-module.c (module_open_channel): Provide definition for
'open_channel'.
(initialize_environment): Use it.

* src/process.c (open_channel_for_module): New helper function.
(syms_of_process): Define necessary symbol.

* test/src/emacs-module-tests.el (module/async-pipe): New unit test.

* test/data/emacs-module/mod-test.c (signal_system_error): New helper
function.
(signal_errno): Use it.
(write_to_pipe): New function running in the background.
(Fmod_test_async_pipe): New test module function.
(emacs_module_init): Export it.

* doc/lispref/internals.texi (Module Misc): Document new module
function.

* doc/lispref/processes.texi (Asynchronous Processes): New anchor
for pipe processes.

* etc/NEWS: Document 'open_channel' function.
2020-03-26 21:47:25 +01:00
..
regex-resources * test/src/regex-resources/PTESTS: Convert to UTF-8. 2016-12-12 23:17:19 -08:00
alloc-tests.el Fix crash when sending Gnus message (Bug#39207) 2020-01-22 23:44:34 -08:00
buffer-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
callint-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
callproc-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
casefiddle-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
charset-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
chartab-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
cmds-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
coding-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
data-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
decompress-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
doc-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
editfns-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
emacs-module-tests.el Add a module function to open a file descriptor connected to a pipe. 2020-03-26 21:47:25 +01:00
eval-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
fileio-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
floatfns-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
fns-tests.el Fix sxhash-equal on bytecodes, markers, etc. 2020-01-07 11:29:42 -08:00
font-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
inotify-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
json-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
keyboard-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
keymap-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
lcms-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
lread-tests.el Remove lread tests for a feature that was deleted 2020-02-14 11:10:55 -08:00
marker-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
minibuf-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
print-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
process-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
regex-emacs-tests.el Revert "Signal an error for the regexp "[:alnum:]"" 2020-02-27 18:58:05 +01:00
syntax-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
textprop-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
thread-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
timefns-tests.el Fix rounding errors in time conversion 2020-03-03 10:20:32 -08:00
undo-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
xml-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00