summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2010-09-22 14:41:02 +0300
committerMarius <mariausol@gmail.com>2010-09-22 14:41:02 +0300
commit628da7aa02508a351932702b1631a32195511ee2 (patch)
tree1b41ef16d56e22b76fe3ba1bd92bc291145da7e0 /scripts
parent9d17a4bc572f48289b6d188684a7bbf8c46839fe (diff)
downloadcontext-628da7aa02508a351932702b1631a32195511ee2.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