diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-07-11 12:55:06 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-07-11 12:55:06 +0000 |
commit | 661ad77c3be963463abeb7171b0944075fa3f22d (patch) | |
tree | b6950c80d25205fa2ee06a3b5c7eecbe9b89b0a3 /Master | |
parent | 2fbb2ce7dd19dde73049db6d91e0bf5a34b1a968 (diff) |
new get_viewer_from_env function
git-svn-id: svn://tug.org/texlive/trunk@9448 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf/scripts/texlive/texdoc.tlu | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Master/texmf/scripts/texlive/texdoc.tlu b/Master/texmf/scripts/texlive/texdoc.tlu index 45862a73088..0f12822ebdf 100755 --- a/Master/texmf/scripts/texlive/texdoc.tlu +++ b/Master/texmf/scripts/texlive/texdoc.tlu @@ -268,11 +268,20 @@ function setup_config () end end +function get_viewer_from_env (variable) + local viewer = os.getenv(variable) + if viewer then + return "("..viewer.." %s)" + else + return nil + end +end + -- with intermediate priority, we shall make use of some environment variables set_config_list { - viewer_html = os.getenv("BROWSER"), - viewer_tex = os.getenv("PAGER"), - viewer_txt = os.getenv("PAGER") + viewer_html = get_viewer_from_env ("BROWSER"), + viewer_tex = get_viewer_from_env ("PAGER"), + viewer_txt = get_viewer_from_env ("PAGER") } -- for default viewer on general Unix, we use a list |