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

Taco Hoekwater taco at elvenkind.com
Wed May 25 14:07:21 CEST 2011



On 05/24/11 23:42, Manuel Pégourié-Gonnard wrote:
> 
> 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.

Neat idea, and I like that much better than forcing some change to the
\jobname primitive code itself.

> 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. 

Agreed.

> 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.

There is a potential there for confusion, but I agree that it could be
useful in some situations.

> 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.

I'll apply the patch to trunk (at least for now). It comes too late for
texlive 2011 anyway.

Best wishes,
Taco


More information about the luatex mailing list