]> git.eshelyaron.com Git - emacs.git/commitdiff
(Vthrow_on_input): New variable.
authorKim F. Storm <storm@cua.dk>
Wed, 15 Dec 2004 00:06:46 +0000 (00:06 +0000)
committerKim F. Storm <storm@cua.dk>
Wed, 15 Dec 2004 00:06:46 +0000 (00:06 +0000)
(syms_of_keyboard): Defvar and initialize it.
(kbd_buffer_store_event_hold): Handle Vthrow_on_input.

src/ChangeLog
src/keyboard.c

index f377cad5e7408f29aa85a053fbe1abadd4699189..84955d3b0ff164de46b600babbd9c22cca6d37b6 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-14  Kim F. Storm  <storm@cua.dk>
+
+       * keyboard.c (read_char): Save and restore echo_string when
+       handling input method.
+
 2004-12-13  Richard M. Stallman  <rms@gnu.org>
 
        * eval.c (syms_of_eval) <quit-flag>: Doc fix.
index 4203619863bd2c8600a3990f98eeda034af79372..b1f8a55507d04ad54dfb4afa501b754f56480dc8 100644 (file)
@@ -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