summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mtx-context-listing.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mtx-context-listing.tex')
-rw-r--r--Master/texmf-dist/tex/context/base/mtx-context-listing.tex16
1 files changed, 14 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/context/base/mtx-context-listing.tex b/Master/texmf-dist/tex/context/base/mtx-context-listing.tex
index d0dbcbba09b..0cbd73784c8 100644
--- a/Master/texmf-dist/tex/context/base/mtx-context-listing.tex
+++ b/Master/texmf-dist/tex/context/base/mtx-context-listing.tex
@@ -69,6 +69,12 @@
lfg = "lua",
}
+ local pattern = document.arguments.pattern
+
+ if pattern then
+ document.files = dir.glob(pattern)
+ end
+
if #document.files > 0 then
if document.arguments.sort then
table.sort(document.files)
@@ -85,10 +91,16 @@
end
context.page()
context.setupfootertexts( -- return true: we need to keep this entry
- { function() context.detokenize(file.basename(filename)) return true end },
+ { function() context.detokenize(pattern and filename or file.basename(filename)) return true end },
{ function() context.pagenumber() return true end }
)
- context.setuptyping { option = types[pretty] or pretty }
+ if pretty then
+ if type(pretty) ~= "string" or pretty == "" then
+ context.setuptyping { option = "color" }
+ else
+ context.setuptyping { option = types[pretty] or pretty }
+ end
+ end
context.typefile(filename)
end
end