From 9cfe821f644d2919970f2e6de3c02a47a5ff8fb7 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Tue, 29 Jan 2008 23:03:15 +0000 Subject: [PATCH] * readline.c (scm_init_readline): Only do init_bouncing_parens () if HAVE_RL_GET_KEYMAP. (init_bouncing_parens, find_matching_paren, match_paren): Compile out if ! HAVE_RL_GET_KEYMAP. * configure.in: Add check for rl_get_keymap. --- guile-readline/ChangeLog | 9 +++++++++ guile-readline/configure.in | 5 +++++ guile-readline/readline.c | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/guile-readline/ChangeLog b/guile-readline/ChangeLog index 6c7d39652..5a3f0f3e3 100644 --- a/guile-readline/ChangeLog +++ b/guile-readline/ChangeLog @@ -1,3 +1,12 @@ +2008-01-29 Neil Jerram + + * readline.c (scm_init_readline): Only do init_bouncing_parens () + if HAVE_RL_GET_KEYMAP. + (init_bouncing_parens, find_matching_paren, match_paren): Compile + out if ! HAVE_RL_GET_KEYMAP. + + * configure.in: Add check for rl_get_keymap. + 2007-07-15 Ludovic Courtès * LIBGUILEREADLINE-VERSION diff --git a/guile-readline/configure.in b/guile-readline/configure.in index b58b46b87..d0fda02a1 100644 --- a/guile-readline/configure.in +++ b/guile-readline/configure.in @@ -43,6 +43,11 @@ AC_CHECK_FUNCS(siginterrupt rl_clear_signals rl_cleanup_after_signal) dnl Check for modern readline naming AC_CHECK_FUNCS(rl_filename_completion_function) +dnl Check for rl_get_keymap. We only use this for deciding whether to +dnl install paren matching on the Guile command line (when using +dnl readline for input), so it's completely optional. +AC_CHECK_FUNCS(rl_get_keymap) + dnl Check for rl_pre_input_hook. This is more complicated because on dnl some systems (HP/UX), the linker wont let us treat dnl rl_pre_input_hook as a function when it really is a function diff --git a/guile-readline/readline.c b/guile-readline/readline.c index aa6c01409..3162a9422 100644 --- a/guile-readline/readline.c +++ b/guile-readline/readline.c @@ -425,6 +425,7 @@ completion_function (char *text, int continuep) } } +#if HAVE_RL_GET_KEYMAP /*Bouncing parenthesis (reimplemented by GH, 11/23/98, since readline is strict gpl)*/ static int match_paren (int x, int k); @@ -528,6 +529,7 @@ match_paren (int x, int k) } return 0; } +#endif /* HAVE_RL_GET_KEYMAP */ #if defined (HAVE_RL_PRE_INPUT_HOOK) && defined (GUILE_SIGWINCH_SA_RESTART_CLEARED) /* Readline disables SA_RESTART on SIGWINCH. @@ -576,7 +578,9 @@ scm_init_readline () scm_init_opts (scm_readline_options, scm_readline_opts, SCM_N_READLINE_OPTIONS); +#if HAVE_RL_GET_KEYMAP init_bouncing_parens(); +#endif scm_add_feature ("readline"); #endif /* HAVE_RL_GETC_FUNCTION */ }