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

Re: Problem with BufRead and system()

Expand Messages
  • björn
    ... I can t reproduce. Does it perhaps depend on what files you are grep:ing? I tried on one file at a time, several files (:grep gui *.c), but it does not
    Message 1 of 5 , Feb 1, 2010
    • 0 Attachment
      On 1 February 2010 01:48, Israel Chauca Fuentes wrote:
      >
      > I recently tried to use the :grep command and found out that the current window (in a mac sense) froze. So I have tracked the origin and it is an autocmmand that calls system() on BufRead.
      >
      > I don't have problems with the default version of vim in my mac, with the one from Fink or when using the vim inside MacVim in the terminal, the problem only occurs in MacVim, I'm using snapshot 51.
      >
      > Starting with no config files or plug-ins, I reproduce it like this:
      >
      > 1. :au BufRead *.* echo system('date')
      > 2. :grep 'pattern' file
      >
      > Could somebody else confirm this?

      I can't reproduce. Does it perhaps depend on what files you are
      grep:ing? I tried on one file at a time, several files (:grep 'gui'
      *.c), but it does not freeze.

      Can anybody else reproduce this problem?

      Björn

      --
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Israel Chauca Fuentes
      ... I attached some files that I used to grep for macOS . When I try with multiple files (*.tcl), a swap file is created for end.tcl, but when I grep
      Message 2 of 5 , Feb 1, 2010
      • 0 Attachment
        On Feb 1, 2010, at 9:04 AM, björn wrote:
        >
        > On 1 February 2010 01:48, Israel Chauca Fuentes wrote:
        >>
        >> I recently tried to use the :grep command and found out that the current window (in a mac sense) froze. So I have tracked the origin and it is an autocmmand that calls system() on BufRead.
        >>
        >> I don't have problems with the default version of vim in my mac, with the one from Fink or when using the vim inside MacVim in the terminal, the problem only occurs in MacVim, I'm using snapshot 51.
        >>
        >> Starting with no config files or plug-ins, I reproduce it like this:
        >>
        >> 1. :au BufRead *.* echo system('date')
        >> 2. :grep 'pattern' file
        >>
        >> Could somebody else confirm this?
        >
        > I can't reproduce. Does it perhaps depend on what files you are
        > grep:ing? I tried on one file at a time, several files (:grep 'gui'
        > *.c), but it does not freeze.

        I attached some files that I used to grep for 'macOS'. When I try with multiple files (*.tcl), a swap file is created for end.tcl, but when I grep start.tcl only no swap file is created.

        --
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
      • björn
        ... I ve tried :grep macOS *.tcl and :grep macOS start.tcl (after issuing the :au command). Both finish more or less instantaneously without any
        Message 3 of 5 , Feb 4, 2010
        • 0 Attachment
          On 1 February 2010 19:17, Israel Chauca Fuentes wrote:
          >
          > I attached some files that I used to grep for 'macOS'. When I try with multiple files (*.tcl), a swap file is created for end.tcl, but when I grep start.tcl only no swap file is created.

          I've tried ":grep 'macOS' *.tcl" and ":grep 'macOS' start.tcl" (after
          issuing the :au command). Both finish more or less instantaneously
          without any problems. Could it be that you've installed some other
          grep program that causes this problem? (Mine is the one that came
          with OS X 10.6.2.)

          When the window "freezes" can you "unfreeze" it by pressing Ctrl-C?
          How about if you press Cmd-. (this sends SIGINT to the Vim process)?

          Have you tried using :vimgrep instead?

          Björn

          --
          You received this message from the "vim_mac" maillist.
          For more information, visit http://www.vim.org/maillist.php
        • Israel Chauca Fuentes
          ... Seems to be the original grep, grep --version reports GNU grep 2.5.1 , but the problem persists even if I set grepprg to use ack, which was the tool I
          Message 4 of 5 , Feb 5, 2010
          • 0 Attachment
            On Feb 4, 2010, at 3:30 PM, björn wrote:
            >
            > On 1 February 2010 19:17, Israel Chauca Fuentes wrote:
            >>
            >> I attached some files that I used to grep for 'macOS'. When I try with multiple files (*.tcl), a swap file is created for end.tcl, but when I grep start.tcl only no swap file is created.
            >
            > I've tried ":grep 'macOS' *.tcl" and ":grep 'macOS' start.tcl" (after
            > issuing the :au command). Both finish more or less instantaneously
            > without any problems.

            Did you set the autocommand calling system() before using :grep? I use:

            :au BufRead *.* echo system('date')

            > Could it be that you've installed some other
            > grep program that causes this problem? (Mine is the one that came
            > with OS X 10.6.2.)

            Seems to be the original grep, grep --version reports "GNU grep 2.5.1", but the problem persists even if I set grepprg to use ack, which was the tool I was using when this started.

            >
            > When the window "freezes" can you "unfreeze" it by pressing Ctrl-C?
            > How about if you press Cmd-. (this sends SIGINT to the Vim process)?

            Nope, I have to killall -9 Vim or force quit from the Activity Monitor.

            >
            > Have you tried using :vimgrep instead?

            Yes, there is no problem with that. Since this only happens on the GUI, I also tried changing the renderer but it doesn't change anything.

            Well, if nobody else can reproduce it, it might well be something on my system that's responsible for this. I'll have to wait until I make a fresh system install to test that.

            Israel

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