From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Identifying context files
Date: Fri, 03 Feb 2006 21:47:57 +0100 [thread overview]
Message-ID: <43E3C17D.2040800@wxs.nl> (raw)
In-Reply-To: <Pine.GSO.4.63.0602031219340.24140@rrpf4327h09.ratva.hzvpu.rqh>
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
-----------------------------------------------------------------
next prev parent reply other threads:[~2006-02-03 20:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-03 2:17 Aditya Mahajan
2006-02-03 7:10 ` Thomas A. Schmitz
2006-02-03 8:15 ` Hans Hagen
2006-02-03 8:22 ` Taco Hoekwater
2006-02-03 9:24 ` Hans Hagen
2006-02-03 17:22 ` Aditya Mahajan
2006-02-03 20:47 ` Hans Hagen [this message]
2006-02-04 23:41 ` Mojca Miklavec
2006-02-11 4:59 ` Aditya Mahajan
2006-02-11 7:05 ` Aditya Mahajan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43E3C17D.2040800@wxs.nl \
--to=pragma@wxs.nl \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).