Mercurial > emacs
comparison src/keyboard.c @ 83459:8d8bc8469c77
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
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sat, 28 Jan 2006 22:46:08 +0000 |
parents | 845a93c68e9a |
children | dbd791ef90a1 |
comparison
equal
deleted
inserted
replaced
83458:7f469f3b6555 | 83459:8d8bc8469c77 |
---|---|
649 static int readable_events P_ ((int)); | 649 static int readable_events P_ ((int)); |
650 static Lisp_Object read_char_x_menu_prompt P_ ((int, Lisp_Object *, | 650 static Lisp_Object read_char_x_menu_prompt P_ ((int, Lisp_Object *, |
651 Lisp_Object, int *)); | 651 Lisp_Object, int *)); |
652 static Lisp_Object read_char_x_menu_prompt (); | 652 static Lisp_Object read_char_x_menu_prompt (); |
653 static Lisp_Object read_char_minibuf_menu_prompt P_ ((int, int, | 653 static Lisp_Object read_char_minibuf_menu_prompt P_ ((int, int, |
654 Lisp_Object *)); | 654 Lisp_Object *, |
655 jmp_buf *)); | |
655 static Lisp_Object make_lispy_event P_ ((struct input_event *)); | 656 static Lisp_Object make_lispy_event P_ ((struct input_event *)); |
656 #ifdef HAVE_MOUSE | 657 #ifdef HAVE_MOUSE |
657 static Lisp_Object make_lispy_movement P_ ((struct frame *, Lisp_Object, | 658 static Lisp_Object make_lispy_movement P_ ((struct frame *, Lisp_Object, |
658 enum scroll_bar_part, | 659 enum scroll_bar_part, |
659 Lisp_Object, Lisp_Object, | 660 Lisp_Object, Lisp_Object, |
674 static SIGTYPE interrupt_signal P_ ((int signalnum)); | 675 static SIGTYPE interrupt_signal P_ ((int signalnum)); |
675 static void handle_interrupt P_ ((void)); | 676 static void handle_interrupt P_ ((void)); |
676 static void timer_start_idle P_ ((void)); | 677 static void timer_start_idle P_ ((void)); |
677 static void timer_stop_idle P_ ((void)); | 678 static void timer_stop_idle P_ ((void)); |
678 static void timer_resume_idle P_ ((void)); | 679 static void timer_resume_idle P_ ((void)); |
680 | |
681 Lisp_Object read_char P_ ((int, int, Lisp_Object *, Lisp_Object, int *, jmp_buf *)); | |
679 | 682 |
680 /* Nonzero means don't try to suspend even if the operating system seems | 683 /* Nonzero means don't try to suspend even if the operating system seems |
681 to support it. */ | 684 to support it. */ |
682 static int cannot_suspend; | 685 static int cannot_suspend; |
683 | 686 |
2683 /* Don't bring up a menu if we already have another event. */ | 2686 /* Don't bring up a menu if we already have another event. */ |
2684 && NILP (Vunread_command_events) | 2687 && NILP (Vunread_command_events) |
2685 && unread_command_char < 0 | 2688 && unread_command_char < 0 |
2686 && !detect_input_pending_run_timers (0)) | 2689 && !detect_input_pending_run_timers (0)) |
2687 { | 2690 { |
2688 c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps); | 2691 c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps, |
2692 wrong_kboard_jmpbuf); | |
2689 if (! NILP (c)) | 2693 if (! NILP (c)) |
2690 { | 2694 { |
2691 key_already_recorded = 1; | 2695 key_already_recorded = 1; |
2692 goto non_reread_1; | 2696 goto non_reread_1; |
2693 } | 2697 } |
2872 redisplay (); | 2876 redisplay (); |
2873 } | 2877 } |
2874 } | 2878 } |
2875 } | 2879 } |
2876 | 2880 |
2877 /* Notify the caller if a timer or sentinel or filter in the sit_for | 2881 /* Notify the caller if an autosave hook, or a timer, sentinel or |
2878 calls above have changed the current kboard. This could happen | 2882 filter in the sit_for calls above have changed the current |
2879 if they use the minibuffer or start a recursive edit, like the | 2883 kboard. This could happen if they use the minibuffer or start a |
2880 fancy splash screen in server.el's filter. If this longjmp | 2884 recursive edit, like the fancy splash screen in server.el's |
2881 wasn't here, read_key_sequence would interpret the next key | 2885 filter. If this longjmp wasn't here, read_key_sequence would |
2882 sequence using the wrong translation tables and function | 2886 interpret the next key sequence using the wrong translation |
2883 keymaps. */ | 2887 tables and function keymaps. */ |
2884 if (NILP (c) && current_kboard != orig_kboard) | 2888 if (NILP (c) && current_kboard != orig_kboard) |
2885 { | 2889 { |
2886 UNGCPRO; | 2890 UNGCPRO; |
2887 if (wrong_kboard_jmpbuf == NULL) | 2891 if (wrong_kboard_jmpbuf == NULL) |
2888 abort (); | 2892 abort (); |
3304 if (STRINGP (tem0)) | 3308 if (STRINGP (tem0)) |
3305 internal_with_output_to_temp_buffer ("*Help*", print_help, tem0); | 3309 internal_with_output_to_temp_buffer ("*Help*", print_help, tem0); |
3306 | 3310 |
3307 cancel_echoing (); | 3311 cancel_echoing (); |
3308 do | 3312 do |
3309 c = read_char (0, 0, 0, Qnil, 0, &wrong_kboard_jmpbuf); | 3313 c = read_char (0, 0, 0, Qnil, 0, wrong_kboard_jmpbuf); |
3310 while (BUFFERP (c)); | 3314 while (BUFFERP (c)); |
3311 /* Remove the help from the frame */ | 3315 /* Remove the help from the frame */ |
3312 unbind_to (count, Qnil); | 3316 unbind_to (count, Qnil); |
3313 | 3317 |
3314 redisplay (); | 3318 redisplay (); |
3315 if (EQ (c, make_number (040))) | 3319 if (EQ (c, make_number (040))) |
3316 { | 3320 { |
3317 cancel_echoing (); | 3321 cancel_echoing (); |
3318 do | 3322 do |
3319 c = read_char (0, 0, 0, Qnil, 0, &wrong_kboard_jmpbuf); | 3323 c = read_char (0, 0, 0, Qnil, 0, wrong_kboard_jmpbuf); |
3320 while (BUFFERP (c)); | 3324 while (BUFFERP (c)); |
3321 } | 3325 } |
3322 } | 3326 } |
3323 | 3327 |
3324 exit: | 3328 exit: |
8235 static char *read_char_minibuf_menu_text; | 8239 static char *read_char_minibuf_menu_text; |
8236 /* Size of that buffer. */ | 8240 /* Size of that buffer. */ |
8237 static int read_char_minibuf_menu_width; | 8241 static int read_char_minibuf_menu_width; |
8238 | 8242 |
8239 static Lisp_Object | 8243 static Lisp_Object |
8240 read_char_minibuf_menu_prompt (commandflag, nmaps, maps) | 8244 read_char_minibuf_menu_prompt (commandflag, nmaps, maps, wrong_kboard_jmpbuf) |
8241 int commandflag ; | 8245 int commandflag ; |
8242 int nmaps; | 8246 int nmaps; |
8243 Lisp_Object *maps; | 8247 Lisp_Object *maps; |
8248 jmp_buf *wrong_kboard_jmpbuf; | |
8244 { | 8249 { |
8245 int mapno; | 8250 int mapno; |
8246 register Lisp_Object name; | 8251 register Lisp_Object name; |
8247 int nlength; | 8252 int nlength; |
8248 /* FIXME: Use the minibuffer's frame width. */ | 8253 /* FIXME: Use the minibuffer's frame width. */ |
8461 is not used on replay. | 8466 is not used on replay. |
8462 */ | 8467 */ |
8463 orig_defn_macro = current_kboard->defining_kbd_macro; | 8468 orig_defn_macro = current_kboard->defining_kbd_macro; |
8464 current_kboard->defining_kbd_macro = Qnil; | 8469 current_kboard->defining_kbd_macro = Qnil; |
8465 do | 8470 do |
8466 obj = read_char (commandflag, 0, 0, Qt, 0); | 8471 obj = read_char (commandflag, 0, 0, Qt, 0, wrong_kboard_jmpbuf); |
8467 while (BUFFERP (obj)); | 8472 while (BUFFERP (obj)); |
8468 current_kboard->defining_kbd_macro = orig_defn_macro; | 8473 current_kboard->defining_kbd_macro = orig_defn_macro; |
8469 | 8474 |
8470 if (!INTEGERP (obj)) | 8475 if (!INTEGERP (obj)) |
8471 return obj; | 8476 return obj; |