From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/33591 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: ctags and ConTeXt Date: Tue, 27 Feb 2007 10:19:01 -0500 (EST) Message-ID: References: <45E3F1BA.1000904@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1172589571 10599 80.91.229.12 (27 Feb 2007 15:19:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Feb 2007 15:19:31 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Feb 27 16:19:24 2007 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 1HM46s-0003hY-Ox for gctc-ntg-context-518@m.gmane.org; Tue, 27 Feb 2007 16:19:22 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C182F20009; Tue, 27 Feb 2007 16:15:54 +0100 (CET) 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 09375-03; Tue, 27 Feb 2007 16:15:46 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D69611FFF0; Tue, 27 Feb 2007 16:15:45 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C92611FFF4 for ; Tue, 27 Feb 2007 16:15:43 +0100 (CET) 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 09336-06-3 for ; Tue, 27 Feb 2007 16:15:38 +0100 (CET) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by ronja.ntg.nl (Postfix) with ESMTP id 92F631FFEB for ; Tue, 27 Feb 2007 16:15:38 +0100 (CET) Original-Received: FROM aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) BY hackers.mr.itd.umich.edu ID 45E44BE7.8B4D9.2021 ; 27 Feb 2007 10:19:03 -0500 In-Reply-To: <45E3F1BA.1000904@wxs.nl> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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:33591 Archived-At: On Tue, 27 Feb 2007, Hans Hagen wrote: > Aditya Mahajan wrote: >> Hi >> >> Here is my first attempt (see attachment). It works correctly in the >> little testing that I have done (on Windows). Just add >> \usemodule[ctags] somewhere in your environment file, and run context. >> I file called context.tags will be generated which contains the >> labels, filename, and line-number where the label occurs (line number >> can sometimes be off). >> >> I modify a few core macros, so this can possibly break existing stuff >> (It should not, but then ...) > i didn't look at the code yet, but maybe a hook is a safer way? The redefinition is safe. I put the warning since the user must be aware that a module redefines a core macro. There are two redefinitions, one for knowing the name of the current file, and the other for writings the reference to the tags file. For knowing the name of the current file, I would say that the core should support it. From what I understand, \inputfilename (or \currentfile) should give the name of the current file, but they do not. So, I had to modify registerfileinfo so that it provides with the name of the current file. To write the reference into the tag file, I need to know the reference. That is why I had to modify writereference. One hook that I can think of is to provide an \everywritereference token. \def\writereference#1#2#3#4 {\def\currentreferece{#1} \the\everywritereference % Rest of the writereference code} Then, modules like ctags will be able to hook into everywritereference. Aditya