summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/texdoc
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/texdoc')
-rwxr-xr-xMaster/texmf-dist/scripts/texdoc/texdoclib-config.tlu13
-rwxr-xr-xMaster/texmf-dist/scripts/texdoc/texdoclib-const.tlu10
-rwxr-xr-xMaster/texmf-dist/scripts/texdoc/texdoclib-search.tlu5
-rwxr-xr-xMaster/texmf-dist/scripts/texdoc/texdoclib-view.tlu14
-rw-r--r--Master/texmf-dist/scripts/texdoc/texdoclib.tlu2
5 files changed, 22 insertions, 22 deletions
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib-config.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib-config.tlu
index d4f993d4495..2fc0c99cdf0 100755
--- a/Master/texmf-dist/scripts/texdoc/texdoclib-config.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib-config.tlu
@@ -274,15 +274,15 @@ local function get_config_files()
}
-- get dirs
- local sep = (os.type == 'windows') and ';' or ':'
- local texmf_texdoc = kpse.expand_path('$TEXMF/texdoc')
- local dirs = texmf_texdoc:explode(sep)
+ local kpse_texmf = kpse.expand_var('$TEXMF')
+ local texmfs = kpse.expand_braces(kpse_texmf):explode(C.kpse_sep)
-- merge them
local ret = {}
- for _, dir in ipairs(dirs) do
+ for _, dir in ipairs(texmfs) do
+ local path = dir:gsub('^!!', '')
for _, name in ipairs(names) do
- local pathname = dir .. '/' .. name
+ local pathname = path .. '/texdoc/' .. name
table.insert(ret, pathname)
end
end
@@ -344,9 +344,8 @@ function M.show_config_files(is_action)
-- show the recommendation (only for the "files" action)
if is_action then
print_func('Recommended file(s) for personal settings:')
- local sep = (os.type == 'windows') and ';' or ':'
-- here TEXMFHOMEs do not have to exist, and thus use kpse.var_value
- local texmfhomes = string.explode(kpse.var_value('TEXMFHOME'), sep)
+ local texmfhomes = kpse.var_value('TEXMFHOME'):explode(C.kpse_sep)
for _, home in ipairs(texmfhomes) do
print_func(indent .. w32_path(home .. '/texdoc/texdoc.cnf'))
end
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib-const.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib-const.tlu
index a1907c75c45..aef88a06237 100755
--- a/Master/texmf-dist/scripts/texdoc/texdoclib-const.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib-const.tlu
@@ -5,6 +5,7 @@
-- use an empty environment that will become texdoc_env.C (see EOF)
local constants = {}
local kpse = kpse or require 'kpse'
+local os = os or require 'os'
local setfenv = setfenv
local texdoc_env
@@ -21,8 +22,8 @@ end
-- progname and version
fullname = kpse.find_file('texdoc/texdoclib', 'lua')
progname = 'Texdoc'
-version = '3.2.2'
-release_date = '2020-09-16'
+version = '3.3'
+release_date = '2021-03-17'
-- make sure to update setup_config_from_cl() accordingly
-- and set a default value in setup_config_from_defaults() if relevant
@@ -63,7 +64,7 @@ Repository: <https://github.com/TeX-Live/texdoc>
Please email bugs to <texdoc@tug.org>.]]
copyright_msg = [[
-Copyright 2008-2020 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
+Copyright 2008-2021 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.]]
@@ -133,6 +134,9 @@ data_tlpdb_name = 'texdoc/Data.tlpdb.lua'
place_holder = '%%s' -- used for viewer commands
+-- kpse path separator
+kpse_sep = (os.type == 'windows') and ';' or ':'
+
-- END constants
-- get our previous environment back
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib-search.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib-search.tlu
index 0340fa63ba1..8718dc83fff 100755
--- a/Master/texmf-dist/scripts/texdoc/texdoclib-search.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib-search.tlu
@@ -280,7 +280,7 @@ local function scan_db(patlist, code, lsr_db)
end
end
---------------------- manage TEXDOCS trees à la kpse ----------------------
+--------------------- manage TEXDOCS trees of the kpse ----------------------
-- build a db from a ls-R file
local function init_lsr_db(root, shift)
@@ -371,11 +371,10 @@ init_texdocs_database = function()
end
doc_roots = {}
- local sep = (os.type == 'windows') and ';' or ':'
local kpse_texdocs = kpse.expand_var('$TEXDOCS')
-- expand the path and turn it into a lua list
- local raw_doc_roots = kpse.expand_braces(kpse_texdocs):explode(sep)
+ local raw_doc_roots = kpse.expand_braces(kpse_texdocs):explode(C.kpse_sep)
local max = #raw_doc_roots + 1
for j, dir in ipairs(raw_doc_roots) do
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib-view.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib-view.tlu
index 126ca576869..49148ea976b 100755
--- a/Master/texmf-dist/scripts/texdoc/texdoclib-view.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib-view.tlu
@@ -32,14 +32,6 @@ local function try_viewing(view_command, viewer_replacement)
view_command = view_command .. ' ' .. viewer_replacement
end
- -- 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; your viewer will likely have problems.')
- err_print('warning',
- 'Try --list to list results instead of displaying them.')
- end
err_print('info', 'View command: ' .. view_command)
-- See long comment below this function for the LC_CTYPE story.
@@ -55,6 +47,12 @@ local function try_viewing(view_command, viewer_replacement)
-- the big casino: run the external command.
if os.execute(view_command) > 0 then
err_print('error', 'Failed to execute: ' .. 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('error',
+ 'Maybe your viewer failed because DISPLAY is not set.')
+ end
os.exit(C.exit_error)
end
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
index 7c93fba54cf..f7d4f06055e 100644
--- a/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
@@ -1,7 +1,7 @@
-- texdoclib.tlu: the texdoc library
--[[
-Copyright 2008-2020 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
+Copyright 2008-2021 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
This program is 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