1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Can define a user command for :Print, but it doesn't work. (Aaron
13 Solution: Let user command :Print overrule the builtin command (Christian
14 Brabandt) Disallow :X and :Next as a user defined command.
18 *** ../vim-7.3.053/src/ex_docmd.c 2010-10-13 17:50:02.000000000 +0200
19 --- src/ex_docmd.c 2010-11-10 18:33:18.000000000 +0100
25 ! /* Look for a user defined command as a last resort */
26 ! if (eap->cmdidx == CMD_SIZE && *eap->cmd >= 'A' && *eap->cmd <= 'Z')
28 /* User defined commands may contain digits. */
29 while (ASCII_ISALNUM(*p))
34 ! /* Look for a user defined command as a last resort. Let ":Print" be
35 ! * overruled by a user defined command. */
36 ! if ((eap->cmdidx == CMD_SIZE || eap->cmdidx == CMD_Print)
37 ! && *eap->cmd >= 'A' && *eap->cmd <= 'Z')
39 /* User defined commands may contain digits. */
40 while (ASCII_ISALNUM(*p))
44 int compl = EXPAND_NOTHING;
45 char_u *compl_arg = NULL;
46 int has_attr = (eap->arg[0] == '-');
57 + name_len = (int)(end - name);
59 /* If there is nothing after the name, and no attributes were specified,
60 * we are listing commands
64 EMSG(_("E183: User defined commands must start with an uppercase letter"));
67 + else if ((name_len == 1 && *name == 'X')
69 + && STRNCMP(name, "Next", name_len > 4 ? 4 : name_len) == 0))
71 + EMSG(_("E841: Reserved name, cannot be used for user defined command"));
75 uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg,
82 ! g_do_tagpreview = p_pvh;
83 ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1);
90 ! g_do_tagpreview = p_pvh; /* will be reset to 0 in ex_tag_cmd() */
91 ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1);
94 *** ../vim-7.3.053/src/version.c 2010-11-10 17:11:29.000000000 +0100
95 --- src/version.c 2010-11-10 18:58:28.000000000 +0100
99 { /* Add new patch number below this line */
105 You can be stopped by the police for biking over 65 miles per hour.
106 You are not allowed to walk across a street on your hands.
107 [real standing laws in Connecticut, United States of America]
109 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
110 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
111 \\\ download, build and distribute -- http://www.A-A-P.org ///
112 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///