summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-09-22 12:33:00 +0200
committerHans Hagen <pragma@wxs.nl>2010-09-22 12:33:00 +0200
commit9357c597be3b099500d1ab60ef3e70c572088b0b (patch)
treeac75939aef40efcb123cf8a970010380faeaf6a4 /scripts
parentd0b8d7f9a7f3d423f750c0078cc1d906de14b939 (diff)
downloadcontext-9357c597be3b099500d1ab60ef3e70c572088b0b.tar.gz
beta 2010.09.22 12:33
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtx-context.lua18
1 files changed, 11 insertions, 7 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua
index a22612eeb..cee926a6e 100644
--- a/scripts/context/lua/mtx-context.lua
+++ b/scripts/context/lua/mtx-context.lua
@@ -637,14 +637,16 @@ end
local pdfview -- delayed loading
-function scripts.context.openpdf(name)
+function scripts.context.openpdf(name,method)
pdfview = pdfview or dofile(resolvers.findfile("l-pdfview.lua","tex"))
+ pdfview.setmethod(method)
logs.simple("pdfview methods: %s, current method: %s, MTX_PDFVIEW_METHOD=%s",pdfview.methods(),pdfview.method,os.getenv(pdfview.METHOD) or "<unset>")
pdfview.open(file.replacesuffix(name,"pdf"))
end
-function scripts.context.closepdf(name)
+function scripts.context.closepdf(name,method)
pdfview = pdfview or dofile(resolvers.findfile("l-pdfview.lua","tex"))
+ pdfview.setmethod(method)
pdfview.close(file.replacesuffix(name,"pdf"))
end
@@ -764,10 +766,11 @@ function scripts.context.run(ctxdata,filename)
resultname = nil
end
--
- if environment.argument("autopdf") or environment.argument("closepdf") then
- scripts.context.closepdf(filename)
+ local pdfview = environment.argument("autopdf") or environment.argument("closepdf")
+ if pdfview then
+ scripts.context.closepdf(filename,pdfview)
if resultname then
- scripts.context.closepdf(resultname)
+ scripts.context.closepdf(resultname,pdfview)
end
end
--
@@ -880,8 +883,9 @@ function scripts.context.run(ctxdata,filename)
scripts.context.purge_job(resultname,true)
end
--
- if environment.argument("autopdf") then
- scripts.context.openpdf(resultname or filename)
+ local pdfview = environment.argument("autopdf")
+ if pdfview then
+ scripts.context.openpdf(resultname or filename,pdfview)
end
--
if environment.argument("timing") then