Mercurial > hg > xemacs-beta
comparison src/event-stream.c @ 757:516c347c4479
[xemacs-hg @ 2002-02-22 17:13:59 by michaels]
2002-02-13 Ben Wing <ben@xemacs.org>
* event-stream.c (reset_key_echo):
* event-stream.c (reset_this_command_keys):
* event-stream.c (execute_command_event):
If console is dead as a result of C-x 5 0, then post-command stuff
needs to be careful and do only non-console-specific stuff.
author | michaels |
---|---|
date | Fri, 22 Feb 2002 17:14:00 +0000 |
parents | b1f74adcc1ff |
children | 943eaba38521 |
comparison
equal
deleted
inserted
replaced
756:00793f182d30 | 757:516c347c4479 |
---|---|
702 int remove_echo_area_echo) | 702 int remove_echo_area_echo) |
703 { | 703 { |
704 /* This function can GC */ | 704 /* This function can GC */ |
705 struct frame *f = selected_frame (); | 705 struct frame *f = selected_frame (); |
706 | 706 |
707 command_builder->echo_buf_index = -1; | 707 if (command_builder) |
708 command_builder->echo_buf_index = -1; | |
708 | 709 |
709 if (remove_echo_area_echo) | 710 if (remove_echo_area_echo) |
710 clear_echo_area (f, Qcommand, 0); | 711 clear_echo_area (f, Qcommand, 0); |
711 } | 712 } |
712 | 713 |
3489 */ | 3490 */ |
3490 | 3491 |
3491 void | 3492 void |
3492 reset_this_command_keys (Lisp_Object console, int clear_echo_area_p) | 3493 reset_this_command_keys (Lisp_Object console, int clear_echo_area_p) |
3493 { | 3494 { |
3494 struct command_builder *command_builder = | 3495 if (!NILP (console)) |
3495 XCOMMAND_BUILDER (XCONSOLE (console)->command_builder); | 3496 { |
3496 | 3497 /* console is nil if we just deleted the console as a result of C-x 5 |
3497 reset_key_echo (command_builder, clear_echo_area_p); | 3498 0. Unfortunately things are currently in a messy situation where |
3499 some stuff is console-local and other stuff isn't, so we need to | |
3500 do everything that's not console-local. */ | |
3501 struct command_builder *command_builder = | |
3502 XCOMMAND_BUILDER (XCONSOLE (console)->command_builder); | |
3503 | |
3504 reset_key_echo (command_builder, clear_echo_area_p); | |
3505 reset_current_events (command_builder); | |
3506 } | |
3507 else | |
3508 reset_key_echo (0, clear_echo_area_p); | |
3498 | 3509 |
3499 deallocate_event_chain (Vthis_command_keys); | 3510 deallocate_event_chain (Vthis_command_keys); |
3500 Vthis_command_keys = Qnil; | 3511 Vthis_command_keys = Qnil; |
3501 Vthis_command_keys_tail = Qnil; | 3512 Vthis_command_keys_tail = Qnil; |
3502 | |
3503 reset_current_events (command_builder); | |
3504 } | 3513 } |
3505 | 3514 |
3506 static void | 3515 static void |
3507 push_this_command_keys (Lisp_Object event) | 3516 push_this_command_keys (Lisp_Object event) |
3508 { | 3517 { |
3902 Fcommand_execute (Vthis_command, Qnil, Qnil); | 3911 Fcommand_execute (Vthis_command, Qnil, Qnil); |
3903 } | 3912 } |
3904 | 3913 |
3905 post_command_hook (); | 3914 post_command_hook (); |
3906 | 3915 |
3907 if (!NILP (con->prefix_arg)) | 3916 /* Console might have been deleted by command */ |
3917 if (CONSOLE_LIVE_P (con) && !NILP (con->prefix_arg)) | |
3908 { | 3918 { |
3909 /* Commands that set the prefix arg don't update last-command, don't | 3919 /* Commands that set the prefix arg don't update last-command, don't |
3910 reset the echoing state, and don't go into keyboard macros unless | 3920 reset the echoing state, and don't go into keyboard macros unless |
3911 followed by another command. Also don't quit here. */ | 3921 followed by another command. Also don't quit here. */ |
3912 int speccount = specpdl_depth (); | 3922 int speccount = specpdl_depth (); |
3931 | 3941 |
3932 /* Emacs 18 doesn't unconditionally clear the echoed keystrokes, | 3942 /* Emacs 18 doesn't unconditionally clear the echoed keystrokes, |
3933 so we don't either */ | 3943 so we don't either */ |
3934 | 3944 |
3935 if (!is_scrollbar_event (event)) | 3945 if (!is_scrollbar_event (event)) |
3936 reset_this_command_keys (make_console (con), 0); | 3946 reset_this_command_keys (CONSOLE_LIVE_P (con) ? make_console (con) |
3947 : Qnil, 0); | |
3937 } | 3948 } |
3938 } | 3949 } |
3939 | 3950 |
3940 UNGCPRO; | 3951 UNGCPRO; |
3941 } | 3952 } |