--- complete.c.orig Mon Oct 15 14:31:41 2001 +++ complete.c Fri Apr 5 20:59:54 2002 @@ -1729,15 +1729,18 @@ rl_menu_complete (count, ignore) static int delimiter; /* The first time through, we generate the list of matches and set things - up to insert them. */ - if (rl_last_func != rl_menu_complete) + up to insert them. Also, recompute list of matches if + last menu-complete generated a single match. + */ + if ((rl_last_func != rl_menu_complete)||(match_list_size==1)) { /* Clean up from previous call, if any. */ FREE (orig_text); if (matches) free_match_list (matches); - match_list_index = match_list_size = 0; + match_list_index = -1; + match_list_size = 0; matches = (char **)NULL; /* Only the completion entry function can change these. */ @@ -1806,17 +1809,18 @@ rl_menu_complete (count, ignore) match_list_index += match_list_size; if (match_list_index == 0 && match_list_size > 1) - { - rl_ding (); + { insert_match (orig_text, orig_start, MULT_MATCH, "e_char); - } + return rl_complete_internal('!'); + } else - { + { insert_match (matches[match_list_index], orig_start, SINGLE_MATCH, "e_char); append_to_match (matches[match_list_index], delimiter, quote_char, strcmp (orig_text, matches[match_list_index])); - } - completion_changed_buffer = 1; + completion_changed_buffer = 1; + } + return (0); }