summaryrefslogtreecommitdiff
path: root/tex/context/base/mtx-context-listing.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mtx-context-listing.tex')
-rw-r--r--tex/context/base/mtx-context-listing.tex16
1 files changed, 14 insertions, 2 deletions
diff --git a/tex/context/base/mtx-context-listing.tex b/tex/context/base/mtx-context-listing.tex
index d0dbcbba0..0cbd73784 100644
--- a/tex/context/base/mtx-context-listing.tex
+++ b/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