diff options
author | Marius Vollmer <mvo@zagadka.de> | 2001-06-14 17:42:45 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2001-06-14 17:42:45 +0000 |
commit | dcb17187c3d2a9a680bed9aed44883562f3baacf (patch) | |
tree | 33011177e820d630a9f49790ed5cdac9c382f295 | |
parent | 2e7d963d973481b8c8dab1d0bf0057316b0dbd11 (diff) | |
download | guile-dcb17187c3d2a9a680bed9aed44883562f3baacf.tar.gz |
* configure.in: Check for rl_filename_completion_function.
* readline.c (s_scm_filename_completion_function): Use
rl_filename_completion_function instead of
filename_completion_function, if we have it.
(scm_init_readline): Use rl_compentry_func_t instead if Function
when _RL_FUNCTION_TYPEDEF is defined.
-rw-r--r-- | guile-readline/configure.in | 3 | ||||
-rw-r--r-- | guile-readline/readline.c | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/guile-readline/configure.in b/guile-readline/configure.in index a085dbcf9..ef62338d8 100644 --- a/guile-readline/configure.in +++ b/guile-readline/configure.in @@ -22,6 +22,9 @@ fi 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_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 b085f94d8..f5f330bca 100644 --- a/guile-readline/readline.c +++ b/guile-readline/readline.c @@ -380,7 +380,11 @@ SCM_DEFINE (scm_filename_completion_function, "filename-completion-function", 2, SCM ans; SCM_VALIDATE_STRING (1,text); SCM_STRING_COERCE_0TERMINATION_X (text); +#ifdef HAVE_RL_FILENAME_COMPLETION_FUNCTION + s = rl_filename_completion_function (SCM_STRING_CHARS (text), SCM_NFALSEP (continuep)); +#else s = filename_completion_function (SCM_STRING_CHARS (text), SCM_NFALSEP (continuep)); +#endif ans = scm_makfrom0str (s); free (s); return ans; @@ -545,7 +549,11 @@ scm_init_readline () = scm_c_define ("*readline-completion-function*", SCM_BOOL_F); rl_getc_function = current_input_getc; rl_redisplay_function = redisplay; +#if defined (_RL_FUNCTION_TYPEDEF) + rl_completion_entry_function = (rl_compentry_func_t*) completion_function; +#else rl_completion_entry_function = (Function*) completion_function; +#endif rl_basic_word_break_characters = "\t\n\"'`;()"; rl_readline_name = "Guile"; #if defined (HAVE_RL_PRE_INPUT_HOOK) && defined (GUILE_SIGWINCH_SA_RESTART_CLEARED) |