1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 15:00:45 -08:00
emacs/test/data
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
..
decompress * lisp/tar-mode.el (tar-extract): Call tar--try-jka-compr (bug#34251) 2019-02-03 23:00:29 +02:00
emacs-module Add a module function to open a file descriptor connected to a pipe. 2020-03-26 21:47:25 +01:00
epg Fix epg-tests with dummy-pinentry program (Bug#23619) 2017-02-28 19:57:35 -05:00
image Don't have exif bugging out on short strings 2020-03-19 16:15:24 +01:00
mailcap Add tests for mailcap.el 2017-09-05 11:55:01 -04:00
net Move the cert files to the data directory 2016-03-20 16:08:55 +01:00
shr Handle HTML 'ol' start attribute in shr.el 2019-02-22 09:52:57 +02:00
themes Update copyright year to 2020 2020-01-01 00:59:52 +00:00
vc/diff-mode * test/lisp/vc/diff-mode-tests.el (diff-mode-test-font-lock): New test. 2019-02-02 23:23:16 +02:00
xdg Add MIME apps spec utilities 2017-09-26 17:48:00 -04:00
xref Port xref-tests to master branch 2016-05-06 10:09:53 -07:00
files-bug18141.el.gz
minibuffer-test-cttq$tion * test/lisp/minibuffer-tests.el (completion-table-test-quoting): New test 2019-11-26 13:18:18 -05:00
somelib.el Put re-loaded file back at start of load-history (bug#26837) 2017-05-09 19:44:09 -04:00
somelib2.el Put re-loaded file back at start of load-history (bug#26837) 2017-05-09 19:44:09 -04:00