From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/25807 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Identifying context files Date: Thu, 2 Feb 2006 21:17:51 -0500 (EST) Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1138933097 15224 80.91.229.2 (3 Feb 2006 02:18:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 3 Feb 2006 02:18:17 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Feb 03 03:18:15 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 1F4qWU-0005AO-Pm for gctc-ntg-context-518@m.gmane.org; Fri, 03 Feb 2006 03:18:06 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 05CE312835; Fri, 3 Feb 2006 03:18:06 +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 21295-07-4; Fri, 3 Feb 2006 03:18:02 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BE6D51282E; Fri, 3 Feb 2006 03:18:01 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B37091282E for ; Fri, 3 Feb 2006 03:18:00 +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 21295-07-3 for ; Fri, 3 Feb 2006 03:17:59 +0100 (CET) Original-Received: from withoutevidence.mr.itd.umich.edu (withoutevidence.mr.itd.umich.edu [141.211.93.147]) by ronja.ntg.nl (Postfix) with SMTP id 219BE12820 for ; Fri, 3 Feb 2006 03:17:58 +0100 (CET) Original-Received: from aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) by withoutevidence.mr.itd.umich.edu (smtp) with ESMTP id k132HqHg019406 for ; Thu, 2 Feb 2006 21:17:57 -0500 Original-To: mailing list for ConTeXt users 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:25807 Archived-At: 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