Elie Roux wrote:
Hans Hagen a écrit :
no, because in many cases one writes files directly via the lua io
library; i remember that we considered a callback but decided that it
would become too messy; there is in tex detailed control over the kin
dof file that is read (tex files vs font files for instance) but
writing can be anything.
For my particular case, I think a callback would still be justified: if
I'm writing this package, it's for people who want to process their old
documents through LuaTeX, if they start to use the lua io library, then
they should definitely write everything in UTF-8. In the case of
packages like mine, it would be very useful to be able to process the
output buffer of TeX... For example a process_tex_output_buffer would be
good I think...
in that case, when some user opens a file for writing, you also need
ways to turn off that processing which adds another layer of management
there
actually, since you already do something with the input, i suppose
that you could easilly do it there: you can check if an aux file is
opened (look at suffix), then set some flag, and treat its data in a
special way
The solution I have now is to register a function in the
process_input_buffer callback, but I don't think I can trigger changes
in my function (like for example when it reads an aux file), can I? Do I
have to register functions in the readers callbacks to do so?
in the open_read_file callback you return a reader funtion that reads a
line of code, so in the case of an aux file, you just return a different
reader function (i.e. one that proprocesses your code)
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------