aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1993-05-18 22:30:21 +0000
committerJim Blandy1993-05-18 22:30:21 +0000
commitdb9e92962de6968451450670744deace186d306d (patch)
treeb64a8f154e9d4ca33843c729d1939576b2652c5a /src
parent5a1c6df8cdf0f6e5b2498591c14d280ee671191c (diff)
downloademacs-db9e92962de6968451450670744deace186d306d.tar.gz
emacs-db9e92962de6968451450670744deace186d306d.zip
* keyboard.c (read_key_sequence): Don't lay down an unwind_protect
to restore the original buffer until we actually get a mouse click.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index b6313ab7b12..98c9250fb6d 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3519,14 +3519,6 @@ read_key_sequence (keybuf, bufsize, prompt)
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)
@@ -3697,6 +3689,18 @@ read_key_sequence (keybuf, bufsize, prompt)
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 }