Commit Graph

115 Commits

Author SHA1 Message Date
Joachim Nilsson
9b3137eb1b Merge branch 'master' into readline-compat-for-fileman 2010-08-07 00:30:14 +02:00
Joachim Nilsson
916fac7cad Line scroll branch todo. 2010-08-06 23:56:51 +02:00
Joachim Nilsson
1c89c9886c Refactor tty_info() to make rl_reset_terminal() useful. 2010-08-05 15:14:06 +02:00
Joachim Nilsson
de6ff117bb Implement compat. support for rl_instream and rl_outstream 2010-08-05 13:20:35 +02:00
Joachim Nilsson
5e9177fd18 Add support for el_bind_key() and example usage binding '?' in examples/cli.c
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.
2010-08-05 12:48:51 +02:00
Joachim Nilsson
27fcc878a1 Make sure rl_instream defaults to NULL and add rl_outstream. 2010-08-05 02:00:35 +02:00
Joachim Nilsson
5de90af58f Fix new GNU Readline compat function pointers. 2010-08-05 01:56:09 +02:00
Joachim Nilsson
0a75b182b1 Improve GNU readline compat, patch by Steve Tell in 1997 and 1998
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.
2010-08-05 01:08:30 +02:00
Joachim Nilsson
6a8ecd7e2e Remove unused constant 'HIDE' 2010-08-04 03:08:38 +02:00
Joachim Nilsson
bdf5384c5b Build examples (tests) as static, for easy debugging. 2010-08-04 02:44:20 +02:00
Joachim Nilsson
ff404e2088 Move to use AS_HELP_STRING() and make default-complete enabled by default. 2010-08-04 02:39:57 +02:00
Joachim Nilsson
d04bdaf38f Add support for read_history(char *filename) and write_history(char *filename) 2010-08-04 02:23:05 +02:00
Joachim Nilsson
aea0d60478 Remove copyright, not big enough contribution - also, was not even in patch from Mr. Black. 2010-08-04 02:18:44 +02:00
Joachim Nilsson
04a0cbd902 Allocate history scrollback buffer at runtime instead of at configure.
Also make sure "unique history" is enabled by default in configure.
2010-08-04 02:12:19 +02:00
Joachim Nilsson
55aaddbc54 Restore add_history(), for compat and simplify code. 2010-08-03 21:01:01 +02:00
Joachim Nilsson
dde4471eda Merge branch 'master' of ssh://vmlinux.org/pub/git/editline 2010-08-03 00:34:39 +02:00
Joachim Nilsson
76ec5adba6 ANSI-fication and minor cleanup of old OS-9 files. 2010-08-03 00:26:06 +02:00
Joachim Nilsson
80ca9e1811 Restore previously discarded (and incomplete) OS9 backend files. 2010-08-03 00:14:48 +02:00
Joachim Nilsson
b48de203e7 Always build complete.c now that we have changed completion handling.
After the revert of function pointers for rl_complete() and rl_list_possib(),
introduced in v0.2.2, we need to build complete.c for all configurations. The
user should use the rl_set_*_func() calls merged from the Heimdal project's
readline fork.
2010-08-02 16:02:59 +02:00
Joachim Nilsson
3fedfd4444 Update man page slightly. 2010-07-31 02:27:24 +02:00
Joachim Nilsson
c0d7a14490 Merge branch 'master' into readline-compat-for-fileman 2010-07-30 03:10:11 +02:00
Joachim Nilsson
f1edf7ae52 Replace previous commit for quoted chars with a much improved one.
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.
2010-07-30 02:03:46 +02:00
Joachim Nilsson
2a9b087bbc Update with more wish-list items, UTF-8 support is not high prio, but would be neat. 2010-07-30 01:56:25 +02:00
Joachim Nilsson
f617f84293 Fix display of quoted (contro) characters w/o breaking 8-bit display 2010-07-26 02:09:15 +02:00
Joachim Nilsson
bde0c0c9d6 Cuddle else statments, that's the way of the samurai - also minor cleanup. 2010-07-26 02:03:31 +02:00
Joachim Nilsson
02acd55b2e Support for capitalizing words (M-c) from Festival speech-tools by Alan W Black <awb()cstr!ed!ac!uk> 2010-07-26 01:44:18 +02:00
Joachim Nilsson
167059d159 Obfuscate email address 2010-07-25 22:22:56 +02:00
Joachim Nilsson
20c55a58da Add el_bind_key_in_metamap() from Festival speech-tools.
Support for Meta key binding imported from Festival speech-tools, author
Alan W Black <awb()cstr!ed!ac!uk>.  Code released under the original license.
2010-07-25 22:17:10 +02:00
Joachim Nilsson
0d9ce0ce06 Refactor of variable names, for improved readline compat. 2010-07-25 22:14:14 +02:00
Joachim Nilsson
67e9aa3f2b Revert broken Debian patch for 8-bit char input, fix tty_show() instead.
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.
2010-07-25 22:01:04 +02:00
Joachim Nilsson
dbad0d0871 Minor. 2010-07-25 21:43:41 +02:00
Joachim Nilsson
f16cbece5a Rename Signal --> el_intr_pending. From Festival speech-tools. 2010-07-24 03:46:58 +02:00
Joachim Nilsson
be921400bb Merge el_no_echo patch from Festival speech-tools editline fork 2010-07-24 03:38:25 +02:00
Joachim Nilsson
83e4837f39 Remove unused CHAR type and replace SIZE_T with size_t, we check for that. 2010-07-24 03:12:45 +02:00
Joachim Nilsson
a7eea67253 Cast size_t to int, confuses some compilers otherwise. 2010-07-24 03:09:00 +02:00
Joachim Nilsson
8e13c7b5ae Fix memory leak 2010-07-24 03:05:23 +02:00
Joachim Nilsson
02ea37e4de Clarify code when CONFIG_ANSI_ARROWS is selected. 2010-07-24 02:52:51 +02:00
Joachim Nilsson
c7b78df006 Fix lingering bug, post incrementing pointers is almost never a good idea. 2010-07-24 02:46:04 +02:00
Joachim Nilsson
5a8ad742d9 Adding -Wcast-qual revealed some more interesting casts. 2010-07-24 02:39:45 +02:00
Joachim Nilsson
522e534448 Remove unnecessary casts. 2010-07-24 02:21:28 +02:00
Joachim Nilsson
d4aa5ac293 Minor cleanup 2010-07-24 02:15:18 +02:00
Joachim Nilsson
a848011073 Move strdup() fallback implementation to platform code. 2010-07-24 02:02:56 +02:00
Joachim Nilsson
ceb1995733 Add fallback backspace in case tgetstr("le") fails. 2010-07-24 02:02:14 +02:00
Joachim Nilsson
98b846c8b1 Revert function pointers for rl_complete() and rl_list_possib() introduced in 0.2.2.
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.
2010-07-24 00:50:40 +02:00
Joachim Nilsson
511a1a65a4 Nuke NEW, DISPOSE, RENEW, and COPYFROMTO macros, by Johan Danielsson
This is a manual merge of 98c988dd10888cfb72c4 from http://github.com/heimdal/heimdal
2010-07-23 11:01:51 +02:00
Joachim Nilsson
64219dc1f0 \? -> ? by Johan Danielsson of Heimdal project http://github.com/heimdal/heimdal 2010-07-23 09:54:08 +02:00
Joachim Nilsson
b51dad6408 Minor fixes from changeset a5f54865d41c3f181a06 from Heimdal project http://github.com/heimdal/heimdal 2010-07-23 09:46:49 +02:00
Joachim Nilsson
45bae5b240 Early beginnings of increased compatibility with GNU readline 2010-07-22 09:58:24 +02:00
Joachim Nilsson
a855f4e0e6 Add fileman from BSD libedit-20100424-3.0 2010-07-22 09:57:20 +02:00
Joachim Nilsson
cc1fd1e9dc Add more TODO items. 2010-07-20 00:18:51 +02:00