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
-----------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to