[Dev-luatex] return value of filter callbacks

Manuel Pégourié-Gonnard mpg at elzevir.fr
Fri Nov 5 13:59:54 CET 2010


Hi,

Sorry if this is very clear from the manual, maybe I just didn't read the part
where it is explained (or I read it but was too stupid/tired to notice), but I
don't understand the meaning of the return value of some callbacks.

The first example (by order of apparition in the manual) is
pre_linebreak_filter, whose calling convention is:

function(<node> head, <string> groupcode)
    return true | false | <node> newhead
end

I think it's clear what returning a newhead node does, but I don't understand
what returning true or false means for this callback. Other similar callbacks
include post_linebreak_filter, (h|v)pack_filter, pre_output_filter, etc.

The underlying problem is, I was trying to enhance the user documentation of
luatexbase-mcb (which allows to register many functions in a single callback,
based on some ConTeXt code I believe) but I can't make sense of the calling
conventions in the current code (the functions are expected to return a node
*and* true, in whatever order), so that I can't check it is correct, and even
less document why it works that way. I guess understanding the calling
convention for the callbacks themselves would be a good starting point.

Thanks,
Manuel.


More information about the dev-luatex mailing list