From 29b24dcf83ac804638e9614c29c1789fb98c4a7c Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 12 Sep 2018 17:12:19 +0200 Subject: [PATCH] Clarify comment about future --enable-readline-compat interface Signed-off-by: Joachim Nilsson --- include/editline.h | 1 + src/complete.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/editline.h b/include/editline.h index 756608a..cbabbe6 100644 --- a/include/editline.h +++ b/include/editline.h @@ -120,6 +120,7 @@ extern rl_completion_func_t *rl_attempted_completion_function; extern rl_complete_func_t *rl_set_complete_func (rl_complete_func_t *func); extern rl_list_possib_func_t *rl_set_list_possib_func (rl_list_possib_func_t *func); +// TODO: See comment for src/complete.c:rl_complete2() //#define rl_complete(a, b) _Generic((a), int: rl_complete2, default: rl_complete)(a, b) /* Alternate interface to plain readline(), for event loops */ diff --git a/src/complete.c b/src/complete.c index 4eadaa6..8540c83 100644 --- a/src/complete.c +++ b/src/complete.c @@ -339,7 +339,17 @@ char **rl_completion_matches(const char *token, rl_compentry_func_t *generator) return array; } -#if 0 // incomplete + incorrect atm +// +// TODO: Add configure option --enable-readline-compat, or sth, +// so that rl_complete2() becomes the new rl_complete(), +// and the current rl_complete() becomes el_complete() +// +// Currently rl_complete() to is incomplete (heh ;) and also very +// incorrect. At the very least we should merge with complete() +// and possibly also refacto rl_find_token() to share code with +// the legacy el_find_word(). +// +#if 0 /* * Implements the actual FSF readline rl_complete() API * @@ -383,7 +393,7 @@ int rl_complete2(int ignore, int invoking_key) return el_filename_complete(word, match); } -#endif +#endif // Disabled atm. static char *complete(char *token, int *match) {