+2017-07-17 Pedro Alves <palves@redhat.com>
+
+ * completer.c (symbol_completer): New function, based on
+ make_symbol_completion_list_fn.
+ * completer.h (symbol_completer): New declaration.
+ * guile/scm-cmd.c (cmdscm_completers): Adjust.
+ * python/py-cmd.c (completers): Adjust.
+ * symtab.c (make_symbol_completion_list_fn): Delete.
+ * symtab.h (make_symbol_completion_list_fn): Delete.
+ * cli/cli-decode.c (add_cmd): Adjust.
+
2017-07-17 Pedro Alves <palves@redhat.com>
* Makefile.in (COMMON_OBS): Add filename-seen-cache.o.
c->allow_unknown = 0;
c->prefix = NULL;
c->abbrev_flag = 0;
- set_cmd_completer (c, make_symbol_completion_list_fn);
+ set_cmd_completer (c, symbol_completer);
c->completer_handle_brkchars = NULL;
c->destroyer = NULL;
c->type = not_set_cmd;
set_rl_completer_word_break_characters (break_chars);
}
+/* Complete on symbols. */
+
+VEC (char_ptr) *
+symbol_completer (struct cmd_list_element *ignore,
+ const char *text, const char *word)
+{
+ return make_symbol_completion_list (text, word);
+}
+
/* Here are some useful test cases for completion. FIXME: These
should be put in the test suite. They should be tested with both
M-? and TAB.
extern VEC (char_ptr) *location_completer (struct cmd_list_element *,
const char *, const char *);
+extern VEC (char_ptr) *symbol_completer (struct cmd_list_element *,
+ const char *, const char *);
+
extern VEC (char_ptr) *command_completer (struct cmd_list_element *,
const char *, const char *);
{ "COMPLETE_FILENAME", filename_completer },
{ "COMPLETE_LOCATION", location_completer },
{ "COMPLETE_COMMAND", command_completer },
- { "COMPLETE_SYMBOL", make_symbol_completion_list_fn },
+ { "COMPLETE_SYMBOL", symbol_completer },
{ "COMPLETE_EXPRESSION", expression_completer },
};
{ "COMPLETE_FILENAME", filename_completer },
{ "COMPLETE_LOCATION", location_completer },
{ "COMPLETE_COMMAND", command_completer },
- { "COMPLETE_SYMBOL", make_symbol_completion_list_fn },
+ { "COMPLETE_SYMBOL", symbol_completer },
{ "COMPLETE_EXPRESSION", expression_completer },
};
return current_language->la_make_symbol_completion_list (text, word, code);
}
-/* Like make_symbol_completion_list, but suitable for use as a
- completion function. */
-
-VEC (char_ptr) *
-make_symbol_completion_list_fn (struct cmd_list_element *ignore,
- const char *text, const char *word)
-{
- return make_symbol_completion_list (text, word);
-}
-
/* Like make_symbol_completion_list, but returns a list of symbols
defined in all source files name SRCFILE. */
extern VEC (char_ptr) *make_symbol_completion_list (const char *, const char *);
extern VEC (char_ptr) *make_symbol_completion_type (const char *, const char *,
enum type_code);
-extern VEC (char_ptr) *make_symbol_completion_list_fn (struct cmd_list_element *,
- const char *,
- const char *);
extern VEC (char_ptr) *make_file_symbol_completion_list (const char *,
const char *,