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

Update doc/eval.txt about expand()

Expand Messages
  • mattn
    See: http://www.reddit.com/r/vim/comments/2el2zo/til_expandshellvar_might_spawn_a_shell/ IFAIK, expand( $FOO ) doesn t spawn shell in latest version of vim. So
    Message 1 of 6 , Aug 27, 2014
    • 0 Attachment
      See: http://www.reddit.com/r/vim/comments/2el2zo/til_expandshellvar_might_spawn_a_shell/

      IFAIK, expand('$FOO') doesn't spawn shell in latest version of vim. So I think it need to update doc.

      https://gist.github.com/mattn/18c27561455271d17158

      Thanks.
      - Yasuhiro Matsumoto

      --
      --
      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

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • LCD 47
      ... [...] AFAICT it still does, please see os_unix.c lines 5755--6228. /lcd -- -- You received this message from the vim_dev maillist. Do not top-post! Type
      Message 2 of 6 , Aug 27, 2014
      • 0 Attachment
        On 27 August 2014, mattn <mattn.jp@...> wrote:
        > See: http://www.reddit.com/r/vim/comments/2el2zo/til_expandshellvar_might_spawn_a_shell/
        >
        > IFAIK, expand('$FOO') doesn't spawn shell in latest version of vim.
        [...]

        AFAICT it still does, please see os_unix.c lines 5755--6228.

        /lcd

        --
        --
        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

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • mattn
        Yes, I know. But in this case, afaik, expand( $FOO ) shouldn t call mch_expand_wildcards(). -- -- You received this message from the vim_dev maillist. Do not
        Message 3 of 6 , Aug 27, 2014
        • 0 Attachment
          Yes, I know.

          But in this case, afaik, expand('$FOO') shouldn't call mch_expand_wildcards().

          --
          --
          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

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        • mattn
          ... Ooops, sorry. I found it. https://code.google.com/p/vim/source/browse/src/misc1.c#10769 -- -- You received this message from the vim_dev maillist. Do not
          Message 4 of 6 , Aug 27, 2014
          • 0 Attachment
            On Wednesday, August 27, 2014 9:58:15 PM UTC+9, mattn wrote:
            > Yes, I know.
            >
            > But in this case, afaik, expand('$FOO') shouldn't call mch_expand_wildcards().

            Ooops, sorry.
            I found it.

            https://code.google.com/p/vim/source/browse/src/misc1.c#10769

            --
            --
            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

            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.
          • Bram Moolenaar
            ... Thanks! -- hundred-and-one symptoms of being an internet addict: 80. At parties, you introduce your spouse as your service provider. /// Bram Moolenaar
            Message 5 of 6 , Aug 27, 2014
            • 0 Attachment
              Yasuhiro Matsumoto wrote:

              > See: http://www.reddit.com/r/vim/comments/2el2zo/til_expandshellvar_might_spawn_a_shell/
              >
              > IFAIK, expand('$FOO') doesn't spawn shell in latest version of vim. So I think it need to update doc.
              >
              > https://gist.github.com/mattn/18c27561455271d17158

              Thanks!

              --
              hundred-and-one symptoms of being an internet addict:
              80. At parties, you introduce your spouse as your "service provider."

              /// 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

              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/d/optout.
            • Bram Moolenaar
              ... Actually it does not work as documented. Even though the shell is invoked the $ is escaped, thus no environment variables are expanded. I can make this
              Message 6 of 6 , Aug 29, 2014
              • 0 Attachment
                Yasuhiro Matsumoto wrote:

                > On Wednesday, August 27, 2014 9:58:15 PM UTC+9, mattn wrote:
                > > Yes, I know.
                > >
                > > But in this case, afaik, expand('$FOO') shouldn't call
                > > mch_expand_wildcards().
                >
                > Ooops, sorry.
                > I found it.
                >
                > https://code.google.com/p/vim/source/browse/src/misc1.c#10769

                Actually it does not work as documented. Even though the shell is
                invoked the $ is escaped, thus no environment variables are expanded.

                I can make this command work:

                echo expand('$shell')
                /bin/tcsh

                However, if a file name contains a $ and what follows happens to be a
                variable name, then you do not get that file name. I would think this
                is OK, a $ should be escaped to avoid the expansion, right?

                --
                From "know your smileys":
                :-) Funny
                |-) Funny Oriental
                (-: Funny Australian

                /// 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

                ---
                You received this message because you are subscribed to the Google Groups "vim_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/d/optout.
              Your message has been successfully submitted and would be delivered to recipients shortly.