* readline.c (scm_clear_history): New function.
authorMarius Vollmer <mvo@zagadka.de>
Tue, 10 Apr 2001 23:48:27 +0000 (23:48 +0000)
committerMarius Vollmer <mvo@zagadka.de>
Tue, 10 Apr 2001 23:48:27 +0000 (23:48 +0000)
* readline.scm (readline-port): Call clear-history on exit.
Thanks to Utz-Uwe Haus.

guile-readline/readline.c
guile-readline/readline.scm

index 068c453..565c264 100644 (file)
@@ -360,6 +360,16 @@ SCM_DEFINE (scm_write_history, "write-history", 1, 0, 0,
 }
 #undef FUNC_NAME
 
+SCM_DEFINE (scm_clear_history, "clear-history", 0, 0, 0, 
+            (),
+           "Clear the history buffer of the readline machinery.")
+#define FUNC_NAME s_scm_clear_history
+{
+  clear_history();
+  return SCM_UNSPECIFIED;
+}
+#undef FUNC_NAME
+
 
 SCM_DEFINE (scm_filename_completion_function, "filename-completion-function", 2, 0, 0, 
             (SCM text, SCM continuep),
index c76e51a..f2960fa 100644 (file)
          (begin
            (do read-history) 
            (set! the-readline-port (make-readline-port))
-           (add-hook! exit-hook (lambda () (do write-history)))))
+           (add-hook! exit-hook (lambda () 
+                                  (do write-history)
+                                  (clear-history)))))
       the-readline-port)))
 
 ;;; The user might try to use readline in his programs.  It then