In elisp-compiler.test, check that let* works without values given, too.
[bpt/guile.git] / guile-readline / readline.c
index 4a87ae2..7f86ceb 100644 (file)
@@ -1,10 +1,10 @@
 /* readline.c --- line editing support for Guile */
 
-/* Copyright (C) 1997,1999,2000,2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1999,2000,2001, 2002, 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
  * 
  * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,6 @@
 
 #ifdef HAVE_RL_GETC_FUNCTION
 #include "libguile.h"
-#include "libguile/gh.h"
 #include "libguile/iselect.h"
 
 #include <stdio.h>
@@ -65,7 +64,6 @@ SCM_DEFINE (scm_readline_options, "readline-options-interface", 0, 1, 0,
 {
   SCM ans = scm_options (setting,
                         scm_readline_opts,
-                        SCM_N_READLINE_OPTIONS,
                         FUNC_NAME);
   stifle_history (SCM_HISTORY_LENGTH);
   return ans;
@@ -330,6 +328,7 @@ SCM_DEFINE (scm_add_history, "add-history", 1, 0, 0,
 
   s = scm_to_locale_string (text);
   add_history (s);
+  free (s);
 
   return SCM_UNSPECIFIED;
 }
@@ -425,6 +424,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,26 +528,7 @@ match_paren (int x, int k)
     }
   return 0;
 }
-
-#if defined (HAVE_RL_PRE_INPUT_HOOK) && defined (GUILE_SIGWINCH_SA_RESTART_CLEARED)
-/* Readline disables SA_RESTART on SIGWINCH.
- * This code turns it back on.
- */
-static int
-sigwinch_enable_restart (void)
-{
-#ifdef HAVE_SIGINTERRUPT
-  siginterrupt (SIGWINCH, 0);
-#else
-  struct sigaction action;
-  
-  sigaction (SIGWINCH, NULL, &action);
-  action.sa_flags |= SA_RESTART;
-  sigaction (SIGWINCH, &action, NULL);
-#endif
-  return 0;
-}
-#endif
+#endif /* HAVE_RL_GET_KEYMAP */
 
 #endif /* HAVE_RL_GETC_FUNCTION */
 
@@ -568,15 +549,13 @@ scm_init_readline ()
 #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)
-  rl_pre_input_hook = sigwinch_enable_restart;
-#endif
 
   reentry_barrier_mutex = scm_permanent_object (scm_make_mutex ());
   scm_init_opts (scm_readline_options,
-                scm_readline_opts,
-                SCM_N_READLINE_OPTIONS);
+                scm_readline_opts);
+#if HAVE_RL_GET_KEYMAP
   init_bouncing_parens();
+#endif
   scm_add_feature ("readline");
 #endif /* HAVE_RL_GETC_FUNCTION */
 }