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

Re: bufexplorer has conflicts with python.vim

Expand Messages
  • Jürgen Krämer
    Hi, ... the b flag in cpoptions could be responsible for this. Regards, Jürgen -- Sometimes I think the surest sign that intelligent life exists elsewhere
    Message 1 of 12 , Sep 6, 2012
      Hi,

      Tony Mechelynck wrote:
      >
      > In the ftplugin/python.vim included in Bram's latest official sources
      > (ftplugin/python.vim "Last Change: Wed, 21 Apr 2004 13:13:08 CEST",
      > Mercurial tag v7-3-659 dated Wed Sep 05 19:17:42 2012 +0200), I see two
      > lines' discrepancy: the closest I come to what could trigger these
      > messages is at lines 23-26, as follows:
      >
      >> nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr>
      >> nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)')<cr>
      >> nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
      >> nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
      >
      > but in order to trigger those errors, the | immediately before
      > def\)')<cr> would have to be seen as following an ex-command, not as
      > part of a single-quoted string.

      the 'b' flag in 'cpoptions' could be responsible for this.

      Regards,
      Jürgen

      --
      Sometimes I think the surest sign that intelligent life exists elsewhere
      in the universe is that none of it has tried to contact us. (Calvin)

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Tony Mechelynck
      ... Well, it might, except that the Python plugin includes let s:keepcpo= &cpo set cpo&vim near the beginning, and let &cpo = s:keepcpo unlet s:keepcpo at the
      Message 2 of 12 , Sep 7, 2012
        On 07/09/12 07:28, Jürgen Krämer wrote:
        >
        > Hi,
        >
        > Tony Mechelynck wrote:
        >>
        >> In the ftplugin/python.vim included in Bram's latest official sources
        >> (ftplugin/python.vim "Last Change: Wed, 21 Apr 2004 13:13:08 CEST",
        >> Mercurial tag v7-3-659 dated Wed Sep 05 19:17:42 2012 +0200), I see two
        >> lines' discrepancy: the closest I come to what could trigger these
        >> messages is at lines 23-26, as follows:
        >>
        >>> nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr>
        >>> nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)')<cr>
        >>> nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
        >>> nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
        >>
        >> but in order to trigger those errors, the | immediately before
        >> def\)')<cr> would have to be seen as following an ex-command, not as
        >> part of a single-quoted string.
        >
        > the 'b' flag in 'cpoptions' could be responsible for this.
        >
        > Regards,
        > Jürgen
        >

        Well, it might, except that the Python plugin includes

        let s:keepcpo= &cpo
        set cpo&vim

        near the beginning, and

        let &cpo = s:keepcpo
        unlet s:keepcpo

        at the very end. This is intentional, to avoid settings changed
        elsewhere (e.g. in the vimrc) to cause malfunctions in this plugin; and
        many other plugins do the same.

        This could explain the two-line discrepancy: if someone (Tim? Björn?)
        deleted these lines, that's why the plugin is malfunctioning.


        Best regards,
        Tony.
        --
        Man is the only animal that can remain on friendly terms with the
        victims he intends to eat until he eats them.
        -- Samuel Butler

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Christian Brabandt
        ... Here, you have your 2 lines discrepancy. I have Vim 7.4.462 and the distributed ftplugin python.vim file does not include those 2 lines. This problem has
        Message 3 of 12 , Sep 7, 2012
          On Fri, September 7, 2012 09:56, Tony Mechelynck wrote:
          > On 07/09/12 07:28, Jürgen Krämer wrote:
          >> Tony Mechelynck wrote:
          >>>
          >>> In the ftplugin/python.vim included in Bram's latest official sources
          >>> (ftplugin/python.vim "Last Change: Wed, 21 Apr 2004 13:13:08 CEST",
          >>> Mercurial tag v7-3-659 dated Wed Sep 05 19:17:42 2012 +0200), I see two
          >>> lines' discrepancy: the closest I come to what could trigger these
          >>> messages is at lines 23-26, as follows:
          >>>
          >>>> nnoremap <silent> <buffer> ]] :call
          >>>> <SID>Python_jump('/^\(class\\|def\)')<cr>
          >>>> nnoremap <silent> <buffer> [[ :call
          >>>> <SID>Python_jump('?^\(class\\|def\)')<cr>
          >>>> nnoremap <silent> <buffer> ]m :call
          >>>> <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
          >>>> nnoremap <silent> <buffer> [m :call
          >>>> <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
          >>>
          >>> but in order to trigger those errors, the | immediately before
          >>> def\)')<cr> would have to be seen as following an ex-command, not as
          >>> part of a single-quoted string.
          >>
          >> the 'b' flag in 'cpoptions' could be responsible for this.
          >
          > Well, it might, except that the Python plugin includes
          >
          > let s:keepcpo= &cpo
          > set cpo&vim

          Here, you have your 2 lines discrepancy. I have Vim 7.4.462 and the
          distributed ftplugin\python.vim file does not include those 2 lines.
          This problem has recently been fixed in Revision d1e4abe8342c (see
          http://code.google.com/p/vim/source/detail?spec=svn1052677493beb941eab0d1e33d63c73ee4148350&r=d1e4abe8342c4adb1890bf1833a6f41f7a310b01)

          Since the OP has Vim 7.3.315, he probably does not have the latest
          distributed runtime files.

          So probably the missing b flag in 'cpoptions' could have cause this.


          regards,
          Christian

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Christian Brabandt
          ... Here, you have your 2 lines discrepancy. I have Vim 7.4.462 and the distributed ftplugin python.vim file does not include those 2 lines. This problem has
          Message 4 of 12 , Sep 7, 2012
            On Fri, September 7, 2012 09:56, Tony Mechelynck wrote:
            > On 07/09/12 07:28, Jürgen Krämer wrote:
            >> Tony Mechelynck wrote:
            >>>
            >>> In the ftplugin/python.vim included in Bram's latest official sources
            >>> (ftplugin/python.vim "Last Change: Wed, 21 Apr 2004 13:13:08 CEST",
            >>> Mercurial tag v7-3-659 dated Wed Sep 05 19:17:42 2012 +0200), I see two
            >>> lines' discrepancy: the closest I come to what could trigger these
            >>> messages is at lines 23-26, as follows:
            >>>
            >>>> nnoremap <silent> <buffer> ]] :call
            >>>> <SID>Python_jump('/^\(class\\|def\)')<cr>
            >>>> nnoremap <silent> <buffer> [[ :call
            >>>> <SID>Python_jump('?^\(class\\|def\)')<cr>
            >>>> nnoremap <silent> <buffer> ]m :call
            >>>> <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
            >>>> nnoremap <silent> <buffer> [m :call
            >>>> <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
            >>>
            >>> but in order to trigger those errors, the | immediately before
            >>> def\)')<cr> would have to be seen as following an ex-command, not as
            >>> part of a single-quoted string.
            >>
            >> the 'b' flag in 'cpoptions' could be responsible for this.
            >
            > Well, it might, except that the Python plugin includes
            >
            > let s:keepcpo= &cpo
            > set cpo&vim

            Here, you have your 2 lines discrepancy. I have Vim 7.4.462 and the
            distributed ftplugin\python.vim file does not include those 2 lines.
            This problem has recently been fixed in Revision d1e4abe8342c (see
            http://code.google.com/p/vim/source/detail?spec=svn1052677493beb941eab0d1e33d63c73ee4148350&r=d1e4abe8342c4adb1890bf1833a6f41f7a310b01)

            Since the OP has Vim 7.3.315, he probably does not have the latest
            distributed runtime files.

            So probably the missing b flag in 'cpoptions' could have cause this.


            regards,
            Christian

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Tim Johnson
            ... I think that approach is spot on. thanks -- Tim tim at tee jay forty nine dot com or akwebsoft dot com http://www.akwebsoft.com -- You received this
            Message 5 of 12 , Sep 7, 2012
              * Tony Mechelynck <antoine.mechelynck@...> [120906 17:25]:
              >
              > I have learnt to be wary of session files created by :mksession, they
              :) Great minds run in the same gutte ...
              > are usually unnecessarily bulky, duplicating stuff which is already in
              > the vimrc. I used :mkesssion in the past, but now I use a session file
              > I've written myself, just to load the files of my typical session into
              > their respective windows and tabs, and set local directories and keymaps
              > in some of them. My vimrc and plugins (~/.vim/... and $VIM/vimfiles/...,
              > plus of course the $VIMRUNTIME/... that come with Vim) do the rest. That
              > file is named ~/Session.vim too, the "only" difference with the output
              > of :mksession is that I wrote it myself, and it is much shorter.
              I think that approach is spot on.
              thanks
              --
              Tim
              tim at tee jay forty nine dot com or akwebsoft dot com
              http://www.akwebsoft.com

              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Tony Mechelynck
              ... Ach so… Yes indeed, those lines were added at that changeset (dated 30 Apr 2012, immediately before patch 7.3.511), but the Last Change at line 4
              Message 6 of 12 , Sep 8, 2012
                On 07/09/12 10:37, Christian Brabandt wrote:
                > On Fri, September 7, 2012 09:56, Tony Mechelynck wrote:
                >> On 07/09/12 07:28, Jürgen Krämer wrote:
                >>> Tony Mechelynck wrote:
                >>>>
                >>>> In the ftplugin/python.vim included in Bram's latest official sources
                >>>> (ftplugin/python.vim "Last Change: Wed, 21 Apr 2004 13:13:08 CEST",
                >>>> Mercurial tag v7-3-659 dated Wed Sep 05 19:17:42 2012 +0200), I see two
                >>>> lines' discrepancy: the closest I come to what could trigger these
                >>>> messages is at lines 23-26, as follows:
                >>>>
                >>>>> nnoremap <silent> <buffer> ]] :call
                >>>>> <SID>Python_jump('/^\(class\\|def\)')<cr>
                >>>>> nnoremap <silent> <buffer> [[ :call
                >>>>> <SID>Python_jump('?^\(class\\|def\)')<cr>
                >>>>> nnoremap <silent> <buffer> ]m :call
                >>>>> <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
                >>>>> nnoremap <silent> <buffer> [m :call
                >>>>> <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
                >>>>
                >>>> but in order to trigger those errors, the | immediately before
                >>>> def\)')<cr> would have to be seen as following an ex-command, not as
                >>>> part of a single-quoted string.
                >>>
                >>> the 'b' flag in 'cpoptions' could be responsible for this.
                >>
                >> Well, it might, except that the Python plugin includes
                >>
                >> let s:keepcpo= &cpo
                >> set cpo&vim
                >
                > Here, you have your 2 lines discrepancy. I have Vim 7.4.462 and the
                > distributed ftplugin\python.vim file does not include those 2 lines.
                > This problem has recently been fixed in Revision d1e4abe8342c (see
                > http://code.google.com/p/vim/source/detail?spec=svn1052677493beb941eab0d1e33d63c73ee4148350&r=d1e4abe8342c4adb1890bf1833a6f41f7a310b01)
                >
                > Since the OP has Vim 7.3.315, he probably does not have the latest
                > distributed runtime files.
                >
                > So probably the missing b flag in 'cpoptions' could have cause this.
                >
                >
                > regards,
                > Christian
                >

                Ach so… Yes indeed, those lines were added at that changeset (dated 30
                Apr 2012, immediately before patch 7.3.511), but the "Last Change" at
                line 4 wasn't changed, and still says "21 Apr 2004". I see that the
                commit message of that changeset says "Fixed compatible mode in most
                runtime files." so I suppose that's why the "last change" dates weren't
                updated, throwing me off-track when I thought that someone other than
                Bram had made the change.


                Best regards,
                Tony.
                --
                Support your local police force -- steal!!

                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              • Tim Johnson
                ... Well, I as the OP quit following this thread until now and am playing catchup. I have the following code at lines 21 to 24 in
                Message 7 of 12 , Sep 9, 2012
                  * Christian Brabandt <cblists@...> [120907 07:11]:
                  > On Fri, September 7, 2012 09:56, Tony Mechelynck wrote:
                  > > On 07/09/12 07:28, Jürgen Krämer wrote:
                  > >> Tony Mechelynck wrote:
                  > >>>
                  > >>> In the ftplugin/python.vim included in Bram's latest official sources
                  > >>> (ftplugin/python.vim "Last Change: Wed, 21 Apr 2004 13:13:08 CEST",
                  > >>> Mercurial tag v7-3-659 dated Wed Sep 05 19:17:42 2012 +0200), I see two
                  > >>> lines' discrepancy: the closest I come to what could trigger these
                  > >>> messages is at lines 23-26, as follows:
                  > >>>
                  > >>>> nnoremap <silent> <buffer> ]] :call
                  > >>>> <SID>Python_jump('/^\(class\\|def\)')<cr>
                  > >>>> nnoremap <silent> <buffer> [[ :call
                  > >>>> <SID>Python_jump('?^\(class\\|def\)')<cr>
                  > >>>> nnoremap <silent> <buffer> ]m :call
                  > >>>> <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
                  > >>>> nnoremap <silent> <buffer> [m :call
                  > >>>> <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
                  > >>>
                  > >>> but in order to trigger those errors, the | immediately before
                  > >>> def\)')<cr> would have to be seen as following an ex-command, not as
                  > >>> part of a single-quoted string.
                  > >>
                  > >> the 'b' flag in 'cpoptions' could be responsible for this.
                  > >
                  > > Well, it might, except that the Python plugin includes
                  > >
                  > > let s:keepcpo= &cpo
                  > > set cpo&vim
                  >
                  > Here, you have your 2 lines discrepancy. I have Vim 7.4.462 and the
                  > distributed ftplugin\python.vim file does not include those 2 lines.
                  > This problem has recently been fixed in Revision d1e4abe8342c (see
                  > http://code.google.com/p/vim/source/detail?spec=svn1052677493beb941eab0d1e33d63c73ee4148350&r=d1e4abe8342c4adb1890bf1833a6f41f7a310b01)
                  >
                  > Since the OP has Vim 7.3.315, he probably does not have the latest
                  > distributed runtime files.
                  >
                  > So probably the missing b flag in 'cpoptions' could have cause this.

                  Well, I as the OP quit following this thread until now and am
                  playing catchup.

                  I have the following code at lines 21 to 24 in

                  /Applications/MacVim-snapshot-62/MacVim.app/Contents/Resources/vim/runtime/ftplugin/python.vim

                  [code]
                  nnoremap <silent> <buffer> ]] :call
                  <SID>Python_jump('/^\(class\\|def\)')<cr>
                  nnoremap <silent> <buffer> [[ :call
                  <SID>Python_jump('?^\(class\\|def\)')<cr>
                  nnoremap <silent> <buffer> ]m :call
                  <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
                  nnoremap <silent> <buffer> [m :call
                  <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
                  [/code]
                  NOTE that my email editor (vim) as wrapped each line following
                  ":call"

                  This file __does not__ have the following lines :
                  let s:keepcpo= &cpo
                  set cpo&vim

                  cpoptions for my python buffers is
                  cpoptions=aABceFs

                  The macVim install does not yet provide version 7.4.462
                  (I miss ubuntu)

                  Anything I can do? Note also, that my problems went away when I
                  rebuilt the session file.

                  I remain interested in Tony's approach to "hand-rolling" a session
                  file.

                  thanks

                  --
                  Tim
                  tim at tee jay forty nine dot com or akwebsoft dot com
                  http://www.akwebsoft.com

                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php
                • Tony Mechelynck
                  On 10/09/12 04:14, Tim Johnson wrote: [...] ... Well, AFAICT the following alternatives are available: a) Make sure that there is no b flag in cpoptions b)
                  Message 8 of 12 , Sep 11, 2012
                    On 10/09/12 04:14, Tim Johnson wrote:
                    [...]
                    >
                    > Well, I as the OP quit following this thread until now and am
                    > playing catchup.
                    >
                    > I have the following code at lines 21 to 24 in
                    >
                    > /Applications/MacVim-snapshot-62/MacVim.app/Contents/Resources/vim/runtime/ftplugin/python.vim
                    >
                    > [code]
                    > nnoremap <silent> <buffer> ]] :call
                    > <SID>Python_jump('/^\(class\\|def\)')<cr>
                    > nnoremap <silent> <buffer> [[ :call
                    > <SID>Python_jump('?^\(class\\|def\)')<cr>
                    > nnoremap <silent> <buffer> ]m :call
                    > <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
                    > nnoremap <silent> <buffer> [m :call
                    > <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
                    > [/code]
                    > NOTE that my email editor (vim) as wrapped each line following
                    > ":call"
                    >
                    > This file __does not__ have the following lines :
                    > let s:keepcpo= &cpo
                    > set cpo&vim
                    >
                    > cpoptions for my python buffers is
                    > cpoptions=aABceFs
                    >
                    > The macVim install does not yet provide version 7.4.462
                    > (I miss ubuntu)
                    >
                    > Anything I can do? Note also, that my problems went away when I
                    > rebuilt the session file.
                    >
                    > I remain interested in Tony's approach to "hand-rolling" a session
                    > file.
                    >
                    > thanks
                    >
                    Well, AFAICT the following alternatives are available:

                    a) Make sure that there is no b flag in 'cpoptions'

                    b) Wait until Vim 7.3.511 or later becomes available to you. Check on
                    the vim_mac list if Björn has published a "MacVim snapshot" with a Vim
                    version equal or higher than 7.3.511. If worst comes to worst, find out
                    how to compile your own MacVim, and do it yourself, using Bram's latest
                    Vim sources (currently 7.3.659) and whatever additional Mac sources from
                    Björn are needed.

                    c) Add the following two two-lines files (untested):

                    -----8<--- $HOME/.vim/ftplugin/python.vim ---8<-----
                    let b:user_python_save_cpo = &cpo
                    set cpo&vim
                    ----->8----------->8------------>8----------->8-----

                    -----8<--- $HOME/.vim/after/ftplugin/python.vim ---8<-----
                    let &cpo = b:user_python_save_cpo
                    unlet b:user_python_save_cpo " optional
                    ----->8-------------->8-------------->8------------>8-----

                    If you choose alternative (c), edit a Python file (after restarting
                    Vim), then look at the output of the :scriptnames command and check
                    where your two new files are listed and what comes between them. What to
                    do next will depend on what you see there. In particular,
                    $VIMRUNTIME/ftplugin/python.vim should be present, and there should be
                    (if all went well) nothing that the change in 'cpoptions' setting would
                    disturb; but be sure to check.


                    Best regards,
                    Tony.
                    --
                    Windows
                    M!uqoms

                    --
                    You received this message from the "vim_use" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php
                  Your message has been successfully submitted and would be delivered to recipients shortly.