From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/51663 Path: news.gmane.org!not-for-mail From: "Tad Ashlock" Newsgroups: gmane.comp.tex.context Subject: Re: How to Determine the Current File Name and Line Number in the ConTeXt Source? Date: Tue, 7 Jul 2009 12:09:18 -0600 Organization: Sandia National Laboratories Message-ID: <4A538F4E.1070600@sandia.gov> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1247036260 29993 80.91.229.12 (8 Jul 2009 06:57:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Jul 2009 06:57:40 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Wed Jul 08 08:57:33 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1MOR5u-0004p5-Rs for gctc-ntg-context-518@m.gmane.org; Wed, 08 Jul 2009 08:57:30 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0D7051FB60; Wed, 8 Jul 2009 08:57:30 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 22362-05; Wed, 8 Jul 2009 08:56:40 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 753E01FADB; Wed, 8 Jul 2009 08:56:40 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3EB711FADC for ; Tue, 7 Jul 2009 20:09:47 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13340-07-2 for ; Tue, 7 Jul 2009 20:09:35 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by ronja.ntg.nl (Postfix) with ESMTP id DD0BE1FADB for ; Tue, 7 Jul 2009 20:09:35 +0200 (CEST) Original-Received: from sentry-three.sandia.gov (sentry-three.sandia.gov [132.175.109.17]) by filter2-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n67I9YFf026112 for ; Tue, 7 Jul 2009 20:09:35 +0200 X-WSS-ID: 0KMFBS1-08-85Q-02 X-M-MSG: Original-Received: from sentry.sandia.gov (sentry.sandia.gov [132.175.109.21]) by sentry-three.sandia.gov (Tumbleweed MailGate 3.6.1) with ESMTP id 2B1298BC5B4 for ; Tue, 7 Jul 2009 12:09:36 -0600 (MDT) Original-Received: from [132.175.109.1] by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.2)); Tue, 07 Jul 2009 12:09:25 -0600 X-Server-Uuid: AF72F651-81B1-4134-BA8C-A8E1A4E620FF Original-Received: from mail.sandia.gov (cas2.sandia.gov [134.253.165.160]) by mailgate.sandia.gov (8.14.1/8.14.1) with ESMTP id n67I9M5A004810 for ; Tue, 7 Jul 2009 12:09:25 -0600 Original-Received: from [127.0.0.1] (134.253.178.133) by smtps.sandia.gov ( 134.253.165.15) with Microsoft SMTP Server (TLS) id 8.1.375.2; Tue, 7 Jul 2009 12:09:24 -0600 User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) X-TMWD-Spam-Summary: TS=20090707180927; ID=1; SEV=2.3.1; DFV=B2009070714; IFV=NA; AIF=B2009070714; RPD=5.03.0010; ENG=NA; RPDID=7374723D303030312E30413031303230382E34413533384635362E303145393A534346535441543838363133332C73733D312C6667733D30; CAT=NONE; CON=NONE; SIG=AAAAAAAAAAAAAAAAAAAAAAAAfQ== X-MMS-Spam-Filter-ID: B2009070714_5.03.0010 X-WSS-ID: 664D50DF3PG598575-01-01 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=132.175.109.17; country=US; region=NM; city=Albuquerque; postalcode=87185; latitude=35.1025; longitude=-106.6117; metrocode=790; areacode=505; http://maps.google.com/maps?q=35.1025,-106.6117&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 257163530 - 74e190e13d6d - 20090707 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-Virus-Scanned: amavisd-new at ntg.nl X-Mailman-Approved-At: Wed, 08 Jul 2009 08:56:38 +0200 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:51663 Archived-At: 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 all > (doable, but less meaningful)? > > Best wishes, > Taco Hi Taco, I'm far from an expert in this realm, but since you asked what *I* want... :) My intention is to associate status.filename and status.linenumber together. That is, I would read and save their values consecutively in the same Lua function so that they would refer to the ConTeXt source line currently being processed by the ConTeXt engine. 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 seems to me that if the line number within the source file is accurate, then the file's name should be accurate, too. Thank you, 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 ___________________________________________________________________________________