Skip to content

Commit 3d4909b

Browse files
committed
look for configuration files in all TEXMF trees
1 parent 4bf7569 commit 3d4909b

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

Todo

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
For next release
22
================
33

4-
look for config files in $TEXMF/texdoc
5-
- adapt -f
4+
new config files location
65
- adapt tools/td2tl
6+
- document
77

8-
Ideas for later
9-
===============
8+
9+
For later
10+
=========
1011

1112
Internal
1213
--------

script/config.tlu

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function confline_to_config(line, file, pos)
238238
return false
239239
end
240240

241-
-- return the list of configuration files and the index of the recommended file
241+
-- return the list of configuration files
242242
function get_config_files ()
243243
-- get names
244244
local platform = string.match (kpse.var_value ('SELFAUTOLOC'), '.*/(.*)$')
@@ -261,7 +261,7 @@ function get_config_files ()
261261
end
262262
end
263263
end
264-
return ret, 1
264+
return ret
265265
end
266266

267267
-- the config_files table is shared by the next two functions
@@ -270,15 +270,12 @@ local config_files = {}
270270

271271
-- set config/aliases from all config files
272272
function setup_config_from_files ()
273-
local file_list, good_index = get_config_files()
273+
local file_list = get_config_files()
274274
for i, file in ipairs (file_list) do
275-
local found = lfs.isfile(file)
276-
local status = found and (config.lastfile_switch
277-
and 'disabled' or 'active') or 'absent'
275+
local status = config.lastfile_switch and 'disabled' or 'active'
278276
config_files[i] = {
279277
path = file,
280278
status = status,
281-
good = (i == good_index),
282279
}
283280
if status == 'active' then
284281
read_config_file (file)
@@ -287,17 +284,16 @@ function setup_config_from_files ()
287284
end
288285

289286
-- now a special information function (see -f,--file option)
290-
function show_config_files (print_fun, prefix)
287+
function show_config_files (print_fun, verbose)
288+
local pref = verbose and ' ' or ''
291289
print_fun("Configuration files are:")
292290
for i, file in ipairs (config_files) do
293-
local home = prefix
294-
and (file.good and "(*) " or " ")
295-
or ''
296-
print_fun (home..file.status..'\t'..w32_path(file.path))
291+
print_fun(pref..file.status..'\t'..w32_path(file.path))
297292
end
298-
if prefix then
299-
print("(*) This is the recommended configuration file "
300-
.. "for your personal preferences.")
293+
if verbose then
294+
local texmfhome = kpse.var_value('TEXMFHOME')
295+
print_fun('Recommended file for personal settings:')
296+
print_fun(pref..texmfhome..'/texdoc/texdoc.cnf')
301297
end
302298
end
303299

0 commit comments

Comments
 (0)