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

E501 with comment in Ex?

Expand Messages
  • Michael Hordijk
    Using ex, I m seeing the following odd behavior when entering a comment: [[[ $ echo blah foo.txt $ ex foo.txt foo.txt 1L, 5C Entering Ex mode. Type
    Message 1 of 4 , Nov 15, 2007
      Using ex, I'm seeing the following odd behavior when entering a comment:

      [[[
      $ echo blah > foo.txt
      $ ex foo.txt

      "foo.txt" 1L, 5C
      Entering Ex mode. Type "visual" to go to Normal mode.
      :"
      E501: At end-of-file
      :
      ]]]

      This used to be fine in older versions of vim (say 6.3). The change
      that seems to be responsible would be:

      [[[
      --- ex_docmd.c 2005/02/12 14:18:27 1.31
      +++ ex_docmd.c 2005/02/22 08:32:32 1.32
      @@ -1671,7 +1688,10 @@

      /* ignore comment and empty lines */
      if (*ea.cmd == '"' || *ea.cmd == NUL)
      + {
      + ex_pressedreturn = TRUE;
      goto doend;
      + }

      /*
      * 2. handle command modifiers.

      ]]]

      Which is rev 1.32 of vim7/src/ex_docmd.c. The revlog for 1.32 of
      ex_docmd.c is "updated for version 7.0051" which leads me to believe
      this is from another patch or repository collection somewhere (not
      familiar with how vim's repositories are managed).

      I would expect that comments would not trigger an EOF error. It causes
      ex to exit with an error code if you put a comment in script that you
      feed in. It also appears that other versions of ex (FreeBSD, Sun) don't
      generate this error.

      Thoughts?

      - michael


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... 7.0051 sounds like a snapshot number of 7.0aa ALPHA. Your line 1688 (the empty line before /* ignore comment and empty lines */ ) appears as line
      Message 2 of 4 , Nov 16, 2007
        Michael Hordijk wrote:
        > Using ex, I'm seeing the following odd behavior when entering a comment:
        >
        > [[[
        > $ echo blah > foo.txt
        > $ ex foo.txt
        >
        > "foo.txt" 1L, 5C
        > Entering Ex mode. Type "visual" to go to Normal mode.
        > :"
        > E501: At end-of-file
        > :
        > ]]]
        >
        > This used to be fine in older versions of vim (say 6.3). The change
        > that seems to be responsible would be:
        >
        > [[[
        > --- ex_docmd.c 2005/02/12 14:18:27 1.31
        > +++ ex_docmd.c 2005/02/22 08:32:32 1.32
        > @@ -1671,7 +1688,10 @@
        >
        > /* ignore comment and empty lines */
        > if (*ea.cmd == '"' || *ea.cmd == NUL)
        > + {
        > + ex_pressedreturn = TRUE;
        > goto doend;
        > + }
        >
        > /*
        > * 2. handle command modifiers.
        >
        > ]]]
        >
        > Which is rev 1.32 of vim7/src/ex_docmd.c. The revlog for 1.32 of
        > ex_docmd.c is "updated for version 7.0051" which leads me to believe
        > this is from another patch or repository collection somewhere (not
        > familiar with how vim's repositories are managed).
        >
        > I would expect that comments would not trigger an EOF error. It causes
        > ex to exit with an error code if you put a comment in script that you
        > feed in. It also appears that other versions of ex (FreeBSD, Sun) don't
        > generate this error.
        >
        > Thoughts?
        >
        > - michael

        "7.0051" sounds like a "snapshot" number of 7.0aa ALPHA.

        Your "line 1688" (the empty line before "/* ignore comment and empty lines
        */") appears as line 1742 in my current version of ex_docmd.c for Vim 7.1. The
        latest patch applying to that file is 7.1.156.


        Best regards,
        Tony.
        --
        The owner of a large furniture store in the mid-west arrived in France
        on a buying trip. As he was checking into a hotel he struck up an
        acquaintance with a beautiful young lady. However, she only spoke
        French and he only spoke English, so each couldn't understand a word
        the other spoke. He took out a pencil and a notebook and drew a
        picture of a taxi. She smiled, nodded her head and they went for a
        ride in the park. Later, he drew a picture of a table in a restaurant
        with a question mark and she nodded, so they went to dinner. After
        dinner he sketched two dancers and she was delighted. They went to
        several nightclubs, drank champagne, danced and had a glorious
        evening. It had gotten quite late when she motioned for the pencil and
        drew a picture of a four-poster bed. He was dumbfounded, and has never
        be able to understand how she knew he was in the furniture business.

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Bram Moolenaar
        ... How about changing it like this: ... *************** *** 1741,1747 **** } /* ignore comment and empty lines */ ! if (*ea.cmd == || *ea.cmd == NUL) {
        Message 3 of 4 , Nov 18, 2007
          Michael Hordijk wrote:

          > Using ex, I'm seeing the following odd behavior when entering a comment:
          >
          > [[[
          > $ echo blah > foo.txt
          > $ ex foo.txt
          >
          > "foo.txt" 1L, 5C
          > Entering Ex mode. Type "visual" to go to Normal mode.
          > :"
          > E501: At end-of-file
          > :
          > ]]]
          >
          > This used to be fine in older versions of vim (say 6.3). The change
          > that seems to be responsible would be:
          >
          > [[[
          > --- ex_docmd.c 2005/02/12 14:18:27 1.31
          > +++ ex_docmd.c 2005/02/22 08:32:32 1.32
          > @@ -1671,7 +1688,10 @@
          >
          > /* ignore comment and empty lines */
          > if (*ea.cmd == '"' || *ea.cmd == NUL)
          > + {
          > + ex_pressedreturn = TRUE;
          > goto doend;
          > + }
          >
          > /*
          > * 2. handle command modifiers.
          >
          > ]]]
          >
          > Which is rev 1.32 of vim7/src/ex_docmd.c. The revlog for 1.32 of
          > ex_docmd.c is "updated for version 7.0051" which leads me to believe
          > this is from another patch or repository collection somewhere (not
          > familiar with how vim's repositories are managed).
          >
          > I would expect that comments would not trigger an EOF error. It causes
          > ex to exit with an error code if you put a comment in script that you
          > feed in. It also appears that other versions of ex (FreeBSD, Sun) don't
          > generate this error.
          >
          > Thoughts?

          How about changing it like this:

          *** ../vim-7.1.156/src/ex_docmd.c Sun Nov 11 19:16:44 2007
          --- src/ex_docmd.c Sat Nov 17 20:23:38 2007
          ***************
          *** 1741,1747 ****
          }

          /* ignore comment and empty lines */
          ! if (*ea.cmd == '"' || *ea.cmd == NUL)
          {
          ex_pressedreturn = TRUE;
          goto doend;
          --- 1741,1749 ----
          }

          /* ignore comment and empty lines */
          ! if (*ea.cmd == '"')
          ! goto doend;
          ! if (*ea.cmd == NUL)
          {
          ex_pressedreturn = TRUE;
          goto doend;


          --
          hundred-and-one symptoms of being an internet addict:
          105. When someone asks you for your address, you tell them your URL.

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ download, build and distribute -- http://www.A-A-P.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Michael Hordijk
          ... Works for me: $ echo blah foo.txt $ ex foo.txt foo.txt 1L, 5C Entering Ex mode. Type visual to go to Normal mode. ... Makes sense to me. Does this
          Message 4 of 4 , Nov 19, 2007
            Bram Moolenaar wrote:
            > How about changing it like this:
            >
            > *** ../vim-7.1.156/src/ex_docmd.c Sun Nov 11 19:16:44 2007
            > --- src/ex_docmd.c Sat Nov 17 20:23:38 2007
            > ***************
            > *** 1741,1747 ****
            > }
            >
            > /* ignore comment and empty lines */
            > ! if (*ea.cmd == '"' || *ea.cmd == NUL)
            > {
            > ex_pressedreturn = TRUE;
            > goto doend;
            > --- 1741,1749 ----
            > }
            >
            > /* ignore comment and empty lines */
            > ! if (*ea.cmd == '"')
            > ! goto doend;
            > ! if (*ea.cmd == NUL)
            > {
            > ex_pressedreturn = TRUE;
            > goto doend;

            Works for me:

            $ echo blah > foo.txt
            $ ex foo.txt

            "foo.txt" 1L, 5C
            Entering Ex mode. Type "visual" to go to Normal mode.
            :"
            :

            Makes sense to me. Does this then became a patch/rolled into the next
            release?

            - michael


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