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. See the attached test.tex file. When I run context test.tex context test.tex | grep run I get graphics > run > processing file, no changes in 'test.md', not processed graphics > run > processing file, changes in 'test-temp-pandoc-0.tmp', processing forced Notice that the first run is the manual job.files.run and the second run is the one from t-filter. The test file contains a fix, which is simply a copy-paste of the relavant code from graph-fil.lua. When I run context --mode=fix test.tex context --mode=fix test.tex | grep run I get graphics > run > processing file, no changes in 'test.md', not processed graphics > run > processing file, no changes in 'test-temp-pandoc-0.tmp', not processed So, I am not sure what is going wrong, and why is it getting fixed if I simply copy the definition of jobs.file.run. Any hints? Thanks, Aditya
Hi, There was a typo in the test file (but it does not change the behavior). I am attaching the correct test file. Aditya On Sat, 24 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.
See the attached test.tex file.
When I run
context test.tex context test.tex | grep run
I get
graphics > run > processing file, no changes in 'test.md', not processed
graphics > run > processing file, changes in 'test-temp-pandoc-0.tmp', processing forced
Notice that the first run is the manual job.files.run and the second run is the one from t-filter.
The test file contains a fix, which is simply a copy-paste of the relavant code from graph-fil.lua. When I run
context --mode=fix test.tex context --mode=fix test.tex | grep run
I get
graphics > run > processing file, no changes in 'test.md', not processed
graphics > run > processing file, no changes in 'test-temp-pandoc-0.tmp', not processed
So, I am not sure what is going wrong, and why is it getting fixed if I simply copy the definition of jobs.file.run. Any hints?
Thanks, Aditya
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
participants (1)
-
Aditya Mahajan