diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-08-03 11:29:54 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-08-03 11:29:54 +0000 |
commit | 3a47ca017b35a907f88fe418ebf3d7e261d5926e (patch) | |
tree | ed60672858988078d4016cad505e9a8e7cbd95b7 /Master | |
parent | 75d369cdb13d99b7c114b0959d90583ea728315b (diff) |
Fixing viewer command for windows (hopefully). Simplifying MacOS X command on
the way, and fixing a typo.
git-svn-id: svn://tug.org/texlive/trunk@10031 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf/scripts/texlive/texdoc.tlu | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/Master/texmf/scripts/texlive/texdoc.tlu b/Master/texmf/scripts/texlive/texdoc.tlu index ce1dc1d719e..923d9a4c5bb 100755 --- a/Master/texmf/scripts/texlive/texdoc.tlu +++ b/Master/texmf/scripts/texlive/texdoc.tlu @@ -97,7 +97,7 @@ end -- get global texdocs, do_recurse and must_have_lsr lists from kpse's $TEXDOCS function get_texdocs () - local sep = (os.type == 'window') and ';' or ':' + local sep = (os.type == 'windows') and ';' or ':' texdocs = kpse.expand_var ("$TEXDOCS") -- expand the path and turn it into a lua list texdocs = string.explode (kpse.expand_braces (texdocs), sep) @@ -248,7 +248,19 @@ end function real_path (fake) local code, file = string.match (fake, '^(.-):(.*)$') code = tonumber (code) - return texdocs[code]..'/'..file + return rp_win32_hook (texdocs[code]..'/'..file) +end + +-- now a special function that does nothing on Unix +if os.type == "windows" then + function rp_win32_hook (path) + local res = string.gsub (path, '/', '\\') + return res -- get rid of gsub's 2nd arg + end +else + function rp_win32_hook (path) + return path + end end -- remove directories from the files list @@ -488,19 +500,19 @@ function setup_config_from_defaults() -- probably Windows (or OS/2) -- which commands should we use for unzipping? set_config_list { - viewer_dvi = 'start', - viewer_html = 'start', - viewer_pdf = 'start', - viewer_ps = 'start', - viewer_txt = 'start', + viewer_dvi = 'start ""', + viewer_html = 'start ""', + viewer_pdf = 'start ""', + viewer_ps = 'start ""', + viewer_txt = 'start ""', } else -- since we don't support msdos, if os.type is not windows, it's unix if (os.name == 'macosx') then set_config_list { - viewer_dvi = '(open %s)', - viewer_html = '(open %s)', - viewer_pdf = '(open %s)', - viewer_ps = '(open %s)', + viewer_dvi = 'open', + viewer_html = 'open', + viewer_pdf = 'open', + viewer_ps = 'open', viewer_txt = 'less', } else @@ -630,7 +642,7 @@ function try_viewing (view_command, viewer_replacement) err_print(view_command, 'debug1') view_result = os.execute(view_command) if not view_result then - err_print (": the following command failed\n\t" + err_print ("the following command failed\n\t" .. view_command, "error") end end |