Steffen Nurpmeso wrote in
<20220916204431.ldtoq%[email protected]>:
...
I also rewrite splice hook docu with credits to you.
These hooks run after compose mode is finished, but before
on-compose-leave[492]. Both are executed in a subprocess, with
their input and output connected such that they can act like an
interactive user: S-nail's output they read[252], input for
S-nail they can echo[184]. Whereas the latter is a SHELL[638]
command, the former is a define[173]d macro that is evaluated
in a restricted mode with only a small set of commands avail-
able (the verbose[611] output of for example list[219] indi-
cates the `subprocess' capability).
In the subprocess (a restricted set of) COMMAND ESCAPES[30]
will always be available. For guaranteed reproducibilities'
sake escape[416] and ifs[444] are set to their defaults. The
escape ~^[320] has been especially designed for scriptability:
the first line these hooks will read on standard input is the
escape's protocol version ("0 0 2"), backward incompatible pro-
tocol changes have to be expected.
Care must be taken to avoid deadlocks and other false control
flow: if subprocess and S-nail both wait for more input, or if
one does not expect more input, whereas the other waits for
consumption of its output. Hooks are not automatically syn-
chronized: if a hook emits `~x' to cause S-nail to exit compose
mode, the subprocess will keep running nonetheless until the
macro is completely worked or xit[309] is called explicitly.
They will however receive a termination signal if the parent
enters an error condition. [v15 behaviour may differ] Protec-
tion against and interaction with signals is not yet given; it
is likely that in the future these scripts will be placed in an
isolated session, which is signalled in its entirety as neces-
sary.
Ciao! And thanks (and sorry -- ach, i hate it!)
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)