# HG changeset patch # User Karoly Lorentey # Date 1138488368 0 # Node ID 8d8bc8469c77b92f3f8d6cc60e6c2bc18307313c # Parent 7f469f3b6555dfae885790053b55b91638345cbb Fix some bugs related to wrong_kboard_jmpbuf. * src/keyboard.c (read_char): Declare. Update call to `read_char_minibuf_menu_prompt'. Set wrong_kboard_jmpbuf correctly in recursive calls. (read_char_minibuf_menu_prompt): Add wrong_kboard_jmpbuf parameter. Use it in call to `read_char'. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-499 diff -r 7f469f3b6555 -r 8d8bc8469c77 src/keyboard.c --- a/src/keyboard.c Tue Jan 17 16:29:16 2006 +0000 +++ b/src/keyboard.c Sat Jan 28 22:46:08 2006 +0000 @@ -651,7 +651,8 @@ Lisp_Object, int *)); static Lisp_Object read_char_x_menu_prompt (); static Lisp_Object read_char_minibuf_menu_prompt P_ ((int, int, - Lisp_Object *)); + Lisp_Object *, + jmp_buf *)); static Lisp_Object make_lispy_event P_ ((struct input_event *)); #ifdef HAVE_MOUSE static Lisp_Object make_lispy_movement P_ ((struct frame *, Lisp_Object, @@ -677,6 +678,8 @@ static void timer_stop_idle P_ ((void)); static void timer_resume_idle P_ ((void)); +Lisp_Object read_char P_ ((int, int, Lisp_Object *, Lisp_Object, int *, jmp_buf *)); + /* Nonzero means don't try to suspend even if the operating system seems to support it. */ static int cannot_suspend; @@ -2685,7 +2688,8 @@ && unread_command_char < 0 && !detect_input_pending_run_timers (0)) { - c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps); + c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps, + wrong_kboard_jmpbuf); if (! NILP (c)) { key_already_recorded = 1; @@ -2874,13 +2878,13 @@ } } - /* Notify the caller if a timer or sentinel or filter in the sit_for - calls above have changed the current kboard. This could happen - if they use the minibuffer or start a recursive edit, like the - fancy splash screen in server.el's filter. If this longjmp - wasn't here, read_key_sequence would interpret the next key - sequence using the wrong translation tables and function - keymaps. */ + /* Notify the caller if an autosave hook, or a timer, sentinel or + filter in the sit_for calls above have changed the current + kboard. This could happen if they use the minibuffer or start a + recursive edit, like the fancy splash screen in server.el's + filter. If this longjmp wasn't here, read_key_sequence would + interpret the next key sequence using the wrong translation + tables and function keymaps. */ if (NILP (c) && current_kboard != orig_kboard) { UNGCPRO; @@ -3306,7 +3310,7 @@ cancel_echoing (); do - c = read_char (0, 0, 0, Qnil, 0, &wrong_kboard_jmpbuf); + c = read_char (0, 0, 0, Qnil, 0, wrong_kboard_jmpbuf); while (BUFFERP (c)); /* Remove the help from the frame */ unbind_to (count, Qnil); @@ -3316,7 +3320,7 @@ { cancel_echoing (); do - c = read_char (0, 0, 0, Qnil, 0, &wrong_kboard_jmpbuf); + c = read_char (0, 0, 0, Qnil, 0, wrong_kboard_jmpbuf); while (BUFFERP (c)); } } @@ -8237,10 +8241,11 @@ static int read_char_minibuf_menu_width; static Lisp_Object -read_char_minibuf_menu_prompt (commandflag, nmaps, maps) +read_char_minibuf_menu_prompt (commandflag, nmaps, maps, wrong_kboard_jmpbuf) int commandflag ; int nmaps; Lisp_Object *maps; + jmp_buf *wrong_kboard_jmpbuf; { int mapno; register Lisp_Object name; @@ -8463,7 +8468,7 @@ orig_defn_macro = current_kboard->defining_kbd_macro; current_kboard->defining_kbd_macro = Qnil; do - obj = read_char (commandflag, 0, 0, Qt, 0); + obj = read_char (commandflag, 0, 0, Qt, 0, wrong_kboard_jmpbuf); while (BUFFERP (obj)); current_kboard->defining_kbd_macro = orig_defn_macro;