Loading ...
Sorry, an error occurred while loading the content.
 

Re: Latex-suite command completion

Expand Messages
  • A.Politz
    I have no win32, so I can only guess... ... This is the output of clist . I don t know if vim sometimes uses bufnr instead of filenames ,in which case the
    Message 1 of 19 , Nov 1, 2007
      I have no win32, so I can only guess...

      Szabolcs wrote:

      >I turned on logging as you suggested in a previous message in this
      >thread. These are the contents of the log file. The lines beginning
      >with % describe what I did at that point.
      >
      >% :let g:Imap_Debug=1
      >% :let g:Tex_Debug=1
      >% :let g:Tex_DebugLog='tdbg.log'
      >% :e tst.tex
      >
      >...
      >% \ll
      >
      >...
      >comp : Tex_CompileMultipleTimes: errors = [
      > 2:6 error: Undefined control sequence. \su error $\su $]
      >
      >
      >
      This is the output of 'clist' . I don't know if vim sometimes
      uses 'bufnr' instead of 'filenames',in which case the '2' in '2:6'
      could point to bufnr 2.
      In case it is not the bufnr, it would appear that the
      'errformat' option wrongly parses the output of miktex.
      You can verify that by trying a
      :make %
      in the tst.tex window. Or verifying, that the number is
      _not_ always the number of the buffer.

      -ap

      --
      Ich hab geträumt, der Krieg wär vorbei.


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Szabolcs
      ... What does bufnr mean exactly (I know very little about this)? The command :echo bufnr( % ) returns 1 for the window with tst.tex, 2 for the quickfix
      Message 2 of 19 , Nov 1, 2007
        On Nov 1, 11:12 pm, "A.Politz" <poli...@...> wrote:
        > I have no win32, so I can only guess...
        >
        >
        >
        > Szabolcs wrote:
        > >I turned on logging as you suggested in a previous message in this
        > >thread. These are the contents of the log file. The lines beginning
        > >with % describe what I did at that point.
        >
        > >% :let g:Imap_Debug=1
        > >% :let g:Tex_Debug=1
        > >% :let g:Tex_DebugLog='tdbg.log'
        > >% :e tst.tex
        >
        > >...
        > >% \ll
        >
        > >...
        > >comp : Tex_CompileMultipleTimes: errors = [
        > > 2:6 error: Undefined control sequence. \su error $\su $]
        >
        > This is the output of 'clist' . I don't know if vim sometimes
        > uses 'bufnr' instead of 'filenames',in which case the '2' in '2:6'
        > could point to bufnr 2.
        > In case it is not the bufnr, it would appear that the
        > 'errformat' option wrongly parses the output of miktex.
        > You can verify that by trying a
        > :make %
        > in the tst.tex window. Or verifying, that the number is
        > _not_ always the number of the buffer.

        What does bufnr mean exactly (I know very little about this)? The
        command :echo bufnr("%") returns 1 for the window with tst.tex, 2 for
        the quickfix window and 3 for the preview window (when visible after
        an <Up>).

        I tried moving tst.log from a linux computer (where this was working)
        to windows, and doing :cfile tst.log and :cwindow, but it does not
        work (the filename is missing from the error line). When I try the
        reverse, i.e. moving the windows tst.log to linux, it doesn't work
        either (the line endings were changes during transfer). There are
        only minor differences between the two files, like paths and version
        numbers, so I don't know what is happening.

        How exactly does Vim decide where to look for the file where with the
        errors? Does it take the file name from tst.log?


        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Szabolcs Horvát
        I attached the two tst.log files. They are nearly identical. --~--~---------~--~----~------------~-------~--~----~ You received this message from the
        Message 3 of 19 , Nov 1, 2007
          I attached the two tst.log files. They are nearly identical.

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Szabolcs
          Sorry for the spamming ... just one more question: What does that ... line mean in the quickfix window? This is the first line in the qf window when things
          Message 4 of 19 , Nov 1, 2007
            Sorry for the spamming ... just one more question:

            What does that
            || (tst.aux)
            line mean in the quickfix window?

            This is the first line in the qf window when things *are* working
            correctly, both on win and linux. (Without \usepackage{inputenc}
            everything is OK on windows). When it is not working correctly, I see
            the following line instead (after pressing <Up>):

            || (c:\texmf\tex\latex\base\inputenc.sty

            Does this mean that "(tst.aux)" is what tells Vim which file contains
            the errors, and that it is misparsing the output of MiKTeX?


            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • A.Politz
            ... I have little experience with writing errorformats , but I am fairly shure, that it is the problem. errorformat contains a list of pattern, which are
            Message 5 of 19 , Nov 2, 2007
              Szabolcs wrote:

              >Sorry for the spamming ... just one more question:
              >
              >What does that
              >|| (tst.aux)
              >line mean in the quickfix window?
              >
              >This is the first line in the qf window when things *are* working
              >correctly, both on win and linux. (Without \usepackage{inputenc}
              >everything is OK on windows). When it is not working correctly, I see
              >the following line instead (after pressing <Up>):
              >
              >|| (c:\texmf\tex\latex\base\inputenc.sty
              >
              >Does this mean that "(tst.aux)" is what tells Vim which file contains
              >the errors, and that it is misparsing the output of MiKTeX?
              >
              >
              >>
              >
              >
              I have little experience with writing 'errorformats',
              but I am fairly shure, that it is the problem.
              'errorformat' contains a list of pattern, which
              are matched against the compiler output.
              This doesn't seem to work in every case.
              If you look at the differences in your files, you
              notice that the braces differ. Braces are used in the
              errorformat to help recognizing filenames.

              The lines you are referring to are simply matches
              against one of the errorformats as text.In other
              words 'it' is configured (via errorformat)
              to display this filename, no other meaning implied.

              Maybe the plugin, the way it configured errorformat,
              believes that the error is in file 'inputenc.sty',
              but vim can't open it for some reason.

              tst.log contains the errros, which latex-suite uses.

              -ap


              --
              Ich hab geträumt, der Krieg wär vorbei.


              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Robert Cussons
              ... Sorry, been away on holiday for a few days and it seems somebody (Szabolcs) has been borrowing my thread, please don t do this as it confuses everybody as
              Message 6 of 19 , Nov 5, 2007
                A.Politz wrote:
                > Robert Cussons wrote:
                >
                >> Manu Hack wrote:
                >>
                >>
                >>> On 10/12/07, Robert Cussons <r.cussons@...> wrote:
                >>>
                >>>
                >>>> Hi, I've been using some of latex-suite's command completion capability,
                >>>> which is wonderful, so for example, if I type:
                >>>>
                >>>> (
                >>>>
                >>>> then hit:
                >>>>
                >>>> <Alt> L
                >>>>
                >>>> I get:
                >>>>
                >>>> \left(\right)<++>
                >>>>
                >>>> I then want to enter a fraction in side the brackets so I type:
                >>>>
                >>>> \left(frac\right)<++>
                >>>>
                >>>> then hit <F7> with the cursor after the 'c' of frac, normally, this
                >>>> would expand to:
                >>>>
                >>>> \left(\frac{<+n+>}{<+d+>}<++>\right)<++>
                >>>>
                >>>> with the <+n+> highlighted, however in the above case all I get is:
                >>>>
                >>>> \left(frac0\right)<++>
                >>>>
                >>>> can others reproduce this?
                >>>>
                >>>> Many thanks,
                >>>> Rob.
                >>>>
                >>>> P.S. all the above is performed inside the equation environment,
                >>>> achieved by entering EEQ in insert mode :-)
                >>>>
                >>>>
                >>>>
                >>> I can't reproduce your bug under my machine (vim 7.1 on debian).
                >>>
                >>>
                >> I am using
                >> :version
                >> VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct 13 2007 13:28:30)
                >> Included patches: 1-138
                >>
                >> just updated now, under Debian Etch. Problem still exists.
                >>
                >>
                >>
                >>> And I think you don't have to use ALT L to get \left(\right)<++>, just
                >>> type (( it will expand to that. Also for frac + F7 you may use `/.
                >>>
                >>>
                >>
                >> Thanks, these are very useful tips, even faster now ;-). In fact they
                >> even work inside brackets which for some reason the F7 method doesn't,
                >> however there are other functions like sum that I still need the F7
                >> method for and they just produce a zero as explained above when
                >> performed inside brackets, anyone any idea how I can track down the
                >> problem?
                >> Thanks
                >> Rob.
                >>
                >>
                >>
                > Do this :
                >
                >
                > let g:Imap_Debug=1
                > let g:Tex_Debug=1
                > let g:Tex_DebugLog='/tmp/tex.log' " or any other nonexistant file
                >
                > :e newfile.tex
                > <Enter insertmode and type :>
                > frac<f7>
                >
                > Then post the content of the logfile.
                >
                > -ap
                >
                >

                Sorry, been away on holiday for a few days and it seems somebody
                (Szabolcs) has been borrowing my thread, please don't do this as it
                confuses everybody as to the exact subject of the thread, I know it was
                related to start with but it definitely wasn't by the end.

                Anyway, back to the problem at hand, when it works, the log file
                contains this:


                proj : texproject.vim: catching LatexSuiteFileType event
                env : envmacros.vim: Catching LatexSuiteFileType event
                comp : compiler.vim: Catching LatexSuiteFileType event
                fold : folding.vim: catching LatexSuiteFileType
                brak : brackets.vim: Catching LatexSuiteFileType event
                view : texviewer.vim: Catching LatexSuiteFileType event
                main : main.vim: Catching LatexSuiteFileType event
                main : SetTeXOptions: sourcing maps
                comp : +Tex_SetTeXCompilerTarget: setting target to [ps] for Compiler
                comp : +Tex_SetTeXCompilerTarget: setting target to [ps] for Viewr
                comp : compiler/tex.vim: sourcing this file
                pack : packages.vim: Catching LatexSuiteFileType event
                pack : +Tex_pack_updateall
                pack : :Tex_pack_updateall: split
                pack : +Tex_ScanForPackages
                pack : :Tex_ScanForPackages: Begining scans in [newfile.tex], beginline = 0
                pack : :Tex_ScanForPackages: beginning scan for \usepackage lines
                pack : :Tex_ScanForPackages: End scan \usepackage, detected packages =
                pack : :Tex_ScanForPackages: Beginning scan for \newcommand's
                pack : :Tex_ScanForPackages: Beginning scan for \newenvironment's
                pack : -Tex_ScanForPackages
                pack : :Tex_pack_updateall: detected [] in first run
                pack : :Tex_pack_updateall: throwing LatexSuiteScannedPackages event
                pack : -Tex_pack_updateall
                env : Tex_DoCommand: getting lastword = frac
                imap : IMAP_PutTextWithMovement: text = [\frac{X^\^N:call
                IMAP_Mark('set') "_s<+n+>}{<+d+>}<++>^\^N:call IMAP_Mark('go')
                i^R=IMAP_Jumpfunc('', 1) ]

                if I go through the exact same process, but rather than just typing frac
                in newfile.tex, I type:

                EEQ

                that puts me in the equation environment, then I type:

                ((

                that puts me between a pair of brackets, then I type:

                frac<f7>

                my output in vim is:

                \begin{equation}
                \left( frac0 \right)<++>
                \label{<++>}
                \end{equation}<++>

                and /tmp/tex.log reads:

                proj : texproject.vim: catching LatexSuiteFileType event
                env : envmacros.vim: Catching LatexSuiteFileType event
                comp : compiler.vim: Catching LatexSuiteFileType event
                fold : folding.vim: catching LatexSuiteFileType
                brak : brackets.vim: Catching LatexSuiteFileType event
                view : texviewer.vim: Catching LatexSuiteFileType event
                main : main.vim: Catching LatexSuiteFileType event
                main : SetTeXOptions: sourcing maps
                comp : +Tex_SetTeXCompilerTarget: setting target to [ps] for Compiler
                comp : +Tex_SetTeXCompilerTarget: setting target to [ps] for Viewr
                comp : compiler/tex.vim: sourcing this file
                pack : packages.vim: Catching LatexSuiteFileType event
                pack : +Tex_pack_updateall
                pack : :Tex_pack_updateall: split
                pack : +Tex_ScanForPackages
                pack : :Tex_ScanForPackages: Begining scans in [newfile.tex], beginline = 0
                pack : :Tex_ScanForPackages: beginning scan for \usepackage lines
                pack : :Tex_ScanForPackages: End scan \usepackage, detected packages =
                pack : :Tex_ScanForPackages: Beginning scan for \newcommand's
                pack : :Tex_ScanForPackages: Beginning scan for \newenvironment's
                pack : -Tex_ScanForPackages
                pack : :Tex_pack_updateall: detected [] in first run
                pack : :Tex_pack_updateall: throwing LatexSuiteScannedPackages event
                pack : -Tex_pack_updateall
                imap : Not getting <+ and +> in ^R=Tex_PutEnvironment('equation')
                imap : IMAP_PutTextWithMovement: text = [\begin{equation} X^\^N:call
                IMAP_Mark('set') "_s<++> \label{<++>} \end{equation}<++>^\^N:call
                IMAP_Mark('go') i^R=IMAP_Jumpfunc('', 1) ]
                imap : IMAP_PutTextWithMovement: text = [\left( X^\^N:call
                IMAP_Mark('set') "_s<++> \right)<++>^\^N:call IMAP_Mark('go')
                i^R=IMAP_Jumpfunc('', 1) ]
                env : Tex_DoCommand: getting lastword =


                any ideas?

                Many thanks,
                Rob.

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              Your message has been successfully submitted and would be delivered to recipients shortly.