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

Re: Patch to add the cbuffer command

Expand Messages
  • Mikolaj Machowski
    ... Thanks (not tested, alas - see above). ... I think it is too much (especially if patch would have to be much more sophisticated). Initially I thought
    Message 1 of 10 , Nov 1, 2004
    • 0 Attachment
      Dnia niedziela, 31 października 2004 23:23, Yegappan Lakshmanan napisał:
      > Hi,
      >
      > --- Mikolaj Machowski <mikmach@...> wrote:
      > > Dnia pi?tek, 29 pa?dziernika 2004 02:44, Yegappan Lakshmanan napisa?:
      > > > Hi all,
      > > >
      > > > The attached patch (aginst the 6.3 sources) implements the
      > > > ":cbuffer" command which feeds the contents of the current
      > > > buffer to quickfix. This will allow us to copy and paste or
      > > > read the output of any command into a Vim buffer and use
      > > > the Vim quickfix feature to browse the output.
      > > >
      > > > Without this command, you have to save the output of the command
      > > > to a file and use the ":cfile" or ":cgetfile" commands or the
      > > > "-q" Vim argument to use the output.
      > > >
      > > > If there is some interest in this command, I will add the
      > > > documentation.
      > >
      > > Didn't test (no 6.3 sources) but:
      > >
      > > I like the idea but it would be even more useful if you could use it
      > > with range, visual, etc. But maybe it is already possible? Or too much
      > > bloat?
      >
      > It is a small change to support ex ranges. The attached updated
      > patch accepts an ex range (with line numbers, marks, etc) for
      > the ":cbuffer" command.

      Thanks (not tested, alas - see above).

      > This command works only for the current buffer. Currently, it
      > is not possible to specify a buffer name or buffer number to
      > this command.
      >
      I think it is too much (especially if patch would have to be much more
      sophisticated). Initially I thought calling buffer by name/number would
      be cool, especially for scripts but that would be it - just kool-factor.
      For scripts it can be simulated by going to buffer and returning.

      Thanks again.

      m.

      --
      LaTeX + Vim = http://vim-latex.sourceforge.net/
      Vim-list(s) Users Map: (last change 6 Oct)
      http://skawina.eu.org/mikolaj/vimlist
      CLEWN - http://clewn.sf.net
    • 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 2 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 3 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 4 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 5 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.