diff options
-rwxr-xr-x | Master/texmf/scripts/texlive/texdoc.tlu | 17 |
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 |