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

Patch 7.3.1249

Expand Messages
  • Bram Moolenaar
    Patch 7.3.1249 Problem: Modeline not recognized when using Vim instead of vim . Solution: Also accept Vim . Files: src/buffer.c ...
    Message 1 of 8 , Jun 26, 2013
    • 0 Attachment
      Patch 7.3.1249
      Problem: Modeline not recognized when using "Vim" instead of "vim".
      Solution: Also accept "Vim".
      Files: src/buffer.c


      *** ../vim-7.3.1248/src/buffer.c 2013-06-16 17:32:33.000000000 +0200
      --- src/buffer.c 2013-06-26 19:52:58.000000000 +0200
      ***************
      *** 5096,5102 ****
      if ((prev != -1 && STRNCMP(s, "ex:", (size_t)3) == 0)
      || STRNCMP(s, "vi:", (size_t)3) == 0)
      break;
      ! if (STRNCMP(s, "vim", 3) == 0)
      {
      if (s[3] == '<' || s[3] == '=' || s[3] == '>')
      e = s + 4;
      --- 5096,5103 ----
      if ((prev != -1 && STRNCMP(s, "ex:", (size_t)3) == 0)
      || STRNCMP(s, "vi:", (size_t)3) == 0)
      break;
      ! /* Accept both "vim" and "Vim". */
      ! if ((s[0] == 'v' || s[0] == 'V') && s[1] == 'i' && s[2] == 'm')
      {
      if (s[3] == '<' || s[3] == '=' || s[3] == '>')
      e = s + 4;
      *** ../vim-7.3.1248/src/version.c 2013-06-26 19:17:58.000000000 +0200
      --- src/version.c 2013-06-26 19:53:37.000000000 +0200
      ***************
      *** 730,731 ****
      --- 730,733 ----
      { /* Add new patch number below this line */
      + /**/
      + 1249,
      /**/

      --
      CONCORDE: Message for you, sir.
      He falls forward revealing the arrow with the note.
      "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

      ---
      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/groups/opt_out.
    • Andy Wokula
      ... -1 for this change. I don t want lines starting with or containing Vim: to define a modeline. Several of my (text) files yell errors now. -- Andy -- --
      Message 2 of 8 , Jun 27, 2013
      • 0 Attachment
        Am 26.06.2013 20:04, schrieb Bram Moolenaar:
        > Patch 7.3.1249
        > Problem: Modeline not recognized when using "Vim" instead of "vim".
        > Solution: Also accept "Vim".
        > Files: src/buffer.c

        -1 for this change.
        I don't want lines starting with or containing "Vim:" to define a modeline.
        Several of my (text) files yell errors now.

        --
        Andy

        --
        --
        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/groups/opt_out.
      • Bram Moolenaar
        ... Do more people see this problem? The background is that I accidentally changed vim to Vim and then had a really hard time to figure out why the
        Message 3 of 8 , Jun 27, 2013
        • 0 Attachment
          Andy Wokula wrote:

          > Am 26.06.2013 20:04, schrieb Bram Moolenaar:
          > > Patch 7.3.1249
          > > Problem: Modeline not recognized when using "Vim" instead of "vim".
          > > Solution: Also accept "Vim".
          > > Files: src/buffer.c
          >
          > -1 for this change.
          > I don't want lines starting with or containing "Vim:" to define a modeline.
          > Several of my (text) files yell errors now.

          Do more people see this problem?

          The background is that I accidentally changed "vim" to "Vim" and then
          had a really hard time to figure out why the modeline wasn't working.

          Perhaps we should have an option to only accept a modeline with "set"
          following (second form). But we already have so many options...

          --
          Apologies for taking up the bandwidth with the apology. Anything else I
          can apologise for ...... er no can't think of anything, sorry about that.
          Andy Hunt (Member of British Olympic Apology Squad)

          /// 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/groups/opt_out.
        • Ben Fritz
          ... Maybe Vim could examine what it thinks is a modeline first, and then refuse to execute it if anything invalid is found? In TOhtml I had to intentionally
          Message 4 of 8 , Jun 27, 2013
          • 0 Attachment
            On Thursday, June 27, 2013 2:35:04 PM UTC-5, Andy Wokula wrote:
            > Am 26.06.2013 20:04, schrieb Bram Moolenaar:
            >
            > > Patch 7.3.1249
            >
            > > Problem: Modeline not recognized when using "Vim" instead of "vim".
            >
            > > Solution: Also accept "Vim".
            >
            > > Files: src/buffer.c
            >
            >
            >
            > -1 for this change.
            >
            > I don't want lines starting with or containing "Vim:" to define a modeline.
            >
            > Several of my (text) files yell errors now.
            >

            Maybe Vim could examine what it thinks is a modeline first, and then refuse to execute it if anything invalid is found?

            In TOhtml I had to intentionally mangle modelines using character references, so that a modeline in the file to be converted didn't convert to an invalid modeline that Vim proceeded to yell about.

            If Vim would just silently ignore invalid modelines that would prevent such a need and also solve your problem.

            --
            --
            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/groups/opt_out.
          • Christian J. Robinson
            ... I know this is a tempting suggestion, but it will cause its own set of problems. I really prefer to have an error than wonder why my modeline isn t
            Message 5 of 8 , Jun 27, 2013
            • 0 Attachment
              On Thu, 27 Jun 2013, Ben Fritz wrote:

              > On Thursday, June 27, 2013 2:35:04 PM UTC-5, Andy Wokula wrote:
              >> Am 26.06.2013 20:04, schrieb Bram Moolenaar:
              >>> Patch 7.3.1249
              >>> Problem: Modeline not recognized when using "Vim" instead of "vim".
              >>> Solution: Also accept "Vim".
              >>> Files: src/buffer.c
              >>
              >> -1 for this change.
              >> I don't want lines starting with or containing "Vim:" to define a
              >> modeline. Several of my (text) files yell errors now.
              >>
              >
              > Maybe Vim could examine what it thinks is a modeline first, and then
              > refuse to execute it if anything invalid is found?

              I know this is a tempting suggestion, but it will cause its own set of
              problems. I really prefer to have an error than wonder why my
              modeline isn't working.

              - Christian

              --
              "It only takes 20 years for a liberal to become a conservative without
              changing a single idea." -- Robert Anton Wilson
              Christian J. Robinson <heptite@...> http://christianrobinson.name/

              --
              --
              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/groups/opt_out.
            • Bram Moolenaar
              ... And make it very difficult to find a typo in an option name... Well, we could silently ignore bogus modelines unless verbose is set. But users will need
              Message 6 of 8 , Jun 27, 2013
              • 0 Attachment
                Ben Fritz wrote:

                > On Thursday, June 27, 2013 2:35:04 PM UTC-5, Andy Wokula wrote:
                > > Am 26.06.2013 20:04, schrieb Bram Moolenaar:
                > >
                > > > Patch 7.3.1249
                > >
                > > > Problem: Modeline not recognized when using "Vim" instead of "vim".
                > >
                > > > Solution: Also accept "Vim".
                > >
                > > > Files: src/buffer.c
                > >
                > >
                > >
                > > -1 for this change.
                > >
                > > I don't want lines starting with or containing "Vim:" to define a modeline.
                > >
                > > Several of my (text) files yell errors now.
                > >
                >
                > Maybe Vim could examine what it thinks is a modeline first, and then
                > refuse to execute it if anything invalid is found?
                >
                > In TOhtml I had to intentionally mangle modelines using character
                > references, so that a modeline in the file to be converted didn't
                > convert to an invalid modeline that Vim proceeded to yell about.
                >
                > If Vim would just silently ignore invalid modelines that would prevent
                > such a need and also solve your problem.

                And make it very difficult to find a typo in an option name...

                Well, we could silently ignore bogus modelines unless 'verbose' is set.
                But users will need to read the help to figure that out.

                --
                FIRST GUARD: Ah! Now ... we're not allowed to ...
                SIR LAUNCELOT runs him through, grabs his spear and stabs the other
                guard who collapses in a heap. Hiccoughs quietly.
                "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

                ---
                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/groups/opt_out.
              • Manuel Ortega
                ... The commit message for this patch says that it s a problem that modelines can t start with Vim . But what I don t understand is why that is a problem
                Message 7 of 8 , Jun 27, 2013
                • 0 Attachment
                  On Thu, Jun 27, 2013 at 3:50 PM, Bram Moolenaar <Bram@...> wrote:

                  Andy Wokula wrote:

                  > Am 26.06.2013 20:04, schrieb Bram Moolenaar:
                  > > Patch 7.3.1249
                  > > Problem:    Modeline not recognized when using "Vim" instead of "vim".
                  > > Solution:   Also accept "Vim".
                  > > Files:          src/buffer.c
                  >
                  > -1 for this change.
                  > I don't want lines starting with or containing "Vim:" to define a modeline.
                  > Several of my (text) files yell errors now.

                  Do more people see this problem?

                  The background is that I accidentally changed "vim" to "Vim" and then
                  had a really hard time to figure out why the modeline wasn't working.

                  The commit message for this patch says that it's a "problem" that modelines can't start with 'Vim'.  But what I don't understand is why that is a problem in the first place.  Thus I don't understand why it needs to be "solved".

                  Nothing in ':h modeline' says that the capitalized form *should* work.  Both forms are defined in lowercase.

                  -Manny 

                  --
                  --
                  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/groups/opt_out.
                   
                   
                • Ben Fritz
                  ... What if we silently ignore bogus modelines if they start with Vim: instead of vim: ? Accepting with the wrong capitalization is mostly a correction of
                  Message 8 of 8 , Jun 27, 2013
                  • 0 Attachment
                    On Thursday, June 27, 2013 3:29:56 PM UTC-5, Bram Moolenaar wrote:
                    > Ben Fritz wrote:
                    >
                    > > On Thursday, June 27, 2013 2:35:04 PM UTC-5, Andy Wokula wrote:
                    > > >
                    > > > I don't want lines starting with or containing "Vim:" to define a modeline.
                    > > >
                    > > > Several of my (text) files yell errors now.
                    > > >
                    > >
                    > > Maybe Vim could examine what it thinks is a modeline first, and then
                    > > refuse to execute it if anything invalid is found?
                    > >
                    > > In TOhtml I had to intentionally mangle modelines using character
                    > > references, so that a modeline in the file to be converted didn't
                    > > convert to an invalid modeline that Vim proceeded to yell about.
                    > >
                    > > If Vim would just silently ignore invalid modelines that would prevent
                    > > such a need and also solve your problem.
                    >
                    > And make it very difficult to find a typo in an option name...
                    >
                    > Well, we could silently ignore bogus modelines unless 'verbose' is set.
                    >
                    > But users will need to read the help to figure that out.
                    >

                    What if we silently ignore bogus modelines if they start with Vim:
                    instead of "vim:"? Accepting with the wrong capitalization is mostly a
                    correction of user error.

                    In other words, accept as "vim: " always (throwing errors for bad
                    options), accept as "Vim: " only if it won't cause errors.

                    I don't care either way, I've been careful to always use "vim" because
                    that's all that has worked so far. TOhtml will need an update to ignore
                    case when mangling the modeline if "Vim" continues to be accepted at
                    all.

                    --
                    --
                    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/groups/opt_out.
                  Your message has been successfully submitted and would be delivered to recipients shortly.