From: Tad Ashlock <taashlo@cyberdude.com>
To: ntg-context@ntg.nl
Subject: Re: How to Determine the Current File Name and Line Number in the ConTeXt Source?
Date: Fri, 03 Jul 2009 08:22:08 -0600 [thread overview]
Message-ID: <4A4E1410.9050408@cyberdude.com> (raw)
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
___________________________________________________________________________________
next reply other threads:[~2009-07-03 14:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-03 14:22 Tad Ashlock [this message]
2009-07-03 15:23 ` Hans Hagen
2009-07-06 12:52 ` Taco Hoekwater
-- strict thread matches above, loose matches on Subject: below --
2009-07-07 18:09 Tad Ashlock
2009-07-08 8:27 ` Taco Hoekwater
2009-07-01 11:01 Tad Ashlock
2009-07-01 14:26 ` Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A4E1410.9050408@cyberdude.com \
--to=taashlo@cyberdude.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).