diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-02-22 13:29:41 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-02-22 13:29:41 +0000 |
commit | c49d87e1fd943a8309dba938dc8d6900f4295a5e (patch) | |
tree | a51c82a6631869cca9a30988236e70b68ecb2058 /Master | |
parent | 2cb8796c405b33fe218e514526426f2b5c41c8ee (diff) |
Texdoc 0.66 addressing various problems.
git-svn-id: svn://tug.org/texlive/trunk@17143 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf/doc/man/man1/texdoc.1 | 46 | ||||
-rw-r--r-- | Master/texmf/doc/man/man1/texdoc.man1.pdf | bin | 5498 -> 5506 bytes | |||
-rw-r--r-- | Master/texmf/doc/texdoc/News | 22 | ||||
-rw-r--r-- | Master/texmf/doc/texdoc/texdoc.pdf | bin | 207519 -> 208206 bytes | |||
-rw-r--r-- | Master/texmf/doc/texdoc/texdoc.tex | 30 | ||||
-rw-r--r-- | Master/texmf/scripts/texdoc/config.tlu | 48 | ||||
-rw-r--r-- | Master/texmf/scripts/texdoc/constants.tlu | 49 | ||||
-rw-r--r-- | Master/texmf/scripts/texdoc/functions.tlu | 4 | ||||
-rw-r--r-- | Master/texmf/scripts/texdoc/main.tlu | 2 | ||||
-rw-r--r-- | Master/texmf/scripts/texdoc/search.tlu | 4 | ||||
-rwxr-xr-x | Master/texmf/scripts/texdoc/texdoc.tlu | 2 | ||||
-rw-r--r-- | Master/texmf/scripts/texdoc/view.tlu | 10 | ||||
-rw-r--r-- | Master/texmf/texdoc/texdoc.cnf | 23 |
13 files changed, 150 insertions, 90 deletions
diff --git a/Master/texmf/doc/man/man1/texdoc.1 b/Master/texmf/doc/man/man1/texdoc.1 index 940b658f8d0..56a0112a5c8 100644 --- a/Master/texmf/doc/man/man1/texdoc.1 +++ b/Master/texmf/doc/man/man1/texdoc.1 @@ -1,20 +1,27 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. -.TH TEXDOC "1" "February 2010" "texdoc 0.65" "User Commands" +.TH TEXDOC "1" "February 2010" "texdoc 0.66" "User Commands" .SH NAME texdoc \- find & view documentation in TeX Live .SH SYNOPSIS .B texdoc -[\fIOPTIONS\fR]... [\fINAME\fR]... +[\fIOPTION\fR]... [\fINAME\fR]... .SH DESCRIPTION -texdoc tries to find appropriate TeX documentation for the specified NAME(s). -With no NAME, it can print configuration information (\fB\-f\fR, \fB\-\-files\fR); -the usual \fB\-\-help\fR and \fB\-\-version\fR options are also accepted. +Try to find appropriate TeX documentation for the specified NAME(s). +The default (view mode) is to display the documentation. +.PP +With no NAME, print information about texdoc (\fB\-\-help\fR, \fB\-\-version\fR, \fB\-\-files\fR). +.TP +\fB\-h\fR, \fB\-\-help\fR +Print this help message. +.TP +\fB\-V\fR, \fB\-\-version\fR +Print the version number. .TP \fB\-f\fR, \fB\-\-files\fR -Print the name of the config files being used. +Print the list of configuration files used. .TP \fB\-w\fR, \fB\-\-view\fR -Use view mode: start a viewer. +Use view mode: start a viewer. (default) .TP \fB\-m\fR, \fB\-\-mixed\fR Use mixed mode (view or list). @@ -25,38 +32,35 @@ Use list mode: show a list of results. \fB\-s\fR, \fB\-\-showall\fR Use showall mode: show also "bad" results. .TP -\fB\-r\fR, \fB\-\-regex\fR -Use regex mode. (Deprecated.) -.TP -\fB\-e\fR, \fB\-\-extensions\fR=\fIL\fR -Set ext_list=L. (Deprecated.) +\fB\-M\fR, \fB\-\-machine\fR +Machine\-readable output (list or showall modes). .TP \fB\-a\fR, \fB\-\-alias\fR -Use the alias table. +Use the alias table. (default) .TP \fB\-A\fR, \fB\-\-noalias\fR Don't use the alias table. .TP \fB\-i\fR, \fB\-\-interact\fR -Use interactive menus. +Use interactive menus. (default) .TP \fB\-I\fR, \fB\-\-nointeract\fR Use plain lists, no interaction required. .TP -\fB\-v\fR, \fB\-\-verbosity\fR=\fIN\fR -Set verbosity level to N. +\fB\-q\fR, \fB\-\-quiet\fR +Suppress warnings and most error messages. .TP -\fB\-d\fR, \fB\-\-debug\fR[=\fIlist\fR] -Activate debug for selected items (default all). +\fB\-v\fR, \fB\-\-verbose\fR +Print additional information (eg, viewer command). .TP -\fB\-M\fR, \fB\-\-machine\fR -Use a more machine\-friendly output format. +\fB\-d\fR, \fB\-\-debug\fR[=\fIlist\fR] +Print debug info for selected items (default: all). .SS "Environment:" .IP PAGER, BROWSER, PDFVIEWER, PSVIEWER, DVIVIEWER. .SS "Files:" .IP -<texmf>/texdoc/texdoc.cnf files, see the \fB\-f\fR option. +<texmf>/texdoc/texdoc.cnf, see output of the \fB\-\-files\fR option. .SS "Homepage:" .IP http://tug.org/texdoc/ diff --git a/Master/texmf/doc/man/man1/texdoc.man1.pdf b/Master/texmf/doc/man/man1/texdoc.man1.pdf Binary files differindex 072a6efaf1d..1e7e8adb0b9 100644 --- a/Master/texmf/doc/man/man1/texdoc.man1.pdf +++ b/Master/texmf/doc/man/man1/texdoc.man1.pdf diff --git a/Master/texmf/doc/texdoc/News b/Master/texmf/doc/texdoc/News index 4111da6b1ca..faca951b308 100644 --- a/Master/texmf/doc/texdoc/News +++ b/Master/texmf/doc/texdoc/News @@ -1,3 +1,17 @@ +Version 0.66 +------------ + +Turn the -v=N, --verbosity=N command-line option into a pair of related options +-v, --verbose and -q, --quiet (more standard, Karl's suggestion). Also remove +uselessly verbose debug items so --debug is usable again. + +Rework help text (Karl's suggestion). + +Issue a warning about DISPLAY not being set on generic Unix before trying to +start a viewer. + +Small internal clean-ups. + Version 0.65 ------------ @@ -27,7 +41,7 @@ Version 0.61 Detect desktop environments (KDE4, KDE, GNOME, XFCE) for viewer selection. Version 0.60 ------------- +============ Changed the search/alias/score logic. See section 2 of the manual for details, but here is a primer: @@ -36,10 +50,10 @@ but here is a primer: The beginning of the manual has been completely rewritten. -Bug have been fixed as usual, and probably some others introduced... +Bugs have been fixed as usual, and probably some others introduced... Version 0.50 ------------- +============ - New option for machine-readable output. - Bugfixes (esp. for zipped file support (Unix only)). @@ -102,7 +116,7 @@ Documentation update. Alias additions and fixes as usual. Various bugfixes. License switched to GPL. Version 0.4 (TeX Live 2008) ---------------------------- +=========================== Use our own configuration files, not texmf.cnf. Rework the way viewers are handled, and add a few configuration options. diff --git a/Master/texmf/doc/texdoc/texdoc.pdf b/Master/texmf/doc/texdoc/texdoc.pdf Binary files differindex 0fa9b3c942e..7eff49cd9a1 100644 --- a/Master/texmf/doc/texdoc/texdoc.pdf +++ b/Master/texmf/doc/texdoc/texdoc.pdf diff --git a/Master/texmf/doc/texdoc/texdoc.tex b/Master/texmf/doc/texdoc/texdoc.tex index 7cc3748fe7c..47d92faf292 100644 --- a/Master/texmf/doc/texdoc/texdoc.tex +++ b/Master/texmf/doc/texdoc/texdoc.tex @@ -163,7 +163,7 @@ \subtitle{Find \& view documentation in \TeX\ Live} \author{\url{http://tug.org/texdoc/}\\ Manuel Pégourié-Gonnard} -\date{v0.62 2010-01-05} +\date{v0.66 2010-02-22} \begin{document} \VerbatimFootnotes @@ -501,12 +501,17 @@ option is deprecated and will likely be removed soon. It is recommended to set ©ext_list© in a configuration file instead. Please protest on the \tdml if you want to keep this command-line option. -\begin{cmdsubsub}{-v, --verbosity}{cl-v} - -v=«n», --verbosity=«n» +\begin{cmdsubsub}{-q, --quiet}{cl-q} + -q, --quiet \end{cmdsubsub} -Set ©verbosity_level© to ©«n»©, see~\ref{cf-verbosity_level}. Be aware that you -must avoid spaces on the command line, and the ©=© sign is optional. +Set ©verbosity_level© to minimum, see~\ref{cf-verbosity_level}. + +\begin{cmdsubsub}{-v, --verbose}{cl-v} + -v, --verbose +\end{cmdsubsub} + +Set ©verbosity_level© to maximum, see~\ref{cf-verbosity_level}. \begin{cmdsubsub}{-d, --debug}{cl-d} -d, -d=«list», --debug, --debug=«list» @@ -661,17 +666,18 @@ shell construct. verbosity_level = «n» \end{cmdsubsub} -Set the verbosity level to ©«n»©. 3 means errors, warnings and informational -message will be printed (on stdout); 2 means only errors and warnings, 1 only -errors and 0 nothing (not recommended). +Set the verbosity level to ©«n»© (default: 2). 3 means errors, warnings and +informational messages will be printed (on stderr); 2 means only errors and +warnings, 1 only errors and 0 nothing except internal errors (obviously not +recommended). \begin{cmdsubsub}{debug_list}{cf-debug_list} debug_list = «list» \end{cmdsubsub} -Set the list of activated debug items (default: none). For a list of available -items, see the source code, file ©constants.tlu©, variable ©known_debugs©. -Debug information is printed on standard error. +Set the list of activated debug items (default: none; if the option is used +without arguments, the list defaults to all known debug items). Implies +©--verbose©. Debug information is printed on standard error. \begin{cmdsubsub}{machine_switch}{cf-machine_switch} machine_switch = «true, false» @@ -694,7 +700,7 @@ of the line, but the first 3 fields will remain unchanged. zipext_list = «list» \end{cmdsubsub} -List of supported extension for zipped files (default: empty). Allows +List of supported extensions for zipped files (default: empty). Allows compressed files with names like ©foobar.«zip»©, with ©«zip»© in the given ©«list»©, to be found and unzipped before the viewer is launched (the temporary file will be destroyed right after). diff --git a/Master/texmf/scripts/texdoc/config.tlu b/Master/texmf/scripts/texdoc/config.tlu index edcc59cab2a..475f2f71fbf 100644 --- a/Master/texmf/scripts/texdoc/config.tlu +++ b/Master/texmf/scripts/texdoc/config.tlu @@ -52,7 +52,12 @@ function set_config_element (key, value, context) -- detect the type of the key if string.match(key, '_list$') then -- coma-separated list - local values = string.explode(value, ',') + local values + if value == '' then + values = {} + else + values = string.explode(value, ',') + end local inverse = {} for i, j in ipairs(values) do -- sanitize values... j = string.gsub(j, '%s*$', '') @@ -139,15 +144,15 @@ function setup_config_from_cl(arg) -- special options if (curr_arg == '-h') or (curr_arg == '--help') then print (C.usage_msg) - os.exit(0) + os.exit(C.exit_ok) elseif (curr_arg == '-V') or (curr_arg == '--version') then print (C.progname .. ' ' .. C.version ) - os.exit(0) + os.exit(C.exit_ok) elseif (curr_arg == '-f') or (curr_arg == '--files') then print (C.progname .. ' ' .. C.version ) setup_config_from_files () show_config_files (print, true) - os.exit(0) + os.exit(C.exit_ok) -- options related to mode elseif (curr_arg == '-w') or (curr_arg == '--view') then set_config_elt('mode', 'view') @@ -185,12 +190,30 @@ function setup_config_from_cl(arg) elseif string.match(curr_arg, '^%-%-debug=') then local value = string.gsub(curr_arg, '^%-%-debug=', '') set_config_elt('debug_list', value) - -- verbosity + -- quiet + elseif (curr_arg == '-q') or (curr_arg == '--quiet') then + set_config_elt('verbosity_level', C.min_verbosity) + -- verbose + elseif string.match(curr_arg, '^%-%-verbose') then + set_config_elt('verbosity_level', C.max_verbosity) elseif string.match(curr_arg, '^%-v') then local value = string.gsub(curr_arg, '^%-v=?', '') - set_config_elt('verbosity_level', value) + if value == '' then + set_config_elt('verbosity_level', C.max_verbosity) + else -- compatibility syntax + err_print('warning', + 'The -v option does not accept arguments any more.') + err_print('warning', + 'Please use the new syntax -v, --verbose (without argument).') + set_config_elt('verbosity_level', value) + end elseif string.match(curr_arg, '^%-%-verbosity') then + -- compatibility syntax local value = string.gsub(curr_arg, '^%-%-verbosity=?', '') + err_print('warning', + '--verbosity is deprecated and will be removed soon.') + err_print('warning', + 'Please use the new syntax -v, --verbose (without argument).') set_config_elt('verbosity_level', value) -- extensions list (deprecated) elseif string.match(curr_arg, '^%-e') then @@ -214,8 +237,8 @@ function setup_config_from_cl(arg) -- problem else err_print('error', "unknown option: "..curr_arg) - print (C.error_msg) - os.exit(2) + err_print('error', C.error_msg) + os.exit(C.exit_usage) end end end @@ -478,9 +501,10 @@ function setup_config_from_defaults() mode = 'view', interact_switch = 'true', machine_switch = 'false', - verbosity_level = '2', ext_list = 'pdf, html, txt, ps, dvi, ', badext_list = 'txt, ', + verbosity_level = C.def_verbosity, + debug_list = '', } -- must be set after mode! set_config_elt ('alias_switch', alias_from_mode(config.mode)) @@ -521,7 +545,11 @@ function setup_config_and_alias(arg) if config.machine_switch == true then real_set_config('interact_switch', false) end - -- we were waiting for config.debug_list to be know to do this + -- debug implies verbose + if table.maxn(config.debug_list) > 0 then + real_set_config('verbosity_level', tonumber(C.max_verbosity)) + end + -- we were waiting for config.debug_list to be known to do this show_config_files(function(s) deb_print('files', s) end) end diff --git a/Master/texmf/scripts/texdoc/constants.tlu b/Master/texmf/scripts/texdoc/constants.tlu index a23d28ec6b0..e7023815cf0 100644 --- a/Master/texmf/scripts/texdoc/constants.tlu +++ b/Master/texmf/scripts/texdoc/constants.tlu @@ -15,31 +15,40 @@ load_env(L, { -- progname and version fullname = arg[0] progname = 'texdoc' -version = '0.65' +version = '0.66' -- make sure to update setup_config_from_cl() accordingly -- and set a default value in setup_config_from_defaults() if relevant usage_msg = [[ -texdoc tries to find appropriate TeX documentation for the specified NAME(s). -With no NAME, it can print configuration information (-f, --files); -the usual --help and --version options are also accepted. -Usage: texdoc [OPTIONS]... [NAME]... - -f, --files Print the name of the config files being used. - -w, --view Use view mode: start a viewer. +Usage: texdoc [OPTION]... [NAME]... + +Try to find appropriate TeX documentation for the specified NAME(s). +The default (view mode) is to display the documentation. + +With no NAME, print information about texdoc (--help, --version, --files). + + -h, --help Print this help message. + -V, --version Print the version number. + -f, --files Print the list of configuration files used. + + -w, --view Use view mode: start a viewer. (default) -m, --mixed Use mixed mode (view or list). -l, --list Use list mode: show a list of results. -s, --showall Use showall mode: show also "bad" results. - -r, --regex Use regex mode. (Deprecated.) - -e, --extensions=L Set ext_list=L. (Deprecated.) - -a, --alias Use the alias table. + -M, --machine Machine-readable output (list or showall modes). + + -a, --alias Use the alias table. (default) -A, --noalias Don't use the alias table. - -i, --interact Use interactive menus. + + -i, --interact Use interactive menus. (default) -I, --nointeract Use plain lists, no interaction required. - -v, --verbosity=N Set verbosity level to N. - -d, --debug[=list] Activate debug for selected items (default all). - -M, --machine Use a more machine-friendly output format. + + -q, --quiet Suppress warnings and most error messages. + -v, --verbose Print additional information (eg, viewer command). + -d, --debug[=list] Print debug info for selected items (default: all). + Environment: PAGER, BROWSER, PDFVIEWER, PSVIEWER, DVIVIEWER. -Files: <texmf>/texdoc/texdoc.cnf files, see the -f option. +Files: <texmf>/texdoc/texdoc.cnf, see output of the --files option. Homepage: http://tug.org/texdoc/ Manual: displayed by `texdoc texdoc'.]] @@ -73,6 +82,13 @@ err_priority = { warning = 2, info = 3, } +min_verbosity='0' +max_verbosity='3' +def_verbosity='2' + +exit_ok = 0 +--exit_error = 1 -- apparently hard-coded in Lua +exit_usage = 2 known_debugs = { version = {}, @@ -80,9 +96,6 @@ known_debugs = { config = {'files'}, view = {}, texdocs = {}, - filesea = {}, - lsrsea = {}, - kpse = {'texdocs', 'filesea', 'lsrsea'}, score = {}, } diff --git a/Master/texmf/scripts/texdoc/functions.tlu b/Master/texmf/scripts/texdoc/functions.tlu index cff6e2aaeec..e93debafffc 100644 --- a/Master/texmf/scripts/texdoc/functions.tlu +++ b/Master/texmf/scripts/texdoc/functions.tlu @@ -9,7 +9,7 @@ local L = {} load_env(L, { 'export_symbols', 'string', 'io', 'os', - 'pairs', 'ipairs', + 'pairs', 'ipairs', 'tonumber', 'C', 'config', }) @@ -29,7 +29,7 @@ end -- generic error display function (see the error_priority constant) function err_print (lvl, msg) -- be careful: maybe config.verbosity_level is not set yet - local verbosity_level = config.verbosity_level or 2 + local verbosity_level = config.verbosity_level or tonumber(C.def_verbosity) if C.err_priority[lvl] <= verbosity_level then io.stderr:write ("texdoc "..lvl..": "..msg.."\n") end diff --git a/Master/texmf/scripts/texdoc/main.tlu b/Master/texmf/scripts/texdoc/main.tlu index c5ff50d2ded..cb105eabda3 100644 --- a/Master/texmf/scripts/texdoc/main.tlu +++ b/Master/texmf/scripts/texdoc/main.tlu @@ -22,7 +22,7 @@ setup_config_and_alias(arg) -- make sure we actually have argument(s) if not arg[1] then print(C.usage_msg) - os.exit(2) + os.exit(C.exit_usage) end -- main loop diff --git a/Master/texmf/scripts/texdoc/search.tlu b/Master/texmf/scripts/texdoc/search.tlu index a962eedf7c1..2679d01d1d2 100644 --- a/Master/texmf/scripts/texdoc/search.tlu +++ b/Master/texmf/scripts/texdoc/search.tlu @@ -209,7 +209,6 @@ end -- scan a tree without ls-R file function scan_tree (patlist, code, base, cwd, recurse) - deb_print('filesea', "Entering directory: "..cwd) for file in lfs.dir(base..'/'..cwd) do if file ~= '.' and file ~= '..' then local f = (cwd == '') and file or cwd..'/'..file @@ -221,7 +220,6 @@ function scan_tree (patlist, code, base, cwd, recurse) end end end - deb_print('filesea', "Leaving directory: "..cwd) end -- scan a ls-R file @@ -245,9 +243,7 @@ function scan_lsr(patlist, code, cwd, shift) isdoc = true current_dir = string.sub (dir_line, l+1) is_dir[current_dir] = true - deb_print('lsrsea', 'Scanning directory: '..current_dir) elseif isdoc then - deb_print('lsrsea', "Finished scanning: "..shift) break -- we're exiting the ./doc (or shift) dir, so it's over end elseif isdoc then diff --git a/Master/texmf/scripts/texdoc/texdoc.tlu b/Master/texmf/scripts/texdoc/texdoc.tlu index 28470c597e7..69090deee2f 100755 --- a/Master/texmf/scripts/texdoc/texdoc.tlu +++ b/Master/texmf/scripts/texdoc/texdoc.tlu @@ -72,4 +72,4 @@ texdoc_load('view') texdoc_load('main') -- the end -os.exit(0) +os.exit(C.exit_ok) diff --git a/Master/texmf/scripts/texdoc/view.tlu b/Master/texmf/scripts/texdoc/view.tlu index b2f8d68a139..544c6673539 100644 --- a/Master/texmf/scripts/texdoc/view.tlu +++ b/Master/texmf/scripts/texdoc/view.tlu @@ -85,7 +85,15 @@ function try_viewing (view_command, viewer_replacement) else view_command = view_command..' '..viewer_replacement end - deb_print('view', 'View comand: '..view_command) + -- try to catch problems with missing DISPLAY on Unix + if os.type == 'unix' and not (os.name == 'macosx') + and os.getenv('DISPLAY') == nil then + err_print('warning', + "DISPLAY is not set. Things may go wrong with you viewer.") + err_print('warning', + "Try --list if you want results to be listed, not displayed.") + end + err_print('info', 'View comand: '..view_command) if not os.execute(view_command) then err_print('error', "Failed to execute '"..view_command.."'") return false diff --git a/Master/texmf/texdoc/texdoc.cnf b/Master/texmf/texdoc/texdoc.cnf index 5c4fb44c8fb..270a6f4cb8c 100644 --- a/Master/texmf/texdoc/texdoc.cnf +++ b/Master/texmf/texdoc/texdoc.cnf @@ -278,13 +278,13 @@ alias extramarks = fancyhdr/fancyhdr alias fonttable = fonttable/fonttable alias biocon = biocon/manual. alias makeindex = makeindex/makeindex -alias ltablex = ltablex.sty -alias comment = comment.sty alias xstring = xstring_doc_en alias xstring-fr = xstring_doc_fr alias isomath = isomath.sty.pdf -alias ucs = ucs/FAQ alias elsarticle = elsdoc +alias 2in1 = twoinone +alias afoot = arabtex-doc +alias chngpage = changepage # cite package (from texlive.tlpdb listing for cite) alias cite = /cite/README @@ -323,6 +323,7 @@ alias petri-nets = pndoc alias pst-geo = pst-map3d-doc alias sanskrit = sktdoc alias german = gerdoc +alias ngerman = gerdoc alias pst-eucl = pst-eucl/euclide_english alias pst-eucl-fr = pst-eucl/euclide @@ -403,32 +404,21 @@ alias cv = curve/curve alias preprint = preprint/00readme.txt alias sffms = sffms_manual -## packages from ctan/macros/latex/contrib/misc -# hope they all contain comments... +## packages from ctan/macros/latex/contrib/misc or with doc in .sty only # anyway, this is quite bad and should be changed some day -alias 2in1 = 2in1.sty alias 3parttable = 3parttable.sty -alias a4wide = a4wide.sty -alias a5comb = a5comb.sty -alias acromake = acromake.sty -alias advdate = advdate.sty -alias anonchap = anonchap.sty -alias askinclude = askinclude.sty -alias authoraftertitle = authoraftertitle.sty alias bibcheck = bibcheck.sty alias block = block.sty -alias bold-extra = bold-extra.sty -alias boxedminipage = boxedminipage.sty alias braket = braket.sty alias breakcites = breakcites.sty alias cancel = cancel.sty alias captdef = captdef.sty alias cases = cases.sty -alias changepage = changepage.sty alias chbibref = chbibref.sty alias chngcntr = chngcntr.sty alias circle = circle.sty +alias comment = comment.sty alias concrete = concrete.sty alias dblfloatfix = dblfloatfix.sty alias endnotes = endnotes.sty @@ -446,6 +436,7 @@ alias isonums = isonums.sty alias kix = kix.sty alias linsys = linsys.sty alias listing = listing.sty +alias ltablex = ltablex.sty alias magaz = magaz.sty alias midpage = midpage.sty alias mitpress = mitpress.sty |