From 2a84c6da58ee6b4519a0b7167d0cc978dc51c4b2 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 15 Dec 2004 00:06:46 +0000 Subject: [PATCH] (Vthrow_on_input): New variable. (syms_of_keyboard): Defvar and initialize it. (kbd_buffer_store_event_hold): Handle Vthrow_on_input. --- src/ChangeLog | 5 +++++ src/keyboard.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index f377cad5e74..84955d3b0ff 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-12-14 Kim F. Storm + + * keyboard.c (read_char): Save and restore echo_string when + handling input method. + 2004-12-13 Richard M. Stallman * eval.c (syms_of_eval) : Doc fix. diff --git a/src/keyboard.c b/src/keyboard.c index 4203619863b..b1f8a55507d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3580,6 +3580,9 @@ event_to_kboard (event) } #endif + +Lisp_Object Vthrow_on_input; + /* Store an event obtained at interrupt level into kbd_buffer, fifo */ void @@ -3705,6 +3708,14 @@ kbd_buffer_store_event_hold (event, hold_quit) *kbd_store_ptr = *event; ++kbd_store_ptr; } + + /* If we're in a section that requested to be interrupted as soon + as input comes, then set quit-flag to cause an interrupt. */ + if (!NILP (Vthrow_on_input) + && event->kind != FOCUS_IN_EVENT + && event->kind != HELP_EVENT + && event->kind != DEICONIFY_EVENT) + Vquit_flag = Vthrow_on_input; } @@ -11377,6 +11388,12 @@ Used during Emacs' startup. */); doc: /* *How long to display an echo-area message when the minibuffer is active. If the value is not a number, such messages don't time out. */); Vminibuffer_message_timeout = make_number (2); + + DEFVAR_LISP ("throw-on-input", &Vthrow_on_input, + doc: /* If non-nil, any keyboard input throws to this symbol. +The value of that variable is passed to `quit-flag' and later causes a +peculiar kind of quitting. */); + Vthrow_on_input = Qnil; } void -- 2.39.2