diff options
-rw-r--r-- | Master/texmf/doc/man/man1/texdoc.1 | 8 | ||||
-rw-r--r-- | Master/texmf/doc/man/man1/texdoc.man1.pdf | bin | 5357 -> 5363 bytes | |||
-rw-r--r-- | Master/texmf/scripts/texdoc/config.tlu | 2 | ||||
-rw-r--r-- | Master/texmf/scripts/texdoc/constants.tlu | 2 | ||||
-rw-r--r-- | Master/texmf/scripts/texdoc/score.tlu | 23 | ||||
-rw-r--r-- | Master/texmf/scripts/texdoc/search.tlu | 9 | ||||
-rw-r--r-- | Master/texmf/texdoc/texdoc.cnf | 2 |
7 files changed, 37 insertions, 9 deletions
diff --git a/Master/texmf/doc/man/man1/texdoc.1 b/Master/texmf/doc/man/man1/texdoc.1 index ac38f2440c0..7a0e64279ce 100644 --- a/Master/texmf/doc/man/man1/texdoc.1 +++ b/Master/texmf/doc/man/man1/texdoc.1 @@ -1,5 +1,5 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH TEXDOC "1" "March 2010" "texdoc 0.72" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.2. +.TH TEXDOC "1" "July 2010" "texdoc 0.72" "User Commands" .SH NAME texdoc \- find & view documentation in TeX Live .SH SYNOPSIS @@ -47,10 +47,10 @@ Print additional information (eg, viewer command). .TP \fB\-d\fR, \fB\-\-debug\fR[=\fIlist\fR] Print debug info for selected items (default: all). -.SS "Environment:" +.SH ENVIRONMENT .IP PAGER, BROWSER, PDFVIEWER, PSVIEWER, DVIVIEWER. -.SS "Files:" +.SH FILES .IP <texmf>/texdoc/texdoc.cnf, see output of the \fB\-\-files\fR option. .SS "Homepage:" diff --git a/Master/texmf/doc/man/man1/texdoc.man1.pdf b/Master/texmf/doc/man/man1/texdoc.man1.pdf Binary files differindex 1c48941ac9f..8af9088d067 100644 --- a/Master/texmf/doc/man/man1/texdoc.man1.pdf +++ b/Master/texmf/doc/man/man1/texdoc.man1.pdf diff --git a/Master/texmf/scripts/texdoc/config.tlu b/Master/texmf/scripts/texdoc/config.tlu index d0534f2a8fc..82e7f0c0b08 100644 --- a/Master/texmf/scripts/texdoc/config.tlu +++ b/Master/texmf/scripts/texdoc/config.tlu @@ -516,7 +516,9 @@ function setup_config_from_defaults() interact_switch = 'true', machine_switch = 'false', ext_list = 'pdf, html, txt, ps, dvi, ', + basename_list = 'readme', badext_list = 'txt, ', + badbasename_list = 'readme', verbosity_level = C.def_verbosity, debug_list = '', max_lines = '20', diff --git a/Master/texmf/scripts/texdoc/constants.tlu b/Master/texmf/scripts/texdoc/constants.tlu index 8441450e089..00ac5dead20 100644 --- a/Master/texmf/scripts/texdoc/constants.tlu +++ b/Master/texmf/scripts/texdoc/constants.tlu @@ -64,7 +64,9 @@ known_options = { 'machine_switch', 'alias_switch', 'ext_list', + 'basename_list', 'badext_list', + 'badbasename_list', 'verbosity_level', 'debug_list', 'lastfile_switch', diff --git a/Master/texmf/scripts/texdoc/score.tlu b/Master/texmf/scripts/texdoc/score.tlu index a902392876c..5e9916ab689 100644 --- a/Master/texmf/scripts/texdoc/score.tlu +++ b/Master/texmf/scripts/texdoc/score.tlu @@ -73,7 +73,7 @@ function set_score(df, original_kw) elseif is_exact(name, p) then s = pat.score or 10 -- default alias score deb_print('score', string.format( - "Matching alias '%s', score: %d", pat.name, s)) + "Matching alias '%s', score: %g", pat.name, s)) end if s > score then score = s end end @@ -95,7 +95,7 @@ function set_score(df, original_kw) if val and is_subword('/'..name, pat) then score = score + val deb_print('score', string.format( - "Adjust by '%d' from specific pattern '%s'", val, pat)) + "Adjust by %g from specific pattern '%s'", val, pat)) end end end @@ -105,7 +105,7 @@ function set_score(df, original_kw) if val and is_subword('/'..name, pat) then if score > -10 or val < 0 then score = score + val end deb_print('score', string.format( - "Adjust by '%d' from global pattern '%s'", val, pat)) + "Adjust by %g from global pattern '%s'", val, pat)) end end end @@ -154,11 +154,15 @@ function heuristic_score(file, pat) end end end - -- if extension is bad, score is < 0 + -- if extension is bad, score gets < 0 local ext = config.ext_list[ext_pos(file)] if ext and config.badext_list_inv[ext] and score > 0 then upscore(-1, 'bad extension', true) end + -- if basename is bad, score gets < 0 + if has_bad_basename(file) and score > 0 then + upscore(-1, 'bad basename', true) + end -- bonus for being in the right directory if string.find('/'..file, '/'..pat..'/', 1, true) and not slash then upscore(score + 0.5, 'directory bonus') @@ -196,6 +200,17 @@ function is_delim(str, i) return not not string.find(string.sub(str, i, i), '%p') end +-- say if a filename has a bad basename +function has_bad_basename(file) + file = file:gsub('.*/', '') + for _, b in ipairs(config.badbasename_list) do + if file:find('^'..b..'$') or file:find('^'..b..'%.') then + return true + end + end + return false +end + -- compare two docfile's: (see search.tlu for structure) -- 1. by score -- 2. then by extensions (ordered as in ext_list), diff --git a/Master/texmf/scripts/texdoc/search.tlu b/Master/texmf/scripts/texdoc/search.tlu index aa225b7fb46..fc74650e31a 100644 --- a/Master/texmf/scripts/texdoc/search.tlu +++ b/Master/texmf/scripts/texdoc/search.tlu @@ -332,7 +332,8 @@ function scan_db(patlist, code, lsr_db) end end --- says if file has a 'good' extenstion according to ext_list +-- says if file has a known extenstion according to ext_list +-- (or known basename according to basename_list) function check_ext(file) file = string.lower(file) -- remove zipext if applicable @@ -352,6 +353,12 @@ function check_ext(file) end end end + -- is the basename good? + for _, b in ipairs(config.basename_list) do + if file:find('^'..b..'$') or file:find('^'..b..'%.') then + return true + end + end return false end diff --git a/Master/texmf/texdoc/texdoc.cnf b/Master/texmf/texdoc/texdoc.cnf index 83edc49158d..bacbebd3287 100644 --- a/Master/texmf/texdoc/texdoc.cnf +++ b/Master/texmf/texdoc/texdoc.cnf @@ -74,6 +74,8 @@ # # ext_list = pdf, html, txt, ps, dvi, # Note: empty string at end # badext_list = txt, # Note: empty string at end +# basename_list = readme +# badbasename_list = readme ### Score ### |