+Wed Jun 28 11:38:23 2006 Ben Pfaff <blp@gnu.org>
+
+ Don't offer both the full and abbreviated names for a single
+ command in command name completion.
+
+ * command.c: (enum flags) Add F_ABBREV flag.
+ (cmd_complete) Ignore command with F_ABBREV flag set.
+
+ * command.def: Add F_ABBREV to N, Q, SORT commands.
+
Tue Jun 27 22:36:38 2006 Ben Pfaff <blp@gnu.org>
Fix regression in command name completion reported by John
{
F_ENHANCED = 0x10, /* Allowed only in enhanced syntax mode. */
F_TESTING = 0x20, /* Allowed only in testing mode. */
- F_KEEP_FINAL_TOKEN = 0x40 /* Don't skip final token in command name. */
+ F_KEEP_FINAL_TOKEN = 0x40,/* Don't skip final token in command name. */
+ F_ABBREV = 0x80 /* Not a candidate for name completion. */
};
/* A single command. */
if (!memcasecmp ((*cmd)->name, prefix, strlen (prefix))
&& (!((*cmd)->flags & F_TESTING) || get_testing_mode ())
&& (!((*cmd)->flags & F_ENHANCED) || get_syntax () == ENHANCED)
+ && !((*cmd)->flags & F_ABBREV)
&& ((*cmd)->function != NULL)
&& in_correct_state (*cmd, completion_state))
return (*cmd)++->name;
DEF_CMD (S_ANY, 0, "HOST", cmd_host)
DEF_CMD (S_ANY, 0, "INCLUDE", cmd_include)
DEF_CMD (S_ANY, 0, "N OF CASES", cmd_n_of_cases)
-DEF_CMD (S_ANY, 0, "N", cmd_n_of_cases)
+DEF_CMD (S_ANY, F_ABBREV, "N", cmd_n_of_cases)
DEF_CMD (S_ANY, 0, "NEW FILE", cmd_new_file)
DEF_CMD (S_ANY, 0, "PERMISSIONS", cmd_permissions)
-DEF_CMD (S_ANY, 0, "Q", cmd_finish)
+DEF_CMD (S_ANY, F_ABBREV, "Q", cmd_finish)
DEF_CMD (S_ANY, 0, "QUIT", cmd_finish)
DEF_CMD (S_ANY, 0, "SET", cmd_set)
DEF_CMD (S_ANY, 0, "SHOW", cmd_show)
DEF_CMD (S_DATA, 0, "SAMPLE", cmd_sample)
DEF_CMD (S_DATA, 0, "SAVE", cmd_save)
DEF_CMD (S_DATA, 0, "SORT CASES", cmd_sort_cases)
-DEF_CMD (S_DATA, 0, "SORT", cmd_sort_cases)
+DEF_CMD (S_DATA, F_ABBREV, "SORT", cmd_sort_cases)
DEF_CMD (S_DATA, 0, "T-TEST", cmd_t_test)
DEF_CMD (S_DATA, 0, "TEMPORARY", cmd_temporary)
DEF_CMD (S_DATA, 0, "USE", cmd_use)