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

[patch] make glob return a list

Expand Messages
  • Christian Brabandt
    Bram, this time, no fix from the todo list ;) As discussed recently in this thread¹ on vim_use, you can t access files whose name contains newlines (which is
    Message 1 of 4 , Aug 24, 2011
    • 0 Attachment
      Bram,
      this time, no fix from the todo list ;)

      As discussed recently in this thread¹ on vim_use, you can't access files
      whose name contains newlines (which is ugly but allowed by POSIX). So I
      made a small patch, to have glob() return all matches in a list. This
      way, filenames containing newlines shouldn't make a problem anymore.


      ¹)http://groups.google.com/group/vim_use/browse_frm/thread/1a404bd561cae811

      Mit freundlichen Grüßen
      Christian
      --
      Wechselstaben verbuchtelt?

      --
      You received this message from the "vim_dev" 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
    • ZyX
      Reply to message «[patch] make glob return a list», sent 20:45:57 24 August 2011, Wednesday by Christian Brabandt: I guess you need the same for expand() (it
      Message 2 of 4 , Aug 24, 2011
      • 0 Attachment
        Reply to message «[patch] make glob return a list»,
        sent 20:45:57 24 August 2011, Wednesday
        by Christian Brabandt:

        I guess you need the same for expand() (it may be less trivial due to
        expand('`=["abc", "def"]`') and expand('`find ...`') with NL=next file). About
        the advantage: I have actually never seen glob() without surrounding split().
        Not having to type this split() is better advantage then NL-in-filenames
        handling.

        Original message:
        > Bram,
        > this time, no fix from the todo list ;)
        >
        > As discussed recently in this thread¹ on vim_use, you can't access files
        > whose name contains newlines (which is ugly but allowed by POSIX). So I
        > made a small patch, to have glob() return all matches in a list. This
        > way, filenames containing newlines shouldn't make a problem anymore.
        >
        >
        > ¹)http://groups.google.com/group/vim_use/browse_frm/thread/1a404bd561cae811
        >
        > Mit freundlichen Grüßen
        > Christian
      • Christian Brabandt
        Hi ZyX! ... Here is an updated patch. Possibly, we would also need this for globpath(), but I haven t looked at it yet. regards, Christian -- Wir neigen dazu,
        Message 3 of 4 , Aug 24, 2011
        • 0 Attachment
          Hi ZyX!

          On Mi, 24 Aug 2011, ZyX wrote:

          > I guess you need the same for expand() (it may be less trivial due to
          > expand('`=["abc", "def"]`') and expand('`find ...`') with NL=next file).
          > About the advantage: I have actually never seen glob() without
          > surrounding split(). Not having to type this split() is better
          > advantage then NL-in-filenames handling.

          Here is an updated patch. Possibly, we would also need this for
          globpath(), but I haven't looked at it yet.


          regards,
          Christian
          --
          Wir neigen dazu, Erfolg eher nach der Höhe unserer Gehälter oder nach
          der Grösse unserer Autos zu bestimmen als nach dem Grad unserer
          Hilfsbereitschaft und dem Maß unserer Menschlichkeit.
          -- Martin Luther King

          --
          You received this message from the "vim_dev" 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
        • Bram Moolenaar
          ... Thanks, that is useful. I believe glob() predates the List support. -- A M00se once bit my sister ... Monty Python and the Holy Grail PYTHON (MONTY)
          Message 4 of 4 , Aug 26, 2011
          • 0 Attachment
            Christian Brabandt wrote:

            > this time, no fix from the todo list ;)
            >
            > As discussed recently in this thread¹ on vim_use, you can't access files
            > whose name contains newlines (which is ugly but allowed by POSIX). So I
            > made a small patch, to have glob() return all matches in a list. This
            > way, filenames containing newlines shouldn't make a problem anymore.

            Thanks, that is useful. I believe glob() predates the List support.


            --
            A M00se once bit my sister ...
            "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
            \\\ an exciting new programming language -- http://www.Zimbu.org ///
            \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

            --
            You received this message from the "vim_dev" 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.