mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 04:10:18 +02:00
* readline.c (scm_clear_history): New function.
* readline.scm (readline-port): Call clear-history on exit. Thanks to Utz-Uwe Haus.
This commit is contained in:
parent
19aad96c76
commit
8ed35a15e8
2 changed files with 13 additions and 1 deletions
|
@ -360,6 +360,16 @@ SCM_DEFINE (scm_write_history, "write-history", 1, 0, 0,
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#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_DEFINE (scm_filename_completion_function, "filename-completion-function", 2, 0, 0,
|
||||||
(SCM text, SCM continuep),
|
(SCM text, SCM continuep),
|
||||||
|
|
|
@ -110,7 +110,9 @@
|
||||||
(begin
|
(begin
|
||||||
(do read-history)
|
(do read-history)
|
||||||
(set! the-readline-port (make-readline-port))
|
(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-readline-port)))
|
||||||
|
|
||||||
;;; The user might try to use readline in his programs. It then
|
;;; The user might try to use readline in his programs. It then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue