[NTG-context] Bug with jobs.file.run?

Aditya Mahajan adityam at umich.edu
Sun Aug 25 14:57:40 CEST 2019


On Sun, 25 Aug 2019, Aditya Mahajan wrote:

>> Hi,
>> 
>> I use jobs.file.run in t-filter to cache the results so that the external 
>> filters are only run if the content has changed. For some reason, this is 
>> not working but I cannot figure out why? Repeating the same steps as 
>> t-filter manually works, but something goes wrong when I use the t-filter 
>> interface.

I have narrowed this down to an example that does not use the filter 
module. It seems that something goes wrong when the first argument of the 
job.files.run contains a hyphen. Here is an example:

\enabletrackers[graphic.runfile]

\starttext

\startbuffer[test]
   print("Output from lua")
\stopbuffer

\savebuffer[list={test}, file={test.lua}, prefix=no]
\ctxlua{job.files.run("test.lua",
                       "lua test.lua > test-output.tex")}
\ReadFile{test-output.tex}

\savebuffer[list={test}, file={test-manual.lua}, prefix=no]
\ctxlua{job.files.run("test-manual.lua",
                       "lua test-manual.lua > test-manual-output.tex")}
\ReadFile{test-manual-output.tex}

\stoptext

Compiling this using `context test.tex | grep run` gives:

graphics        > run > processing file, no changes in 'test.lua', not processed
graphics        > run > processing file, changes in 'test-manual.lua', processing forced

If I readd the definition of jobs.file.run from grph-fil.lua (see attached 
file), then the filename with hyphen also works correctly.

Compiling that with `context --mode=fix test.tex | grep run` gives

graphics        > run > processing file, no changes in 'test.lua', not processed
graphics        > run > processing file, no changes in 'test-manual.lua', not processed

Not sure why that is the case.

Aditya
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-3.tex
Type: application/x-tex
Size: 2005 bytes
Desc: test.tex
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20190825/518145c2/attachment.tex>


More information about the ntg-context mailing list