summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-05-09 17:24:55 +0000
committerKarl Berry <karl@freefriends.org>2017-05-09 17:24:55 +0000
commitfb3170c0fe47a27d57e230b1b0fe495370433c62 (patch)
treed90670bdcc8e2da62c238814b70b76b91e88d520 /Master
parentcf3504f085bd26f08a2594440711743068edfe8d (diff)
allow : separated list in BROWSER, etc.; texdoc r3
git-svn-id: svn://tug.org/texlive/trunk@44267 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/scripts/texdoc/config.tlu33
1 files changed, 27 insertions, 6 deletions
diff --git a/Master/texmf-dist/scripts/texdoc/config.tlu b/Master/texmf-dist/scripts/texdoc/config.tlu
index 25d64617831..ea4acbb4564 100644
--- a/Master/texmf-dist/scripts/texdoc/config.tlu
+++ b/Master/texmf-dist/scripts/texdoc/config.tlu
@@ -189,18 +189,39 @@ function setup_config_from_env ()
end
end
end
+ local function set_config_elt_from_option_env(key, var)
+ if (os.type == "windows") then return end
+ local value = os.getenv(var)
+ if value then
+ for cmd in string.gmatch(value, '([^:]+)') do
+ if is_in_path(cmd) then
+ set_config_element(key, cmd, {src='env', name=var})
+ -- don't test other commands if we have found one
+ break
+ end
+ end
+ end
+ end
set_config_elt_from_vars('viewer_pdf',
- {"PDFVIEWER_texdoc", "TEXDOCVIEW_pdf", "TEXDOC_VIEWER_PDF", "PDFVIEWER"})
+ {"PDFVIEWER_texdoc", "TEXDOCVIEW_pdf", "TEXDOC_VIEWER_PDF"})
+ set_config_elt_from_option_env('viewer_pdf', "PDFVIEWER")
set_config_elt_from_vars('viewer_ps',
- {"PSVIEWER_texdoc", "TEXDOCVIEW_ps", "TEXDOC_VIEWER_PS", "PSVIEWER"})
+ {"PSVIEWER_texdoc", "TEXDOCVIEW_ps", "TEXDOC_VIEWER_PS"})
+ set_config_elt_from_option_env('viewer_ps', "PSVIEWER")
set_config_elt_from_vars('viewer_dvi',
- {"DVIVIEWER_texdoc", "TEXDOCVIEW_dvi", "TEXDOC_VIEWER_DVI", "DVIVIEWER"})
+ {"DVIVIEWER_texdoc", "TEXDOCVIEW_dvi", "TEXDOC_VIEWER_DVI"})
+ set_config_elt_from_option_env('viewer_dvi', "DVIVIEWER")
set_config_elt_from_vars('viewer_html',
- {"BROWSER_texdoc", "TEXDOCVIEW_html", "TEXDOC_VIEWER_HTML", "BROWSER"})
+ {"BROWSER_texdoc", "TEXDOCVIEW_html", "TEXDOC_VIEWER_HTML"})
+ set_config_elt_from_option_env('viewer_html', "BROWSER")
+ bla = config['viewer_html']
+ err_print('warning', 'NORBERT: viewer_html is now ' .. bla)
set_config_elt_from_vars('viewer_md',
- {"MDVIEWER_texdoc", "TEXDOCVIEW_md", "TEXDOC_VIEWER_MD", "PAGER"})
+ {"MDVIEWER_texdoc", "TEXDOCVIEW_md", "TEXDOC_VIEWER_MD"})
+ set_config_elt_from_option_env('viewer_md', "PAGER")
set_config_elt_from_vars('viewer_txt',
- {"PAGER_texdoc", "TEXDOCVIEW_txt", "TEXDOC_VIEWER_TXT", "PAGER"})
+ {"PAGER_texdoc", "TEXDOCVIEW_txt", "TEXDOC_VIEWER_TXT"})
+ set_config_elt_from_option_env('viewer_txt', "PAGER")
end
---------------------- options and aliases from files ----------------------