Tad Ashlock wrote:
Hans Hagen wrote:
Tad Ashlock wrote:
Is there a convenient way within a Lua block to determine the current file name and line number of the source file being processed by ConTeXt?
[snip]
i have no time now to figure out while filenames are not known but here's a (wikifyable) hack: [snip] line = status.linenumber, file = status.filename
From the luatex 0.40.6 sources (luatex/source/texk/web2c/luatexdir/lua/lstatslib.c): ---------------------------------------------------------- /* hack, I really should implement the makecstring */ char *getfilename(void) { integer t; t = get_current_name(); if (t > (1 << 21)) return makecstring(t); else return xstrdup(""); } ----------------------------------------------------------
Looks like we're always getting the xstrdup() branch of the conditional.
Hans, would you like me to submit this as a luatex bug?
taco reads this mail anyway so this suits as bug report Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------