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

Bug: Making «< sc» abbreviation is not possible

Expand Messages
  • ZyX
    Trying to make an abbreviation using iabbrev sc test iabbrev c test iabbrev sc test set
    Message 1 of 5 , Jun 30, 2010
    • 0 Attachment
      Trying to make an abbreviation using
      iabbrev <sc test
      iabbrev <lt>sc test
      iabbrev \<sc test
      iabbrev <lt><Char-115>c test
      iabbrev <script> <lt>sc test
      set cpoptions-=<
      iabbrev <sc test
      iabbrev <script> <sc test
      iabbrev <special> <lt>sc test
      Results in
      E474: Invalid argument
      at least on empty file. Strange, but it succeeds if I open a help window and
      define this abbreviation while being in it, though this abbreviation works only
      in help window.

      Tested on vim-7.2.303, vim-7.2.444, vim-7.3a. Behavior in help window tested
      only on vim-7.2.303.
    • James Vega
      ... The abbreviation doesn t work in an empty buffer because
      Message 2 of 5 , Jun 30, 2010
      • 0 Attachment
        On Wed, Jun 30, 2010 at 8:30 AM, ZyX <zyx.vim@...> wrote:
        > Trying to make an abbreviation using
        >    iabbrev <sc test
        >    iabbrev <lt>sc test
        >    iabbrev \<sc test
        >    iabbrev <lt><Char-115>c test
        >    iabbrev <script> <lt>sc test
        >    set cpoptions-=<
        >    iabbrev <sc test
        >    iabbrev <script> <sc test
        >    iabbrev <special> <lt>sc test
        > Results in
        >    E474: Invalid argument
        > at least on empty file. Strange, but it succeeds if I open a help window and
        > define this abbreviation while being in it, though this abbreviation works only
        > in help window.

        The abbreviation doesn't work in an empty buffer because "<sc" is not a
        valid abbreviation format. Paraphrasing from ":help abbreviations",
        there are three valid formats.

        1) full-id - All characters in the abbr are listed in the 'iskeyword' option
        2) end-id - Only the last character in the abbr is listed in the
        'iskeyword' option
        3) non-id - Only the last character in the abbr is not listed in the
        'iskeyword' option

        By default, the "<" character is not a keyword character, where as "<"
        is included in 'iskeyword' for help buffers.

        --
        James
        GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan@...>

        --
        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
        ... Most likely has something to do with keyword characters, since iskeyword has a different value in help files. It also helps if you pinpoint the line that
        Message 3 of 5 , Jun 30, 2010
        • 0 Attachment
          ZyX (?) wrote:

          > Trying to make an abbreviation using
          > iabbrev <sc test
          > iabbrev <lt>sc test
          > iabbrev \<sc test
          > iabbrev <lt><Char-115>c test
          > iabbrev <script> <lt>sc test
          > set cpoptions-=<
          > iabbrev <sc test
          > iabbrev <script> <sc test
          > iabbrev <special> <lt>sc test
          > Results in
          > E474: Invalid argument
          > at least on empty file. Strange, but it succeeds if I open a help window and
          > define this abbreviation while being in it, though this abbreviation works only
          > in help window.
          >
          > Tested on vim-7.2.303, vim-7.2.444, vim-7.3a. Behavior in help window tested
          > only on vim-7.2.303.

          Most likely has something to do with keyword characters, since
          'iskeyword' has a different value in help files.

          It also helps if you pinpoint the line that causes the error, it should
          be mentioned if you source a script with these lines.

          --
          hundred-and-one symptoms of being an internet addict:
          250. You've given up the search for the "perfect woman" and instead,
          sit in front of the PC until you're just too tired to care.

          /// 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.
          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
          Ответ на сообщение «Re: Bug: Making «
          Message 4 of 5 , Jul 1, 2010
          • 0 Attachment
            Ответ на сообщение «Re: Bug: Making «< sc» abbreviation is not possible»,
            присланное в 00:10:21 01 июля 2010, Четверг,
            отправитель Bram Moolenaar:

            > Most likely has something to do with keyword characters, since
            > 'iskeyword' has a different value in help files.

            Yes, James Vega already pointed me that I should have «<» in «iskeyword» option
            in order to be able to make this abbreviation. Now I understand that it is not a
            bug, but I think that error message should be more verbose, like:

            Exxx: Invalid abbreviation: <sc

            and *Exxx* tag before the line «There are three types of abbreviations».

            Текст сообщения:
            > ZyX (?) wrote:
            > > Trying to make an abbreviation using
            > >
            > > iabbrev <sc test
            > > iabbrev <lt>sc test
            > > iabbrev \<sc test
            > > iabbrev <lt><Char-115>c test
            > > iabbrev <script> <lt>sc test
            > > set cpoptions-=<
            > > iabbrev <sc test
            > > iabbrev <script> <sc test
            > > iabbrev <special> <lt>sc test
            > >
            > > Results in
            > >
            > > E474: Invalid argument
            > >
            > > at least on empty file. Strange, but it succeeds if I open a help window
            > > and define this abbreviation while being in it, though this abbreviation
            > > works only in help window.
            > >
            > > Tested on vim-7.2.303, vim-7.2.444, vim-7.3a. Behavior in help window
            > > tested only on vim-7.2.303.
            >
            > Most likely has something to do with keyword characters, since
            > 'iskeyword' has a different value in help files.
            >
            > It also helps if you pinpoint the line that causes the error, it should
            > be mentioned if you source a script with these lines.
          • Matt Wozniski
            ... I second this - in this case, we do have enough information to know exactly why it s an invalid argument, and - unlike most times when E474 is thrown -
            Message 5 of 5 , Jul 1, 2010
            • 0 Attachment
              On Thu, Jul 1, 2010 at 10:55 AM, ZyX wrote:
              > Ответ на сообщение <<Re: Bug: Making <<< sc>> abbreviation is not possible>>,
              > присланное в 00:10:21 01 июля 2010, Четверг,
              > отправитель Bram Moolenaar:
              >
              >> Most likely has something to do with keyword characters, since
              >> 'iskeyword' has a different value in help files.
              >
              > Yes, James Vega already pointed me that I should have <<<>> in <<iskeyword>> option
              > in order to be able to make this abbreviation. Now I understand that it is not a
              > bug, but I think that error message should be more verbose, like:
              >
              > Exxx: Invalid abbreviation: <sc
              >
              > and *Exxx* tag before the line <<There are three types of abbreviations>>.

              I second this - in this case, we do have enough information to know
              exactly why it's an invalid argument, and - unlike most times when
              E474 is thrown - it's not always immediately obvious to even trained
              eyes what the error is, since it depends on buffer-local options. An
              error message just for this case would be a Good Thing.

              ~Matt

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