guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tiny patch for guile-readline with very new readline libs


From: Matthias Koeppe
Subject: Tiny patch for guile-readline with very new readline libs
Date: 13 Jun 2001 18:13:59 +0200

Very new readline libs like those on Debian "testing" seem to use a
new naming scheme that renames the "Function" typedef to something
else and attaches an "rl_" prefix to variables like
`filename_completion_function'.

The following patch adds a configure test and uses the old or new
names depending on the result.  Also a missing prototype is added.

Index: guile-readline/configure.in
===================================================================
RCS file: /cvs/guile/guile-core/guile-readline/configure.in,v
retrieving revision 1.12
diff -u -r1.12 configure.in
--- guile-readline/configure.in 2001/06/03 00:59:23     1.12
+++ guile-readline/configure.in 2001/06/13 16:07:19
@@ -22,6 +22,9 @@
 
 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
Index: guile-readline/readline.c
===================================================================
RCS file: /cvs/guile/guile-core/guile-readline/readline.c,v
retrieving revision 1.35
diff -u -r1.35 readline.c
--- guile-readline/readline.c   2001/06/07 21:12:19     1.35
+++ guile-readline/readline.c   2001/06/13 16:10:31
@@ -380,7 +380,11 @@
   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_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)
Index: guile-readline/readline.h
===================================================================
RCS file: /cvs/guile/guile-core/guile-readline/readline.h,v
retrieving revision 1.7
diff -u -r1.7 readline.h
--- guile-readline/readline.h   2001/05/24 06:51:42     1.7
+++ guile-readline/readline.h   2001/06/13 16:11:02
@@ -33,6 +33,7 @@
 extern void scm_readline_init_ports (SCM inp, SCM outp);
 extern SCM scm_readline (SCM txt, SCM inp, SCM outp, SCM read_hook);
 extern SCM scm_add_history (SCM txt);
+extern SCM scm_clear_history (void);
 extern SCM scm_read_history (SCM file);
 extern SCM scm_write_history (SCM file);
 extern SCM scm_filename_completion_function (SCM text, SCM continuep);

-- 
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]