[luatex] multiple callbacks

Taco Hoekwater taco at elvenkind.com
Sun Jan 4 16:47:19 CET 2009


Arthur Reutenauer wrote:
>> untested, but something like this can do the job (untested)
> 
>   Looks cool.  Élie, can you test it and make a small proof of concept
> with a simple callback?

Keep in mind that not all callbacks have the same i/o characteristics.
For example, 'process_input_buffer' has:

   function(<string> buffer)
     return <string> adjusted_buffer
   end

so if you chain processing functions, you will want to feed the
output of earlier functions into later functions (otherwise, the net
effect is exactly the same as running only the last function).

Btw, callback.add() could just return false when it detects a
conflict with an already existing function, and true otherwise.
Then the caller could decide how to handle the error.

Best wishes,
Taco


More information about the luatex mailing list