summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/texmf/scripts/texlive/texdoc.tlu30
1 files changed, 25 insertions, 5 deletions
diff --git a/Master/texmf/scripts/texlive/texdoc.tlu b/Master/texmf/scripts/texlive/texdoc.tlu
index 596aa15746d..ab3f6d73b70 100755
--- a/Master/texmf/scripts/texlive/texdoc.tlu
+++ b/Master/texmf/scripts/texlive/texdoc.tlu
@@ -246,6 +246,14 @@ function rmdirs (files)
return res
end
+-- for sty files, we obviously don't want to look in TEXDOCS...
+-- and we don't need a list since those are not duplicated (ahem...)
+function special_sty_search (styname)
+ exact_docfiles = { kpse.find_file (styname) }
+ rel_docfiles = {}
+end
+
+
-- functions to set config values and aliases
---------------------------------------------
@@ -736,17 +744,26 @@ setup_config_from_defaults ()
exit_code = 0
no_regex = true
real_ext_list = config.ext_list
+real_populate_docfiles = populate_docfiles
+real_mixed_populate_docfiles = mixed_populate_docfiles
+real_real_path = real_path
for docname in list (arg) do
if config.alias_switch and alias[docname] then
print ("texdoc info: "..docname.." aliased to "..alias[docname])
docname = alias[docname]
end
- docname_base, docname_ext = string.match(docname, '^(.*)%.(.*)$')
- if docname_ext then
- config.ext_list = { docname_ext }
- docname = docname_base
+ if config.mode ~= 'regex' then
+ docname_base, docname_ext = string.match (docname, '^(.*)%.(.*)$')
+ if docname_ext == 'sty' then
+ print ("texdoc info: using special search mode for sty files")
+ populate_docfiles = special_sty_search
+ mixed_populate_docfiles = special_sty_search
+ real_path = function (arg) return arg end
+ elseif docname_ext then
+ config.ext_list = { docname_ext }
+ docname = docname_base
+ end
end
- local docfound = false
if (config.mode == 'regex') then
no_regex = false
populate_docfiles(docname)
@@ -789,6 +806,9 @@ for docname in list (arg) do
end
end -- if construct "case config.mode in"
config.ext_list = real_ext_list
+ populate_docfiles = real_populate_docfiles
+ mixed_populate_docfiles = real_mixed_populate_docfiles
+ real_path = real_real_path
end -- for docname in arg
os.exit(exit_code)