We should add a configure option --enable-readline-compat, or sth, so
rl_complete2() (removed in this commit) becomes the new rl_complete(),
and the current rl_complete() becomes el_complete().
The current implementation of rl_complete2() was is incomplete and also
not working properly. To eliminate any confusion on the matter this
patch removes it. To restore functionality we should, at the very
least, merge with complete() and possibly also refactor rl_find_token()
to share code with the legacy el_find_word().
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The filename completion handler fallback will now be enabled by default.
To disable it a new GNU Readline function pointer will be added.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
All BSD style licenses put this text on a separate line, immediately
following the Copyright line. The C-News license is confusing enough
to most people, so let's align at least a bit with the norm.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Use Emacs K&R style
- Add missing braces to for() loops
- Fix coding style issues in cli.c example
- Add empty lines to separate sections
- Simplify and de-indent code, check error case first + continue
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The word 'new' is a reserved keyword in C++ and C#, replacing it
with something else is one step further to making it possible to
build editline with a C++ compiler.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Instead merge afd8b4de9dca8ec6afc3 from http://github.com/heimdal/heimdal.git project.
This lets rl_complete() and rl_list_possib() become wrapper functions calling a set of
function pointers, set using rl_set_complete_func() and rl_set_list_possib_funct().
Each wrapper has a fallback to do filename completion, which in turn can be disabled
by leaving out --enable-default-complete from the configure line.
This change, admittedly quite intrusive for a library, is a better implementation in
many ways. For one it is much more readable, but it also enables further adoption of
other editline forks as well as a simpler implementation of GNU Readline function
pointers rl_completion_entry_function and rl_attempted_completion_function at a later
stage.
My apologies to everyone for whom this change breaks backwards compatibility. For
help on converting your code, please see examples/cli.c.
Remove all old $Id:$ and similar constructs, they don't provide any
additional benefit anymore.
Add configure options for toggling terminal bell and toying with
SIGSTOP using Ctrl-Z. Rename config option for ANSI keys to get
a consistent namespace.
Also did some work on ANSI-fication of function definitions, lot's
of that was still lingering around.
Add configure support for ANSI arrow keys.
Tested OK with gnome-terminal.
src/complete.c:
Remove usage of CONST and refactor compare() to use standard
C syntax instead of old K&R.