mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +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:
parent
2e7d963d97
commit
dcb17187c3
2 changed files with 11 additions and 0 deletions
|
@ -22,6 +22,9 @@ fi
|
||||||
|
|
||||||
AC_CHECK_FUNCS(siginterrupt rl_clear_signals rl_cleanup_after_signal)
|
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 Check for rl_pre_input_hook. This is more complicated because on
|
||||||
dnl some systems (HP/UX), the linker wont let us treat
|
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
|
dnl rl_pre_input_hook as a function when it really is a function
|
||||||
|
|
|
@ -380,7 +380,11 @@ SCM_DEFINE (scm_filename_completion_function, "filename-completion-function", 2,
|
||||||
SCM ans;
|
SCM ans;
|
||||||
SCM_VALIDATE_STRING (1,text);
|
SCM_VALIDATE_STRING (1,text);
|
||||||
SCM_STRING_COERCE_0TERMINATION_X (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));
|
s = filename_completion_function (SCM_STRING_CHARS (text), SCM_NFALSEP (continuep));
|
||||||
|
#endif
|
||||||
ans = scm_makfrom0str (s);
|
ans = scm_makfrom0str (s);
|
||||||
free (s);
|
free (s);
|
||||||
return ans;
|
return ans;
|
||||||
|
@ -545,7 +549,11 @@ scm_init_readline ()
|
||||||
= scm_c_define ("*readline-completion-function*", SCM_BOOL_F);
|
= scm_c_define ("*readline-completion-function*", SCM_BOOL_F);
|
||||||
rl_getc_function = current_input_getc;
|
rl_getc_function = current_input_getc;
|
||||||
rl_redisplay_function = redisplay;
|
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;
|
rl_completion_entry_function = (Function*) completion_function;
|
||||||
|
#endif
|
||||||
rl_basic_word_break_characters = "\t\n\"'`;()";
|
rl_basic_word_break_characters = "\t\n\"'`;()";
|
||||||
rl_readline_name = "Guile";
|
rl_readline_name = "Guile";
|
||||||
#if defined (HAVE_RL_PRE_INPUT_HOOK) && defined (GUILE_SIGWINCH_SA_RESTART_CLEARED)
|
#if defined (HAVE_RL_PRE_INPUT_HOOK) && defined (GUILE_SIGWINCH_SA_RESTART_CLEARED)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue