comparison src/keyboard.c @ 2868:998ec1083f3d

* keyboard.c (read_key_sequence): Don't lay down an unwind_protect to restore the original buffer until we actually get a mouse click.
author Jim Blandy <jimb@redhat.com>
date Tue, 18 May 1993 22:30:21 +0000
parents 5b72eb2483e7
children 7ff263825550
comparison
equal deleted inserted replaced
2867:5b72eb2483e7 2868:998ec1083f3d
3517 3517
3518 /* If there is no function key map, turn off function key scanning. */ 3518 /* If there is no function key map, turn off function key scanning. */
3519 if (NILP (Fkeymapp (Vfunction_key_map))) 3519 if (NILP (Fkeymapp (Vfunction_key_map)))
3520 fkey_start = fkey_end = bufsize + 1; 3520 fkey_start = fkey_end = bufsize + 1;
3521 3521
3522 /* We need to save the current buffer in case we switch buffers to
3523 find the right binding for a mouse click. Note that we can't use
3524 save_excursion_{save,restore} here, because they save point as
3525 well as the current buffer; we don't want to save point, because
3526 redisplay may change it, to accomodate a Fset_window_start or
3527 something. */
3528 record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
3529
3530 last_nonmenu_event = Qnil; 3522 last_nonmenu_event = Qnil;
3531 3523
3532 if (INTERACTIVE) 3524 if (INTERACTIVE)
3533 { 3525 {
3534 if (prompt) 3526 if (prompt)
3695 { 3687 {
3696 keybuf[t] = key; 3688 keybuf[t] = key;
3697 mock_input = t + 1; 3689 mock_input = t + 1;
3698 } 3690 }
3699 3691
3692 /* Arrange to go back to the original buffer once we're
3693 done reading the key sequence. Note that we can't
3694 use save_excursion_{save,restore} here, because they
3695 save point as well as the current buffer; we don't
3696 want to save point, because redisplay may change it,
3697 to accomodate a Fset_window_start or something. We
3698 don't want to do this at the top of the function,
3699 because we may get input from a subprocess which
3700 wants to change the selected window and stuff (say,
3701 emacsclient). */
3702 record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
3703
3700 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); 3704 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
3701 goto replay_sequence; 3705 goto replay_sequence;
3702 } 3706 }
3703 else if (XTYPE (posn) == Lisp_Symbol) 3707 else if (XTYPE (posn) == Lisp_Symbol)
3704 { 3708 {