From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/25844 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Identifying context files Date: Fri, 03 Feb 2006 21:47:57 +0100 Message-ID: <43E3C17D.2040800@wxs.nl> References: <9ABF20CA-1E6F-45ED-B523-B338876050D9@uni-bonn.de> <43E3110C.3030205@wxs.nl> 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 1138999986 30322 80.91.229.2 (3 Feb 2006 20:53:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 3 Feb 2006 20:53:06 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Feb 03 21:53:03 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 1F57vC-0006XV-1U for gctc-ntg-context-518@m.gmane.org; Fri, 03 Feb 2006 21:52:46 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C3AFE12797; Fri, 3 Feb 2006 21:52: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 06397-05; Fri, 3 Feb 2006 21:52:45 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 557EC12893; Fri, 3 Feb 2006 21:47:57 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id F21ED12893 for ; Fri, 3 Feb 2006 21:47:55 +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 06256-01-2 for ; Fri, 3 Feb 2006 21:47:54 +0100 (CET) Original-Received: from mail.pragma-ade.net (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with SMTP id C647912876 for ; Fri, 3 Feb 2006 21:47:53 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 4281 for ; Fri, 03 Feb 2006 16:00:49 +0300 User-Agent: Thunderbird 1.5 (Windows/20051201) Original-To: mailing list for ConTeXt users In-Reply-To: X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 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:25844 Archived-At: Aditya Mahajan wrote: >>> On Feb 3, 2006, at 3:17 AM, Aditya Mahajan wrote: >>> >>> >>>> 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). >>>> > > On Fri, 3 Feb 2006, Hans Hagen wrote: > >> checking does not take much time, for instance in scite, i check till i >> know; also (probably goes unnoticed), texexec does soem checking: it >> needs to figure out the interface: >> >> > > Can you send me the scite code which does the checking. I do not know lua, > but it should not be too hard to covnert it to VimL. I do not want to > reinvent the wheel. > her eis the ruby method used in newtexexec: def scantexcontent(filename) if FileTest.file?(filename) and tex = File.open(filename) then while str = tex.gets do case str.chomp when /^\%/o then # next when /\\(starttekst|stoptekst|startonderdeel|startdocument|startoverzicht)/o then setvariable('texformats','nl') ; break when /\\(stelle|verwende|umgebung|benutze)/o then setvariable('texformats','de') ; break when /\\(stel|gebruik|omgeving)/o then setvariable('texformats','nl') ; break when /\\(use|setup|environment)/o then setvariable('texformats','en') ; break when /\\(usa|imposta|ambiente)/o then setvariable('texformats','it') ; break when /(height|width|style)=/o then setvariable('texformats','en') ; break when /(hoehe|breite|schrift)=/o then setvariable('texformats','de') ; break when /(hoogte|breedte|letter)=/o then setvariable('texformats','nl') ; break when /(altezza|ampiezza|stile)=/o then setvariable('texformats','it') ; break when /externfiguur/o then setvariable('texformats','nl') ; break when /externalfigure/o then setvariable('texformats','en') ; break when /externeabbildung/o then setvariable('texformats','de') ; break when /figuraesterna/o then setvariable('texformats','it') ; break end end tex.close end end ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------