summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-02-03 03:02:06 +0000
committerNorbert Preining <norbert@preining.info>2024-02-03 03:02:06 +0000
commit8d5a9f6bbecb297f513b9ed16e574db1c1310228 (patch)
tree4d9e1be6863ce68eb23b545add6e000edff4817c /support
parentb5a938a222c59addea5ca0a22cd53b2bbf66e1fa (diff)
CTAN sync 202402030302
Diffstat (limited to 'support')
-rw-r--r--support/texdoc/NEWS10
-rw-r--r--support/texdoc/doc/texdoc.14
-rw-r--r--support/texdoc/doc/texdoc.pdfbin89738 -> 89528 bytes
-rw-r--r--support/texdoc/doc/texdoc.tex15
-rw-r--r--support/texdoc/script/texdoclib-cli.tlu32
-rw-r--r--support/texdoc/script/texdoclib-const.tlu20
-rw-r--r--support/texdoc/script/texdoclib-score.tlu19
-rw-r--r--support/texdoc/texdoc.cnf9
8 files changed, 63 insertions, 46 deletions
diff --git a/support/texdoc/NEWS b/support/texdoc/NEWS
index 2567cc3764..6690f09e0e 100644
--- a/support/texdoc/NEWS
+++ b/support/texdoc/NEWS
@@ -2,6 +2,12 @@ NEWS for Texdoc
===============
(This file public domain.)
+Version 4.0.2 (2024-02-02)
+--------------------------
+- Improve the option parser
+- Better locale handling
+- Scoring adjustments
+
Version 4.0.1 (2023-02-27)
--------------------------
- Minor bug fixes for Windows
@@ -13,9 +19,9 @@ Version 4.0 (2023-02-20)
Release for TeX Live 2023.
Major changes
-- Online search feature is added (by Wu Zhenyu):
+- Online search feature is added (by Max Chernoff):
users using TL without documentation will be sent to texdoc.org
-- Add new action --print-completion (by Max Chernoff):
+- Add new action --print-completion (by Wu Zhenyu):
for the moment, only zsh is supported. Contributions welcome.
Minor fixes and tweaks
diff --git a/support/texdoc/doc/texdoc.1 b/support/texdoc/doc/texdoc.1
index 5dbfa0979c..a1fc051ce2 100644
--- a/support/texdoc/doc/texdoc.1
+++ b/support/texdoc/doc/texdoc.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "TEXDOC" "1" "February 2023" "Texdoc 4.0.1" "Texdoc manual"
+.TH "TEXDOC" "1" "February 2024" "Texdoc 4.0.2" "Texdoc manual"
.
.SH "NAME"
\fBtexdoc\fR \- find & view documentation in TeX Live
@@ -160,7 +160,7 @@ Texdoc home page: \fIhttp://tug\.org/texdoc/\fR
Source: \fIhttps://github\.com/TeX\-Live/texdoc\fR
.
.SH "COPYRIGHT"
-Copyright 2008\-2023 Manuel Pe\'gourie\'\-Gonnard, Takuto Asakura, the TeX Live Team\.
+Copyright 2008\-2024 Manuel Pe\'gourie\'\-Gonnard, Takuto Asakura, the TeX Live Team\.
.
.br
License: GNU GPL version 3 or later \fIhttp://gnu\.org/licenses/gpl\.html\fR\.
diff --git a/support/texdoc/doc/texdoc.pdf b/support/texdoc/doc/texdoc.pdf
index 03cc55b3d8..619e62907e 100644
--- a/support/texdoc/doc/texdoc.pdf
+++ b/support/texdoc/doc/texdoc.pdf
Binary files differ
diff --git a/support/texdoc/doc/texdoc.tex b/support/texdoc/doc/texdoc.tex
index ce01c8e321..56b5b40b11 100644
--- a/support/texdoc/doc/texdoc.tex
+++ b/support/texdoc/doc/texdoc.tex
@@ -1,6 +1,6 @@
%#!texfot xelatex
% Texdoc user manual
-% Copyright 2008-2023 Manuel Pégourié-Gonnard and Takuto Asakura
+% Copyright 2008-2024 Manuel Pégourié-Gonnard and Takuto Asakura
% distributed under the terms of GPL v3 or later
\documentclass{texdoc-doc}
@@ -8,7 +8,7 @@
\subtitle{Find \& view documentation in \TL}
\pkgurl{https://tug.org/texdoc/}
\author{Manuel Pégourié-Gonnard\and Takuto Asakura}
-\date{v4.0.1\quad \today}
+\date{v4.0.2\quad \today}
\begin{document}
@@ -787,20 +787,15 @@ our completion function with either of the following two ways:
\item adding \code{eval "\$(texdoc \lopt{print-completion} zsh)"} to your
zsh configuration file.
-\item adding a file somewhere in \code{\$fpath} with the following contents:
-%
-\begin{htcode}
-#compdef texdoc
-(( $+functions[__texdoc] )) || eval "$(texdoc \textbackslash
- --print-completion zsh)" && __texdoc
-\end{htcode}
+\item creating a file named \code{\_texdoc} in \code{\$fpath} whose content is
+ the output of \code{texdoc \lopt{print-completion} zsh}.
\end{itemize}
\section{Licence}
\label{sec:licence}
The current version of Texdoc program and its documentation are copyright
-2008--2023 Manuel Pégourié-Gonnard, Takuto Asakura, the {\TL} Team.
+2008--2024 Manuel Pégourié-Gonnard, Takuto Asakura, the {\TL} Team.
They are free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
diff --git a/support/texdoc/script/texdoclib-cli.tlu b/support/texdoc/script/texdoclib-cli.tlu
index 5eddc8f7f5..79c202600d 100644
--- a/support/texdoc/script/texdoclib-cli.tlu
+++ b/support/texdoc/script/texdoclib-cli.tlu
@@ -21,32 +21,36 @@ local err_print = texdoc.util.err_print
-- modified Alternative GetOpt
-- cf. http://lua-users.org/wiki/AlternativeGetOpt
local function getopt(arg, options)
- local tmp = nil
+ local tmp
local tab = {}
local saved_arg = {table.unpack(arg)}
for k, v in ipairs(saved_arg) do
- if string.sub(v, 1, 2) == '--' then
+ if v:sub(1, 2) == '--' then
table.remove(arg, 1)
- local x = string.find(v, '=', 1, true)
+ if v == '--' then -- terminate parsing
+ break
+ end
+
+ local x = v:find('=', 1, true)
if x then
- table.insert(tab, {string.sub(v, 3, x - 1), string.sub(v, x+1)})
+ table.insert(tab, {v:sub(3, x - 1), v:sub(x+1)})
else
- table.insert(tab, {string.sub(v, 3), true})
+ table.insert(tab, {v:sub(3), true})
end
- elseif string.sub(v, 1, 1) == '-' then
+ elseif v:sub(1, 1) == '-' then
table.remove(arg, 1)
local y = 2
- local l = string.len(v)
+ local l = v:len()
local jopt
while (y <= l) do
- jopt = string.sub(v, y, y)
+ jopt = v:sub(y, y)
- if string.find(options, jopt, 1, true) then
+ if options:find(jopt, 1, true) then
if y < l then
- tmp = string.sub(v, y + 1)
+ tmp = v:sub(y + 1)
y = l
else
table.remove(arg, 1)
@@ -60,7 +64,7 @@ local function getopt(arg, options)
os.exit(C.exit_error)
end
- if string.match(tmp, '^%-') then
+ if tmp:match('^%-') then
table.insert(tab, {jopt, false})
else
table.insert(tab, {jopt, tmp})
@@ -102,14 +106,14 @@ local function parse_options()
end
for i, o in ipairs(C.options) do
- if k == o["short"] or k == o["long"] then
+ if k == o['short'] or k == o['long'] then
k = i
break
end
end
option = C.options[k]
- if option['group'] == 'action' then
+ if option ~= nil and option['group'] == 'action' then
if option['long'] == 'just-view' then
return true, 'view', cl_config
elseif option['long'] == 'print-completion' then
@@ -117,7 +121,7 @@ local function parse_options()
else
return true, option['long'], cl_config
end
- elseif option['group'] then
+ elseif option~=nil and option['group'] then
if option['type'] == 'boolean' then
option['action'](cl_config, curr_arg)
elseif option['type'] == 'string' then
diff --git a/support/texdoc/script/texdoclib-const.tlu b/support/texdoc/script/texdoclib-const.tlu
index c551bf40ef..1088c25e5e 100644
--- a/support/texdoc/script/texdoclib-const.tlu
+++ b/support/texdoc/script/texdoclib-const.tlu
@@ -22,8 +22,8 @@ end
-- progname and version
fullname = kpse.find_file('texdoc/texdoclib', 'lua')
progname = 'Texdoc'
-version = '4.0.1'
-release_date = '2023-02-27'
+version = '4.0.2'
+release_date = '2024-02-02'
-- make sure to update setup_config_from_cl() accordingly
-- and set a default value in setup_config_from_defaults() if relevant
@@ -50,8 +50,8 @@ Website: <https://tug.org/texdoc/>
Repository: <https://github.com/TeX-Live/texdoc>
Please email bugs to <texdoc@tug.org>.]]
-zsh_completion = [[
-compdef __texdoc texdoc
+zsh_completion = [=[
+#compdef texdoc
__texdoc() {
local options=(
@@ -72,7 +72,15 @@ __texdoc() {
;;
esac
}
-]]
+
+if [[ $zsh_eval_context[-1] == loadautofunc ]]; then
+ # autoload from fpath, call function directly
+ __texdoc "$@"
+else
+ # eval/source/. command, register function for later
+ compdef __texdoc texdoc
+fi
+]=]
--[[ structure of the options table
@@ -260,7 +268,7 @@ options = {
}
copyright_msg = [[
-Copyright 2008-2023 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
+Copyright 2008-2024 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.]]
diff --git a/support/texdoc/script/texdoclib-score.tlu b/support/texdoc/script/texdoclib-score.tlu
index 7124a834e4..11befc7ed9 100644
--- a/support/texdoc/script/texdoclib-score.tlu
+++ b/support/texdoc/script/texdoclib-score.tlu
@@ -212,7 +212,7 @@ local function set_score(df, original_kw)
-- bonus for locale
local config_lang = texdoc.config.get_value('lang')
- if not is_alias and config_lang ~= nil then
+ if not is_alias then
local file_lang = df.lang
if not file_lang then
@@ -220,10 +220,12 @@ local function set_score(df, original_kw)
file_lang = texdoc.const.lang_codes[file_lang]
end
- if config_lang == file_lang then
+ if config_lang ~= nil and config_lang == file_lang then
score = score + 1
dbg_score('Locale match bonus: +1.0')
- elseif file_lang ~= nil then
+ elseif file_lang ~= nil and file_lang ~= 'en' then
+ -- normally, english documents do not have file_lang,
+ -- but sometimes the catalog includes en info (e.g., geometry)
score = score - 0.1
dbg_score('Locale unmatch: -0.1')
end
@@ -308,19 +310,18 @@ end
-- returns the index of the most specific extension of file in ext_list,
-- or config.ext_list_max + 1
-function M.ext_pos(file)
+function M.ext_pos(filename)
-- remove zipext if applicable
- file = texdoc.util.parse_zip(file)
+ filename = texdoc.util.parse_zip(filename)
-- now find the extension
local p, e, pos, ext
for p, e in ipairs(texdoc.config.get_value('ext_list')) do
if (e == '*') and (ext == nil) then
pos, ext = p, e
- elseif (e == '') and not string.find(file, '.', 1, true) then
+ elseif (e == '') and not filename:find('.', 1, true) then
pos, ext = p, e
- elseif string.sub(file, -string.len(e)-1) == '.' .. e then
- if (ext == nil) or (ext == '*')
- or (string.len(e) > string.len(ext)) then
+ elseif filename:sub(-e:len() - 1) == '.' .. e then
+ if (ext == nil) or (ext == '*') or (e:len() > ext:len()) then
pos, ext = p, e
end
end
diff --git a/support/texdoc/texdoc.cnf b/support/texdoc/texdoc.cnf
index 1f93fd3415..980cb2dbf6 100644
--- a/support/texdoc/texdoc.cnf
+++ b/support/texdoc/texdoc.cnf
@@ -200,10 +200,9 @@ adjscore(context) /gnuplot/ = -3
adjscore(context) context.man1 = +2
adjscore(symbols) /staves/ = -5
-# catalogue info missing in the tlcontrib version of the package :-(
+# catalogue info missing cases
+adjscore(inputenc) inputenc.pdf = +5
adjscore(pgf) pgfmanual.pdf = +5
-
-# another catalogue info missing case
adjscore(hyph-utf8) hyphenation.pdf = +5
# let's not have context version found first
@@ -330,6 +329,7 @@ alias flafter = source2e
alias fontenc = source2e
alias textcomp = source2e
alias tracefnt = source2e
+alias structuredlog = ltfilehook-doc
# TODO: try to avoid the huge amount of false positives for `doc' itself.
# latex-dev instruction
@@ -501,6 +501,9 @@ alias jurabib-de = jbgerdoc
alias ofs-cz = ofsdoc
alias ofs = ofsdoc-e
+# a rare case: '-p.pdf' (for printing, a4), '-s.pdf' (for screen)
+alias metafun = metafun-p
+
## aliases basically borrowed from texdoctk.dat with some adaptations
alias akletter = akletter/lettereng
alias arydshln = arydshln-man