mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 22:31:12 +02:00
* readline.c (rl_cleanup_after_signals, rl_free_line_state): New
readline functions to come in release 2.3. (Thanks to Chet Ramey.) (handle_errors): Use the above functions.
This commit is contained in:
parent
a581e90656
commit
daca28167f
2 changed files with 51 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
|||
1998-05-19 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
|
||||
|
||||
* readline.c (rl_cleanup_after_signals, rl_free_line_state): New
|
||||
readline functions to come in release 2.3. (Thanks to Chet
|
||||
Ramey.)
|
||||
(handle_errors): Use the above functions.
|
||||
|
||||
1998-05-12 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
|
||||
|
||||
* readline.c: Improvements for readline support: Handle errors
|
||||
|
|
|
@ -50,6 +50,48 @@
|
|||
#include <readline/readline.h>
|
||||
#include <readline/history.h>
|
||||
|
||||
#ifndef HAVE_RL_CLEANUP_AFTER_SIGNAL
|
||||
|
||||
/* This is readline functions added in release 2.3. They will work
|
||||
* together with readline-2.1 and 2.2. (The readline interface is
|
||||
* disabled for earlier releases.)
|
||||
*/
|
||||
|
||||
extern void _rl_clean_up_for_exit ();
|
||||
extern void _rl_kill_kbd_macro ();
|
||||
extern int _rl_init_argument ();
|
||||
|
||||
void
|
||||
rl_cleanup_after_signal ()
|
||||
{
|
||||
#ifdef HAVE_RL_CLEAR_SIGNALS
|
||||
_rl_clean_up_for_exit ();
|
||||
#endif
|
||||
(*rl_deprep_term_function) ();
|
||||
#ifdef HAVE_RL_CLEAR_SIGNALS
|
||||
rl_clear_signals ();
|
||||
#endif
|
||||
rl_pending_input = 0;
|
||||
}
|
||||
|
||||
void
|
||||
rl_free_line_state ()
|
||||
{
|
||||
register HIST_ENTRY *entry;
|
||||
|
||||
free_undo_list ();
|
||||
|
||||
entry = current_history ();
|
||||
if (entry)
|
||||
entry->data = (char *)NULL;
|
||||
|
||||
_rl_kill_kbd_macro ();
|
||||
rl_clear_message ();
|
||||
_rl_init_argument ();
|
||||
}
|
||||
|
||||
#endif /* !HAVE_RL_CLEANUP_AFTER_SIGNAL */
|
||||
|
||||
static int promptp;
|
||||
static SCM input_port;
|
||||
static SCM before_read;
|
||||
|
@ -103,10 +145,8 @@ reentry_barrier ()
|
|||
static SCM
|
||||
handle_error (void *data, SCM tag, SCM args)
|
||||
{
|
||||
(*rl_deprep_term_function) ();
|
||||
#ifdef HAVE_RL_CLEAR_SIGNALS
|
||||
rl_clear_signals ();
|
||||
#endif
|
||||
rl_free_line_state ();
|
||||
rl_cleanup_after_signal ();
|
||||
--in_readline;
|
||||
scm_handle_by_throw (data, tag, args);
|
||||
return SCM_UNSPECIFIED; /* never reached */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue