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>
This rather big patch adds support for the GNU Readline alternate
interface, for use with event loops:
void rl_callback_handler_install (const char *prompt, rl_vcpfunc_t *lhandler);
void rl_callback_read_char (void);
void rl_callback_handler_remove (void);
The code has been tested using the testit and excallback examples.
Both regular editing and searching works as intended.
Also, the problem with lingering artefacts on screen when scrolling
through the history has been fixed.
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>
Free all allocated internal memory and reset variables so
rl_initialize() or readline() may be called again later.
Signed-off-by: Claus Fischer <claus.fischer@clausfischer.com>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit adds a new global variable 'el_no_hist' which can be used
to disable auto-save of history as well as access to history using prev
and next keybindings (up/down arrows).
Signed-off-by: Mattias Walström <lazzer@gmail.com>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The two functions el_bind_key() and el_bind_key_in_metamap() should
not print status message on stderr, but rather return the status of
the key binding operation.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This changeset refactors el_bind_key_in_metamap() into two functions,
adding el_bind_key(), to provide the ability for the user to bind keys
in both the regular and the meta-key maps.
Several useful, but previously internal, functions have been made global to
facilitate the example code mentioned above. These are likely useful to the
user of this library as well:
el_print_columns() - Display words in columns across a tty_cols wide screen.
el_ring_bell() - Can be used as default key binding function.
el_find_word() - Returns a copy of the word at rl_point.
This changeset adds support for:
* rl_prep_terminal(),
* rl_deprep_terminal(), both of which are only wrappers to rl_ttyset().
* rl_getc()
and:
* (*rl_getc_function), defaults to rl_getc()
* (*rl_event_hook)
* (*rl_prep_term_function), defaults to rl_prep_terminal()
* (*rl_deprep_term_function), defaults to rl_deprep_terminal()
For further details, see http://www.cs.unc.edu/~tell/dist/magic-readline.README
Differences from Steve's commit include: signal safety in rl_getc(), restart
read() on EINTR, and make sure to support "int meta_flag" to rl_prep_terminal()
which is the GNU syntax. To that end I reused the inverse of rl_meta_chars.
This changeset fixes an old Debian patch that attempted to fix the display
of 8-bit characters in the function emacs(). It accidentally crippled the
function of M-d and M-DEL. The latter was however also broken by being
mapped to wipe(), more on that below.
The real fix is to set rl_meta_chars to 0 by default and in the tty_show()
function, which tried to be smart and output control and meta characters
(in the wrong order as well). Simply disabling the special code for output
of control characters fixes 8-bit input.
We also nuke the old and broken wipe() function that was mapped to M-DEL,
instead we map that key binding to bk_kill_word(), which works.
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.
=====================
Lots of minor fixes and additions:
* Bump version info in configure.ac
* User editline.h added, installs to $prefix/include/editline.h
- Based on Debian package version, but heavily updated.
* Manpage installs to $prefix/share/man/man3/editline.3
- Also slightly updated with contents from Debian package.
* Revised README to mention existing Debian package, also cleaned
out the old README, which now lives in doc/README
* Add TODO file.
* Fix package description and make dist to bzip2 tarballs.