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

Re: Patch to add the cbuffer command

Expand Messages
  • Yegappan Lakshmanan
    Hi, ... As Vim parses and processes the output from grep or any other command to fill the quickfix window, the original output is lost (unless it is already
    Message 1 of 10 , Nov 2, 2004
    • 0 Attachment
      Hi,

      --- Madhu Raghupatruni <rmadhu@...> wrote:
      > Yegappan,
      >
      > The reverse is pretty useful too. You have a quickfix window that you
      > would want to save as file of errorlist, usually the result of a grep
      > output. I currently run it through a small script which converts it
      > back to an error list (grep output) and save it into a file. Do you
      > think there is a simpler way ?
      >

      As Vim parses and processes the output from grep or any other
      command to fill the quickfix window, the original output is
      lost (unless it is already stored in a file). So, reconstructing
      the original output from the quickfix window contents might be
      difficult.

      - Yegappan



      __________________________________
      Do you Yahoo!?
      Check out the new Yahoo! Front Page.
      www.yahoo.com
    • Keith Roberts
      ... Probably a silly idea, but maybe adding |tee {filename} to grepprg could be made to work? [or instead of {filename} it could be {bufname}, where said
      Message 2 of 10 , Nov 2, 2004
      • 0 Attachment
        >-----Original Message-----
        >From: Yegappan Lakshmanan [mailto:yegappan@...]
        >Sent: Tuesday, November 02, 2004 3:12 PM
        >To: Madhu Raghupatruni
        >Cc: vim-dev@...
        >Subject: Re: Patch to add the cbuffer command
        >
        >Hi,
        >
        >--- Madhu Raghupatruni <rmadhu@...> wrote:
        >> Yegappan,
        >>
        >> The reverse is pretty useful too. You have a quickfix
        >window that you
        >> would want to save as file of errorlist, usually the result
        >of a grep
        >> output. I currently run it through a small script which converts it
        >> back to an error list (grep output) and save it into a file. Do you
        >> think there is a simpler way ?
        >>
        >
        >As Vim parses and processes the output from grep or any other
        >command to fill the quickfix window, the original output is
        >lost (unless it is already stored in a file). So,
        >reconstructing the original output from the quickfix window
        >contents might be difficult.
        >
        >- Yegappan

        Probably a silly idea, but maybe adding \|tee {filename} to 'grepprg'
        could be made to work? [or instead of {filename} it could be {bufname},
        where said buffer is created as "nofile" or the like]

        Or maybe something associated with quickfix that performs a tee before
        (as) the data is transformed for the quickfix window?

        Given some known association, that could be used to "get back" to the
        original data.

        -Keith
      • Madhu Raghupatruni
        ... Too many files or buffers generated unnecessarily. Typically you do many greps and you really want to store a few of these searches for later use. ... How
        Message 3 of 10 , Nov 2, 2004
        • 0 Attachment
          * Keith Roberts <kroberts@...> [11/02/2004 15:35]:
          > >-----Original Message-----
          > >From: Yegappan Lakshmanan [mailto:yegappan@...]
          > >Sent: Tuesday, November 02, 2004 3:12 PM
          > >To: Madhu Raghupatruni
          > >Cc: vim-dev@...
          > >Subject: Re: Patch to add the cbuffer command
          > >
          > >Hi,
          > >
          > >--- Madhu Raghupatruni <rmadhu@...> wrote:
          > >> Yegappan,
          > >>
          > >> The reverse is pretty useful too. You have a quickfix
          > >window that you
          > >> would want to save as file of errorlist, usually the result
          > >of a grep
          > >> output. I currently run it through a small script which converts it
          > >> back to an error list (grep output) and save it into a file. Do you
          > >> think there is a simpler way ?
          > >>
          > >
          > >As Vim parses and processes the output from grep or any other
          > >command to fill the quickfix window, the original output is
          > >lost (unless it is already stored in a file). So,
          > >reconstructing the original output from the quickfix window
          > >contents might be difficult.
          > >
          > >- Yegappan
          >
          > Probably a silly idea, but maybe adding \|tee {filename} to 'grepprg'
          > could be made to work? [or instead of {filename} it could be {bufname},
          > where said buffer is created as "nofile" or the like]

          Too many files or buffers generated unnecessarily. Typically you do
          many greps and you really want to store a few of these searches for
          later use.

          >
          > Or maybe something associated with quickfix that performs a tee before
          > (as) the data is transformed for the quickfix window?
          >
          > Given some known association, that could be used to "get back" to the
          > original data.

          How about storing the errorformat or grepformat that generated the
          quickfix with the vim quickfix datastructures and regenerating the
          original error buffer ?

          >
          > -Keith
          >
        • Dave Silvia
          Unless you re married to the idea of using quickfix, try Vimgrep. It has various commands that allow capture of grep-ed output to named buffers. There are the
          Message 4 of 10 , Nov 2, 2004
          • 0 Attachment
            Unless you're married to the idea of using quickfix, try Vimgrep. It has
            various commands that allow capture of grep-ed output to named buffers.
            There are the bare bones commands and associated 'ToBuf' commands:

            Vimgrep VimgrepToBuf search for pattern in files
            VimgrepBufs VimgrepBufsToBuf search for pattern in open buffers
            Vimfind VimfindToBuf search for files

            And you don't need outside grep/find utilities. Everything is contained in
            Vim.

            See:

            http://www.vim.org/account/profile.php?user_id=5397 vimgrep.vim vsutil.vim

            FYI:

            MfG,
            Dave S.

            -----Original Message-----
            From: Keith Roberts [mailto:kroberts@...]
            Sent: Tuesday, November 02, 2004 5:37 PM
            To: Yegappan Lakshmanan; Madhu Raghupatruni
            Cc: vim-dev@...
            Subject: RE: Patch to add the cbuffer command

            >-----Original Message-----
            >From: Yegappan Lakshmanan [mailto:yegappan@...]
            >Sent: Tuesday, November 02, 2004 3:12 PM
            >To: Madhu Raghupatruni
            >Cc: vim-dev@...
            >Subject: Re: Patch to add the cbuffer command
            >
            >Hi,
            >
            >--- Madhu Raghupatruni <rmadhu@...> wrote:
            >> Yegappan,
            >>
            >> The reverse is pretty useful too. You have a quickfix
            >window that you
            >> would want to save as file of errorlist, usually the result
            >of a grep
            >> output. I currently run it through a small script which converts it
            >> back to an error list (grep output) and save it into a file. Do you
            >> think there is a simpler way ?
            >>
            >
            >As Vim parses and processes the output from grep or any other
            >command to fill the quickfix window, the original output is
            >lost (unless it is already stored in a file). So,
            >reconstructing the original output from the quickfix window
            >contents might be difficult.
            >
            >- Yegappan

            Probably a silly idea, but maybe adding \|tee {filename} to 'grepprg'
            could be made to work? [or instead of {filename} it could be {bufname},
            where said buffer is created as "nofile" or the like]

            Or maybe something associated with quickfix that performs a tee before
            (as) the data is transformed for the quickfix window?

            Given some known association, that could be used to "get back" to the
            original data.

            -Keith
          Your message has been successfully submitted and would be delivered to recipients shortly.