summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-07-28 01:45:19 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-07-28 01:45:19 +0000
commit3ca03e8c6e771a2373eb92e98e454bef0e24144a (patch)
treeaedb086d5680084bcc9831102d4266f25202a005 /Master
parent7a8b3c6f337259f7d0f69bc4af39f47a7e12b71a (diff)
added real_path() - viewing work again
git-svn-id: svn://tug.org/texlive/trunk@9832 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf/scripts/texlive/texdoc.tlu17
1 files changed, 14 insertions, 3 deletions
diff --git a/Master/texmf/scripts/texlive/texdoc.tlu b/Master/texmf/scripts/texlive/texdoc.tlu
index a3f53b2840b..4a8bb5f0efc 100755
--- a/Master/texmf/scripts/texlive/texdoc.tlu
+++ b/Master/texmf/scripts/texlive/texdoc.tlu
@@ -203,6 +203,7 @@ end
-- END kpse-like
+-- like populate_docfiles, but exact -> rel if exact empty
function mixed_populate_docfiles (pattern)
populate_docfiles (pattern)
if not exact_docfiles[1] then
@@ -211,6 +212,14 @@ function mixed_populate_docfiles (pattern)
end
end
+-- translate a path as given by populate_docfiles into a real path
+-- should never be called before get_texdocs()
+function real_path (fake)
+ local code, file = string.match (fake, '^(.-):(.*)$')
+ code = tonumber (code)
+ return texdocs[code]..'/'..file
+end
+
-- functions to set config values and aliases
---------------------------------------------
@@ -463,6 +472,7 @@ end
-- may uncompress if support_zipped is set (giving the complete filename on the
-- command line is unsupported for compressed files by the way)
function how_to_view (filename)
+ filename = real_path(filename)
if support_zipped then
ext = string.match(filename,'.*%.(.*)$')
zipext = string.match(ext,'^.*%.(.*)')
@@ -575,16 +585,17 @@ function ext_pos (ext)
return ext_pos (ext)
end
--- display a table, sorted, numbered with given offset (0 by default)
+-- display a table, sorted, numbered with given offset (0 by default),
+-- with real pat
function display_table (t, offset)
offset = offset or 0
table.sort(t, file_order)
for i, val in ipairs (t) do
- print (i+offset, val)
+ print (i+offset, real_path(val))
end
end
--- print a list of files as a menu (with an coptional complementary list)
+-- print a list of files as a menu (with an optional complementary list)
function print_menu (files, comp)
comp = comp or {}
local f = #files