summaryrefslogtreecommitdiff
path: root/Master/texmf/scripts/texdoc
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-02-21 14:14:42 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-02-21 14:14:42 +0000
commit7c9f6a4afbde2d556ff913ba1a4f97a921b51ba6 (patch)
treed53063822f58f01e191b9a1897bcac9ba2176d39 /Master/texmf/scripts/texdoc
parent2cbda0b0a6e9b2b637cdf0f0e7f99cabfb8ceb68 (diff)
Texdoc 0.65 with more flexibility in the list of configuration files.
git-svn-id: svn://tug.org/texlive/trunk@17111 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts/texdoc')
-rw-r--r--Master/texmf/scripts/texdoc/config.tlu24
-rw-r--r--Master/texmf/scripts/texdoc/constants.tlu2
-rw-r--r--Master/texmf/scripts/texdoc/score.tlu1
3 files changed, 15 insertions, 12 deletions
diff --git a/Master/texmf/scripts/texdoc/config.tlu b/Master/texmf/scripts/texdoc/config.tlu
index 5ddc77e59bc..edcc59cab2a 100644
--- a/Master/texmf/scripts/texdoc/config.tlu
+++ b/Master/texmf/scripts/texdoc/config.tlu
@@ -281,8 +281,7 @@ function confline_to_config(line, file, pos)
return false
end
-
--- return a table with config file and if they exist
+-- return the list of configuration files and the index of the recommended file
function get_config_files ()
local platform = string.match (kpse.var_value ('SELFAUTOLOC'), '.*/(.*)$')
local TEXMFHOME = kpse.var_value ('TEXMFHOME')
@@ -294,8 +293,8 @@ function get_config_files ()
TEXMFHOME .. '/texdoc/texdoc-dist.cnf',
TEXMFLOCAL .. '/texdoc/texdoc-'..platform..'.cnf',
TEXMFLOCAL .. '/texdoc/texdoc.cnf',
- TEXMFMAIN .. '/texdoc/texdoc.cnf'
- }
+ TEXMFMAIN .. '/texdoc/texdoc.cnf',
+ }, 2
end
-- the config_files table is shared by the next two functions
@@ -304,14 +303,17 @@ local config_files = {}
-- set config/aliases from all config files
function setup_config_from_files ()
- for i, file in ipairs (get_config_files ()) do
+ local file_list, good_index = get_config_files()
+ for i, file in ipairs (file_list) do
local found = lfs.isfile(file)
+ local status = found and (config.lastfile_switch
+ and 'disabled' or 'active') or 'absent'
config_files[i] = {
path = file,
- status = found and (config.lastfile_switch
- and 'disabled' or 'active') or 'absent',
+ status = status,
+ good = (i == good_index),
}
- if config_files[i].status == 'active' then
+ if status == 'active' then
read_config_file (file)
end
end
@@ -321,9 +323,9 @@ end
function show_config_files (print_fun, prefix)
print_fun("Configuration files are:")
for i, file in ipairs (config_files) do
- local home = prefix and
- ((i==2) and "(*) " or " ") -- home conffile is the 2nd
- or ''
+ local home = prefix
+ and (file.good and "(*) " or " ")
+ or ''
print_fun (home..file.status..'\t'..win32_hook(file.path))
end
if prefix then
diff --git a/Master/texmf/scripts/texdoc/constants.tlu b/Master/texmf/scripts/texdoc/constants.tlu
index 24163ea556b..a23d28ec6b0 100644
--- a/Master/texmf/scripts/texdoc/constants.tlu
+++ b/Master/texmf/scripts/texdoc/constants.tlu
@@ -15,7 +15,7 @@ load_env(L, {
-- progname and version
fullname = arg[0]
progname = 'texdoc'
-version = '0.64'
+version = '0.65'
-- make sure to update setup_config_from_cl() accordingly
-- and set a default value in setup_config_from_defaults() if relevant
diff --git a/Master/texmf/scripts/texdoc/score.tlu b/Master/texmf/scripts/texdoc/score.tlu
index fee09a00014..6e74e86ca09 100644
--- a/Master/texmf/scripts/texdoc/score.tlu
+++ b/Master/texmf/scripts/texdoc/score.tlu
@@ -112,6 +112,7 @@ local suffixes = {
'-guide',
'-user',
'-man',
+ 'notes',
}
-- compute a heuristic score 0 <= s < 10