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

Re: Any limitation of autocmd when the bufdo is processing ?

Expand Messages
  • winterTTr
    ... Anyone can give some idea ? :-) ... -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are
    Message 1 of 2 , Feb 28, 2010
    • 0 Attachment
      On Fri, Feb 26, 2010 at 3:41 PM, winterTTr <winterTTr.vim@gmail.com> wrote:
      Actually, i meet a problem like below.
      I tried to update a specific "unlisted" buffer every time the BufEnter event happens.

      the Code like below( just an example, not the real code ):
      I am trying to use the "set eventignore+=BufEnter" and "set eventignore-=BufEnter" to prevent the
      process from running recursively.

      function! TestFunc()
          set eventignore+=BufEnter

          let bufname = bufname("%")
          " move to specific window
          2wincmd w
          " update buffer
          call append( 0 , bufname )
          " move back
          1wincmd w

          set eventignore-=BufEnter

      autocmd BufEnter * call TestFunc()

      Everything is OK until i do the bufdo command. such as "bufdo s/^/1/"
      "E474: Invalid argument: eventignore+=BufEnter" message is shown.

      I can NOT find any information in the documentation showing any limitation during the bufdo command.
      And I hope anyone could give the answer to the following question:
      1. Is there a limitation that you can NOT set the variable "eventignore" during the bufdo process?
      2. If so, is the "eventignore" the only one or are there any other variable that have the same limitation?
      3. Someone told me that the ""set eventignore+=BufEnter" is unnecessary, cause the "bufdo" itself would
          prevent the recursive running ? Is this the truth ?

      Anyone can give some idea ? :-)

      If you really want to reproduce the error, i attach the file to do this. Please follow the next step:
      1. source the test.vim
      2. run a bufdo command, such as ""bufdo s/^/1/"
      And , the error would be shown.

      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.