From 84903d24d6d930438bb3cc4322c4b14271b713aa Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 15 Jul 2010 15:01:00 +0200 Subject: beta 2010.07.15 15:01 --- scripts/context/lua/mtx-base.lua | 5 ++++- scripts/context/lua/mtx-fonts.lua | 4 ++-- scripts/context/lua/mtxrun.lua | 29 ++++++++--------------------- scripts/context/ruby/base/tex.rb | 2 +- scripts/context/ruby/texexec.rb | 7 +++++-- scripts/context/stubs/mswin/mtxrun.lua | 29 ++++++++--------------------- scripts/context/stubs/unix/mtxrun | 29 ++++++++--------------------- 7 files changed, 36 insertions(+), 69 deletions(-) (limited to 'scripts') diff --git a/scripts/context/lua/mtx-base.lua b/scripts/context/lua/mtx-base.lua index 76284ac99..a5e52e0ac 100644 --- a/scripts/context/lua/mtx-base.lua +++ b/scripts/context/lua/mtx-base.lua @@ -127,9 +127,12 @@ elseif environment.arguments["expansions"] or environment.arguments["show-expans resolvers.listers.expansions(false,instance.pattern) elseif environment.arguments["configurations"] or environment.arguments["show-configurations"] then resolvers.load("nofiles") - resolvers.listers.configurations(false,instance.pattern) + resolvers.listers.configurations() elseif environment.arguments["help"] or (environment.files[1]=='help') or (#environment.files==0) then logs.help(messages.help) +elseif environment.files[1]=='texmfcnf.lua' then + resolvers.load("nofiles") + resolvers.listers.configurations() else resolvers.load() resolvers.for_files(resolvers.find_files, environment.files, instance.my_format) diff --git a/scripts/context/lua/mtx-fonts.lua b/scripts/context/lua/mtx-fonts.lua index 483c834a5..b8bbdde5b 100644 --- a/scripts/context/lua/mtx-fonts.lua +++ b/scripts/context/lua/mtx-fonts.lua @@ -149,7 +149,7 @@ local function showfeatures(tag,specification) else done = true end - logs.simple("% -8s % -8s % -8s",f,s,table.concat(table.sortedkeys(ss), " ")) + logs.simple("% -8s % -8s % -8s",f,s,table.concat(table.sortedkeys(ss), " ")) -- todo: padd 4 end end end @@ -307,7 +307,7 @@ function scripts.fonts.save() if name and name ~= "" then local filename = resolvers.find_file(name) -- maybe also search for opentype if filename and filename ~= "" then - local suffix = file.extname(filename) + local suffix = string.lower(file.extname(filename)) if suffix == 'ttf' or suffix == 'otf' or suffix == 'ttc' or suffix == "dfont" then local fontinfo = fontloader.info(filename) if fontinfo then diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 46db66493..ac4b0556e 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -668,7 +668,7 @@ function table.prepend(t, list) end function table.merge(t, ...) -- first one is target - t = t or {} + t = t or { } local lst = {...} for i=1,#lst do for k, v in next, lst[i] do @@ -12030,24 +12030,11 @@ end function resolvers.listers.variables (report,pattern) list(resolvers.instance.variables, report,pattern) end function resolvers.listers.expansions(report,pattern) list(resolvers.instance.expansions,report,pattern) end -function resolvers.listers.configurations(report,pattern) - pattern = pattern and pattern ~= "" and upper(pattern) or "" +function resolvers.listers.configurations(report) + local configurations = resolvers.instance.specification local report = report or texio.write_nl - local instance = resolvers.instance - local sorted = table.sortedkeys(instance.kpsevars) - for i=1,#sorted do - local key = sorted[i] - if pattern == "" or find(upper(key),pattern) then - report(format("%s\n",key)) - local order = instance.order - for i=1,#order do - local str = order[i][key] - if str then - report(format("\t%s\t%s",i,str)) - end - end - report("") - end + for i=1,#configurations do + report(configurations[i]) end end @@ -12762,8 +12749,8 @@ function runners.report_location(result) end end -function runners.edit_script(filename) -- we assume that vim is present on most systems - local editor = os.getenv("MTXRUN_EDITOR") or os.getenv("TEXMFSTART_EDITOR") or os.getenv("EDITOR") or 'vim' +function runners.edit_script(filename) -- we assume that gvim is present on most systems (todo: also in cnf file) + local editor = os.getenv("MTXRUN_EDITOR") or os.getenv("TEXMFSTART_EDITOR") or os.getenv("EDITOR") or 'gvim' local rest = resolvers.resolve(filename) if rest ~= "" then local command = editor .. " " .. rest @@ -13247,7 +13234,7 @@ elseif environment.argument("configurations") or environment.argument("show-conf -- luatools: runners.execute_ctx_script("mtx-base","--configurations",filename) resolvers.load("nofiles") - resolvers.listers.configurations(false,environment.argument("pattern")) + resolvers.listers.configurations() elseif environment.argument("find-file") then diff --git a/scripts/context/ruby/base/tex.rb b/scripts/context/ruby/base/tex.rb index 84025693b..e89a88060 100644 --- a/scripts/context/ruby/base/tex.rb +++ b/scripts/context/ruby/base/tex.rb @@ -198,7 +198,7 @@ class TEX 'filters', 'usemodules', 'environments', 'separation', 'setuppath', 'arguments', 'input', 'output', 'randomseed', 'modes', 'mode', 'filename', 'ctxfile', 'printformat', 'paperformat', 'paperoffset', - 'timeout', 'passon' + 'timeout', 'passon', 'pdftitle' ] @@mainstandardvars = [ 'mainlanguage', 'bodyfont', 'language' diff --git a/scripts/context/ruby/texexec.rb b/scripts/context/ruby/texexec.rb index 747d76b68..4a08c3b61 100644 --- a/scripts/context/ruby/texexec.rb +++ b/scripts/context/ruby/texexec.rb @@ -508,6 +508,7 @@ class Commands combination = @commandline.checkedoption('combination','2*2').split(/[\*x]/o) paperformat = @commandline.checkedoption('paperformat', 'A4*A4').split(/[\*x]/o) bannerheight = @commandline.checkedoption('bannerheight', '') + pdftitle = @commandline.checkedoption('pdftitle', '') nx, ny = combination[0] || '2', combination[1] || combination[0] || '2' from, to = paperformat[0] || 'A4', paperformat[1] || paperformat[0] || 'A4' f << "\\setuppapersize[#{from}][#{to}]\n" @@ -525,8 +526,10 @@ class Commands f << "\\setuplayout[footer=0cm]\n" f << "\\setupbackgrounds[page][background=]\n" end - f << "\\setupexternalfigures\n" - f << " [directory=]\n" + f << "\\setupexternalfigures[directory=]\n" + if not pdftitle.empty? then + f << "\\setupinteraction[state=start,title={#{pdftitle}}]\n" + end f << "\\starttext\n" files.each do |filename| result = @commandline.checkedoption('result','texexec') diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 46db66493..ac4b0556e 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -668,7 +668,7 @@ function table.prepend(t, list) end function table.merge(t, ...) -- first one is target - t = t or {} + t = t or { } local lst = {...} for i=1,#lst do for k, v in next, lst[i] do @@ -12030,24 +12030,11 @@ end function resolvers.listers.variables (report,pattern) list(resolvers.instance.variables, report,pattern) end function resolvers.listers.expansions(report,pattern) list(resolvers.instance.expansions,report,pattern) end -function resolvers.listers.configurations(report,pattern) - pattern = pattern and pattern ~= "" and upper(pattern) or "" +function resolvers.listers.configurations(report) + local configurations = resolvers.instance.specification local report = report or texio.write_nl - local instance = resolvers.instance - local sorted = table.sortedkeys(instance.kpsevars) - for i=1,#sorted do - local key = sorted[i] - if pattern == "" or find(upper(key),pattern) then - report(format("%s\n",key)) - local order = instance.order - for i=1,#order do - local str = order[i][key] - if str then - report(format("\t%s\t%s",i,str)) - end - end - report("") - end + for i=1,#configurations do + report(configurations[i]) end end @@ -12762,8 +12749,8 @@ function runners.report_location(result) end end -function runners.edit_script(filename) -- we assume that vim is present on most systems - local editor = os.getenv("MTXRUN_EDITOR") or os.getenv("TEXMFSTART_EDITOR") or os.getenv("EDITOR") or 'vim' +function runners.edit_script(filename) -- we assume that gvim is present on most systems (todo: also in cnf file) + local editor = os.getenv("MTXRUN_EDITOR") or os.getenv("TEXMFSTART_EDITOR") or os.getenv("EDITOR") or 'gvim' local rest = resolvers.resolve(filename) if rest ~= "" then local command = editor .. " " .. rest @@ -13247,7 +13234,7 @@ elseif environment.argument("configurations") or environment.argument("show-conf -- luatools: runners.execute_ctx_script("mtx-base","--configurations",filename) resolvers.load("nofiles") - resolvers.listers.configurations(false,environment.argument("pattern")) + resolvers.listers.configurations() elseif environment.argument("find-file") then diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 46db66493..ac4b0556e 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -668,7 +668,7 @@ function table.prepend(t, list) end function table.merge(t, ...) -- first one is target - t = t or {} + t = t or { } local lst = {...} for i=1,#lst do for k, v in next, lst[i] do @@ -12030,24 +12030,11 @@ end function resolvers.listers.variables (report,pattern) list(resolvers.instance.variables, report,pattern) end function resolvers.listers.expansions(report,pattern) list(resolvers.instance.expansions,report,pattern) end -function resolvers.listers.configurations(report,pattern) - pattern = pattern and pattern ~= "" and upper(pattern) or "" +function resolvers.listers.configurations(report) + local configurations = resolvers.instance.specification local report = report or texio.write_nl - local instance = resolvers.instance - local sorted = table.sortedkeys(instance.kpsevars) - for i=1,#sorted do - local key = sorted[i] - if pattern == "" or find(upper(key),pattern) then - report(format("%s\n",key)) - local order = instance.order - for i=1,#order do - local str = order[i][key] - if str then - report(format("\t%s\t%s",i,str)) - end - end - report("") - end + for i=1,#configurations do + report(configurations[i]) end end @@ -12762,8 +12749,8 @@ function runners.report_location(result) end end -function runners.edit_script(filename) -- we assume that vim is present on most systems - local editor = os.getenv("MTXRUN_EDITOR") or os.getenv("TEXMFSTART_EDITOR") or os.getenv("EDITOR") or 'vim' +function runners.edit_script(filename) -- we assume that gvim is present on most systems (todo: also in cnf file) + local editor = os.getenv("MTXRUN_EDITOR") or os.getenv("TEXMFSTART_EDITOR") or os.getenv("EDITOR") or 'gvim' local rest = resolvers.resolve(filename) if rest ~= "" then local command = editor .. " " .. rest @@ -13247,7 +13234,7 @@ elseif environment.argument("configurations") or environment.argument("show-conf -- luatools: runners.execute_ctx_script("mtx-base","--configurations",filename) resolvers.load("nofiles") - resolvers.listers.configurations(false,environment.argument("pattern")) + resolvers.listers.configurations() elseif environment.argument("find-file") then -- cgit v1.2.3