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?

Tad

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to