Clarify comment about future --enable-readline-compat interface

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson 2018-09-12 17:12:19 +02:00
parent 097fde5267
commit 29b24dcf83
2 changed files with 13 additions and 2 deletions

View File

@ -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_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); 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) //#define rl_complete(a, b) _Generic((a), int: rl_complete2, default: rl_complete)(a, b)
/* Alternate interface to plain readline(), for event loops */ /* Alternate interface to plain readline(), for event loops */

View File

@ -339,7 +339,17 @@ char **rl_completion_matches(const char *token, rl_compentry_func_t *generator)
return array; 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 * 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); return el_filename_complete(word, match);
} }
#endif #endif // Disabled atm.
static char *complete(char *token, int *match) static char *complete(char *token, int *match)
{ {