Re: [NTG-context] How to Determine the Current File Name and Line Number in the ConTeXt Source?

2009-07-08 Thread Tad Ashlock
Taco Hoekwater wrote: Tad Ashlock wrote: Looks like we're always getting the xstrdup() branch of the conditional. Probably because you are not reading from a file at that level, but from a token list. Do you want filename to be a file even if the current input is not directly from a file at

Re: [NTG-context] How to Determine the Current File Name and Line Number in the ConTeXt Source?

2009-07-08 Thread Taco Hoekwater
Tad Ashlock wrote: Now you say that ConTeXt may not be reading from a file at that level. That I can accept (being a non-expert), but status.linenumber always returns the correct line number for the ConTeXt file being processed (even if the file is being \input from another file). It

Re: [NTG-context] How to Determine the Current File Name and Line Number in the ConTeXt Source?

2009-07-06 Thread Taco Hoekwater
Tad Ashlock wrote: Looks like we're always getting the xstrdup() branch of the conditional. Probably because you are not reading from a file at that level, but from a token list. Do you want filename to be a file even if the current input is not directly from a file at all (doable, but less

Re: [NTG-context] How to Determine the Current File Name and Line Number in the ConTeXt Source?

2009-07-03 Thread Tad Ashlock
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:

Re: [NTG-context] How to Determine the Current File Name and Line Number in the ConTeXt Source?

2009-07-03 Thread Hans Hagen
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

[NTG-context] How to Determine the Current File Name and Line Number in the ConTeXt Source?

2009-07-01 Thread Tad Ashlock
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? For example: (test.tex) - \def\ShowLineNumber{% \ctxlua{print('current line number:', tex.current_line_number())

Re: [NTG-context] How to Determine the Current File Name and Line Number in the ConTeXt Source?

2009-07-01 Thread Hans Hagen
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? For example: (test.tex) - \def\ShowLineNumber{% \ctxlua{print('current line number:',