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.
1. Simplify code in reposition()
2. Add tty_push() for commonly used operation, reduce code duplication.
3. Fix left() so that it treats 8-bit chars as one when not in meta-mode.
4. Replace isalnum() with homegrown implementation that understands 8-bit
and control chars.
5. Fix ceol() before introducing ANSI "kill-to-end-of-line" escape code.
This actually seems to work, previously I erronesouly used an UTF-8
terminal for testing. Which of course broke the test on an ISO-8859-1
[only] terminal.
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.
tty_flush(): Silence compiler warning.
meta(): Extend to support Home, End and Del keys, in addition to
the arrow keys. Also capturing PgUp, PgDn and Ins to prevent
them from generating odd ~ characters in input.
Also rearranged a couple of callback functions so they could be
reached by the meta() function without forward declaring them.
This is also better placement, together with other similar fns.
=====================
Fix Debian batch mode reader, read_redirected(), which is activated
when input comes from a file rather than a tty.
The implementation of read_redirected() did not support lines longer
than 64 chars. It tried to realloc(), but goofed up and instead
truncated all the first 64 chars. The result was that each read
line only contained the reminder of a a division with 64... :-)
to work better on embedded targets running off the initial console.
Also, first merge of patches from Debian. This part holds all of the
sysunix.c changes and some 8-bit patches and SIGSTP patches in the
editline.c file.
=====================
Fix another build warning for Arm cross-gcc, which actually was v4.1.2
This time getpid() was missing unistd.h, but kill() was also missing
signal.h. Added test for signal.h, but left out unistd.h since we
already define SYS_UNIX -- which we should really check for instead...
The rest are cosmetic prototype or automake/autoconf fixes.
=====================
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.