diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-12-08 22:31:39 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-12-08 22:31:39 +0000 |
commit | 9255ee3150832d7e235fc0711f0efa70700559e7 (patch) | |
tree | 97d578647cc7f257e42ce12fa74e570b783ee0b9 /readline/parens.c | |
parent | ffbceea9fb49e8dd28c88a4b59cf8616b2dcc210 (diff) | |
download | gdb-9255ee3150832d7e235fc0711f0efa70700559e7.zip gdb-9255ee3150832d7e235fc0711f0efa70700559e7.tar.gz gdb-9255ee3150832d7e235fc0711f0efa70700559e7.tar.bz2 |
Import of readline 4.3.
Non-readline modified files:
src/gdb/ChangeLog src/gdb/defs.h src/gdb/cli/cli-cmds.c
src/gdb/cli/cli-setshow.c src/gdb/tui/ChangeLog
src/gdb/tui/tuiWin.c
In readline directory:
* compat.c, mbutil.c, misc.c, rlmbutil.h, rltypedefs.h,
text.c, doc/history.0, doc/history.3, support/wcwidth.c,
examples/readlinebuf.h, examples/rlcat.c: New files.
* CHANGELOG, CHANGES, INSTALL, MANIFEST, Makefile.in, README,
aclocal.m4, ansi_stdlib.h, bind.c, callback.c, chardefs.h,
complete.c, config.h.in, configure, configure.in, display.c,
emacs_keymap.c, funmap.c, histexpand.c, histfile.c, histlib.h,
history.c, history.h, histsearch.c, input.c, isearch.c,
keymaps.c, keymaps.h, kill.c, macro.c, nls.c, parens.c,
posixdir.h, readline.c, readline.h, rlconf.h, rldefs.h,
rlprivate.h, rlshell.h, rlstdc.h, rltty.c, savestring.c,
search.c, shell.c, signals.c, terminal.c, tilde.c, tilde.h,
undo.c, util.c, vi_keymap.c, vi_mode.c, xmalloc.c, xmalloc.h,
doc/Makefile.in, doc/hist.texinfo, doc/hstech.texinfo,
doc/hsuser.texinfo, doc/manvers.texinfo, doc/readline.3,
doc/rlman.texinfo, doc/rltech.texinfo, doc/rluser.texinfo
doc/rluserman.texinfo, doc/texi2dvi, doc/texi2html,
shlib/Makefile.in, support/install.sh, support/mkdirs,
support/mkdist, support/shlib-install, support/shobj-conf,
examples/Inputrc, examples/Makefile.in, examples/fileman.c,
examples/histexamp.c, examples/manexamp.c, examples/rl.c,
examples/rlfe.c, examples/rltest.c, examples/rlversion.c:
Modified files.
Diffstat (limited to 'readline/parens.c')
-rw-r--r-- | readline/parens.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/readline/parens.c b/readline/parens.c index b6de529..54ef1f3 100644 --- a/readline/parens.c +++ b/readline/parens.c @@ -30,6 +30,10 @@ #include <stdio.h> #include <sys/types.h> +#if defined (HAVE_UNISTD_H) +# include <unistd.h> +#endif + #if defined (FD_SET) && !defined (HAVE_SELECT) # define HAVE_SELECT #endif @@ -54,7 +58,7 @@ extern char *strchr (), *strrchr (); #include "readline.h" #include "rlprivate.h" -static int find_matching_open __P((char *, int, int)); +static int find_matching_open PARAMS((char *, int, int)); /* Non-zero means try to blink the matching open parenthesis when the close parenthesis is inserted. */ @@ -64,6 +68,8 @@ int rl_blink_matching_paren = 1; int rl_blink_matching_paren = 0; #endif /* !HAVE_SELECT */ +static int _paren_blink_usec = 500000; + /* Change emacs_standard_keymap to have bindings for paren matching when ON_OR_OFF is 1, change them back to self_insert when ON_OR_OFF == 0. */ void @@ -85,11 +91,23 @@ _rl_enable_paren_matching (on_or_off) } int +rl_set_paren_blink_timeout (u) + int u; +{ + int o; + + o = _paren_blink_usec; + if (u > 0) + _paren_blink_usec = u; + return (o); +} + +int rl_insert_close (count, invoking_key) int count, invoking_key; { if (rl_explicit_arg || !rl_blink_matching_paren) - rl_insert (count, invoking_key); + _rl_insert_char (count, invoking_key); else { #if defined (HAVE_SELECT) @@ -97,7 +115,7 @@ rl_insert_close (count, invoking_key) struct timeval timer; fd_set readfds; - rl_insert (1, invoking_key); + _rl_insert_char (1, invoking_key); (*rl_redisplay_function) (); match_point = find_matching_open (rl_line_buffer, rl_point - 2, invoking_key); @@ -109,7 +127,7 @@ rl_insert_close (count, invoking_key) FD_ZERO (&readfds); FD_SET (fileno (rl_instream), &readfds); timer.tv_sec = 0; - timer.tv_usec = 500000; + timer.tv_usec = _paren_blink_usec; orig_point = rl_point; rl_point = match_point; @@ -117,7 +135,7 @@ rl_insert_close (count, invoking_key) ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer); rl_point = orig_point; #else /* !HAVE_SELECT */ - rl_insert (count, invoking_key); + _rl_insert_char (count, invoking_key); #endif /* !HAVE_SELECT */ } return 0; |