1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 22:10:21 +02:00

* 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.
This commit is contained in:
Marius Vollmer 2001-06-14 17:42:45 +00:00
parent 2e7d963d97
commit dcb17187c3
2 changed files with 11 additions and 0 deletions

View file

@ -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

View file

@ -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)