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

Patch 6.2.044

Expand Messages
  • Bram Moolenaar
    Patch 6.2.044 Problem: :au filetypedetect gives an error for a non-existing event name, but it s actually a non-existing group name. (Antoine Mechelynck)
    Message 1 of 1 , Jul 27 5:19 AM
    • 0 Attachment
      Patch 6.2.044
      Problem: ":au filetypedetect" gives an error for a non-existing event name,
      but it's actually a non-existing group name. (Antoine Mechelynck)
      Solution: Make the error message clearer.
      Files: src/fileio.c


      *** ../vim-6.2.043/src/fileio.c Thu Jul 24 21:45:33 2003
      --- src/fileio.c Tue Jun 24 15:34:24 2003
      ***************
      *** 6149,6155 ****
      static int au_find_group __ARGS((char_u *name));
      static EVENT_T event_name2nr __ARGS((char_u *start, char_u **end));
      static char_u *event_nr2name __ARGS((EVENT_T event));
      ! static char_u *find_end_event __ARGS((char_u *arg));
      static int event_ignored __ARGS((EVENT_T event));
      static int au_get_grouparg __ARGS((char_u **argp));
      static int do_autocmd_event __ARGS((EVENT_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
      --- 6149,6155 ----
      static int au_find_group __ARGS((char_u *name));
      static EVENT_T event_name2nr __ARGS((char_u *start, char_u **end));
      static char_u *event_nr2name __ARGS((EVENT_T event));
      ! static char_u *find_end_event __ARGS((char_u *arg, int have_group));
      static int event_ignored __ARGS((EVENT_T event));
      static int au_get_grouparg __ARGS((char_u **argp));
      static int do_autocmd_event __ARGS((EVENT_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
      ***************
      *** 6484,6491 ****
      * Scan over the events. "*" stands for all events.
      */
      static char_u *
      ! find_end_event(arg)
      char_u *arg;
      {
      char_u *pat;
      char_u *p;
      --- 6484,6492 ----
      * Scan over the events. "*" stands for all events.
      */
      static char_u *
      ! find_end_event(arg, have_group)
      char_u *arg;
      + int have_group; /* TRUE when group name was found */
      {
      char_u *pat;
      char_u *p;
      ***************
      *** 6505,6511 ****
      {
      if ((int)event_name2nr(pat, &p) >= (int)NUM_EVENTS)
      {
      ! EMSG2(_("E216: No such event: %s"), pat);
      return NULL;
      }
      }
      --- 6506,6515 ----
      {
      if ((int)event_name2nr(pat, &p) >= (int)NUM_EVENTS)
      {
      ! if (have_group)
      ! EMSG2(_("E216: No such event: %s"), pat);
      ! else
      ! EMSG2(_("E216: No such group or event: %s"), pat);
      return NULL;
      }
      }
      ***************
      *** 6604,6610 ****
      * Scan over the events.
      * If we find an illegal name, return here, don't do anything.
      */
      ! pat = find_end_event(arg);
      if (pat == NULL)
      return;

      --- 6608,6614 ----
      * Scan over the events.
      * If we find an illegal name, return here, don't do anything.
      */
      ! pat = find_end_event(arg, group != AUGROUP_ALL);
      if (pat == NULL)
      return;

      ***************
      *** 6933,6939 ****
      * Scan over the events.
      * If we find an illegal name, return here, don't do anything.
      */
      ! fname = find_end_event(arg);
      if (fname == NULL)
      return FAIL;

      --- 6937,6943 ----
      * Scan over the events.
      * If we find an illegal name, return here, don't do anything.
      */
      ! fname = find_end_event(arg, group != AUGROUP_ALL);
      if (fname == NULL)
      return FAIL;

      *** ../vim-6.2.043/src/version.c Sun Jul 27 14:16:53 2003
      --- src/version.c Sun Jul 27 14:18:08 2003
      ***************
      *** 632,633 ****
      --- 632,635 ----
      { /* Add new patch number below this line */
      + /**/
      + 44,
      /**/

      --
      BLACK KNIGHT: The Black Knight always triumphs. Have at you!
      ARTHUR takes his last leg off. The BLACK KNIGHT's body lands upright.
      BLACK KNIGHT: All right, we'll call it a draw.
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.