summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-07-28 23:32:35 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-07-28 23:32:35 +0000
commitdc0ce3c0c5831ad7081a0329abeb473cbf257fdc (patch)
tree2b12fb27d0524e881d6f90e0f9184311cd535fb1
parent83db8fed57f1bb86a50e119a5e97896a783c1e6b (diff)
max_lines for the menu now configurable. And viewing from menu really launchs a veiwer now :-)
git-svn-id: svn://tug.org/texlive/trunk@9856 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf/scripts/texlive/texdoc.tlu22
1 files changed, 11 insertions, 11 deletions
diff --git a/Master/texmf/scripts/texlive/texdoc.tlu b/Master/texmf/scripts/texlive/texdoc.tlu
index 14d5fe3becf..cfc64747680 100755
--- a/Master/texmf/scripts/texlive/texdoc.tlu
+++ b/Master/texmf/scripts/texlive/texdoc.tlu
@@ -488,7 +488,7 @@ function setup_config_from_defaults()
}
end
end
- -- then mode, alias, verbosity
+ -- then various stuff
set_config_list {
mode = 'view',
verbose = 'false',
@@ -651,26 +651,26 @@ end
-- print a list of files as a menu (with an optional complementary list)
function print_menu (files, comp)
comp = comp or {}
+ max_lines = tonumber (config.max_lines) or 20
local f = #files
if interactive then
local n = f + #comp
- if n > 20 then
- io.write (n, "results. Display them all? (y/N) ")
- local ans = io.read(1)
+ if n > max_lines then
+ io.write (n, " results. Display them all? (y/N) ")
+ local ans = io.read('*line')
if not ((ans == 'y') or (ans == 'Y')) then return end
end
end
display_table (files)
display_table (comp, f)
if interactive then
- io.write ("Please enter the number of the file to view, or 0 to exit: ")
- local num = io.read('*number')
- if num and (num <= #files) and files[num] then
- print ("Viewing file '"..files[num].."'.")
+ io.write ("Please enter the number of the file to view, ",
+ "anything else to skip: ")
+ local num = tonumber(io.read('*line'))
+ if num and (num <= f) and files[num] then
+ try_viewing (how_to_view (files[num]))
elseif num and comp[num-f] then
- print ("Viewing file '"..comp[num-f].."'.")
- elseif num ~= 0 then
- print ("Incorrect input, skipping.")
+ try_viewing (how_to_view (comp[num-f]))
end
end
end