[luatex] Solving the \jobname issue: a new callback? (with patch)

Manuel Pégourié-Gonnard mpg at elzevir.fr
Tue May 24 23:42:22 CEST 2011


Hi,

It looks like the issues with \jobname quoting discussed again recently cannot
be solved using only TeX macros, and some modification of LuaTeX is needed.

It has been suggested by David Kastrup (and Philipp Stephani) to modify \jobname
so that it expands only to catcode-12 tokens, and \input and \openout to
recognize only catcode 10 spaces as delimiters. However, this seems somewhat
unnatural and ad hoc, IMO. (And could cause compatibility issues too.)

I'd like to propose a solution more in line with the LuaTeX spirit as I
understand it (provide tools, not solutions): a new callback 'process_jobname'
called when \jobname is expanded in TeX or tex.jobname consulted in Lua.

At first glance, it may look more reasonable for the callback to be executed
when the jobname is set rather than consulted, but since callbacks are not saved
in the format and \jobname is generally set before \everyjob is called, this
wouldn't be practical. Also, the ability to change the callback during a TeX run
provides more flexibility when mixing macros that prefer their jobname processed
one way or another.

I admit I can see no other use for this callback than autoquoting \jobname (the
way other engines do) for compatibility with macros that can't be changed easily
to use the new braced syntax of \input and \openout. OTOH, it's a 20-line patch
and it provides a general tool that can be used to solve the problem.

The attached patch applies to branch 0.70.x in its current state (r4281). Please
consider including it.

Thanks,
Manuel.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: process_jobname.diff
Type: text/x-patch
Size: 3555 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20110524/f269f376/attachment.bin>


More information about the luatex mailing list