From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/25809 Path: news.gmane.org!not-for-mail From: "Thomas A. Schmitz" Newsgroups: gmane.comp.tex.context Subject: Re: Identifying context files Date: Fri, 3 Feb 2006 08:10:34 +0100 Message-ID: <9ABF20CA-1E6F-45ED-B523-B338876050D9@uni-bonn.de> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1138950712 7950 80.91.229.2 (3 Feb 2006 07:11:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 3 Feb 2006 07:11:52 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Feb 03 08:11:49 2006 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 ciao.gmane.org with esmtp (Exim 4.43) id 1F4v6i-00044N-0z for gctc-ntg-context-518@m.gmane.org; Fri, 03 Feb 2006 08:11:48 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A9D1112820; Fri, 3 Feb 2006 08:11:45 +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 23445-01; Fri, 3 Feb 2006 08:11:41 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 06BE41279A; Fri, 3 Feb 2006 08:11:41 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 964C01279A for ; Fri, 3 Feb 2006 08:11:39 +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 23405-02 for ; Fri, 3 Feb 2006 08:11:38 +0100 (CET) Original-Received: from mailout07.sul.t-online.com (mailout07.sul.t-online.com [194.25.134.83]) by ronja.ntg.nl (Postfix) with SMTP id 2AC561277F for ; Fri, 3 Feb 2006 08:11:37 +0100 (CET) Original-Received: from fwd35.aul.t-online.de by mailout07.sul.t-online.com with smtp id 1F4v6X-0001I4-06; Fri, 03 Feb 2006 08:11:37 +0100 Original-Received: from [192.168.0.2] (EYwYTaZF8enGSfI1JnajUCz5Swnp4AGpnqt6oBm-jFBUig3PkTlt4U@[84.172.105.85]) by fwd35.sul.t-online.de with esmtp id 1F4v6K-16vV4K0; Fri, 3 Feb 2006 08:11:24 +0100 In-Reply-To: Original-To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.746.2) X-ID: EYwYTaZF8enGSfI1JnajUCz5Swnp4AGpnqt6oBm-jFBUig3PkTlt4U@t-dialin.net X-TOI-MSGID: d0fae547-d7ef-43e2-b069-6ab3b91ae34a X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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:25809 Archived-At: That sounds like an excellent idea, and I'd be very grateful to have such a detector. As to keywords: most of my ConTeXt files start with \enableregime; you may want to add this to your list. Best Thomas On Feb 3, 2006, at 3:17 AM, Aditya Mahajan wrote: > I use (g)vim to edit both context and latex files. Unfortunately, both > of them usually have *.tex extension. This mean that detecting > filetype from extension is not possible, so one should look into the > contents of the file to see if it a context file or not. > > I am planning to submit a ftdetect for context to vim. Right now, I > check if the first six lines of the file contain any of > '\\start\|\\enablemode\|\\unprotect\|\\setvariables\|\\module\|\ > \usemodule' > and if so, set the filetype to context, otherwise it is set to tex > (that loads latex plugins). > > This works for my context writing style. I would like to know about > other people's preference. > > 1. Do you write some keyword unique to context in the first few lines > of the file. Should I also check the last few line lines. > > 2. Are there any other keywords that you will like to include. > > 3. Is it enough to check the first 6 line or should I check more. I do > not want to check more lines as this will make the detection slower > (by a few mili secs). > > Thanks, > Aditya > > -- > Aditya Mahajan, EECS Systems, University of Michigan > http://www.eecs.umich.edu/~adityam || Ph: 7342624008 > _______________________________________________ > ntg-context mailing list > ntg-context@ntg.nl > http://www.ntg.nl/mailman/listinfo/ntg-context