Mercurial > hg > xemacs-beta
comparison src/console.c @ 161:28f395d8dc7a r20-3b7
Import from CVS: tag r20-3b7
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:42:26 +0200 |
parents | 43dd3413c7c7 |
children | 0132846995bd |
comparison
equal
deleted
inserted
replaced
160:1c55655d6702 | 161:28f395d8dc7a |
---|---|
912 Some operating systems cannot stop processes and resume them later. | 912 Some operating systems cannot stop processes and resume them later. |
913 On such systems, who knows what will happen. | 913 On such systems, who knows what will happen. |
914 */ | 914 */ |
915 (console)) | 915 (console)) |
916 { | 916 { |
917 Lisp_Object devcons; | |
918 Lisp_Object framecons; | |
919 struct console *c; | 917 struct console *c; |
920 struct gcpro gcpro1; | |
921 | 918 |
922 #ifdef HAVE_TTY | 919 #ifdef HAVE_TTY |
923 if (NILP (console)) | 920 c = decode_console (console); |
924 console=Fselected_console(); | |
925 | |
926 GCPRO1 (console); | |
927 | |
928 c = decode_console(console); | |
929 | 921 |
930 if (CONSOLE_TTY_P (c)) | 922 if (CONSOLE_TTY_P (c)) |
931 { | 923 { |
932 CONSOLE_DEVICE_LOOP (devcons, c) | 924 /* |
925 * hide all the unhidden frames so the display code won't update | |
926 * them while the console is suspended. | |
927 */ | |
928 Lisp_Object device = CONSOLE_SELECTED_DEVICE (c); | |
929 if (!NILP (device)) | |
933 { | 930 { |
934 struct device *d = XDEVICE (XCAR (devcons)); | 931 struct device *d = XDEVICE (device); |
935 DEVICE_FRAME_LOOP (framecons, d) | 932 Lisp_Object frame_list = DEVICE_FRAME_LIST (d); |
933 while (CONSP (frame_list)) | |
936 { | 934 { |
937 Fmake_frame_invisible(XCAR(framecons), Qt); | 935 struct frame *f = XFRAME (XCAR (frame_list)); |
936 if (FRAME_REPAINT_P (f)) | |
937 f->visible = -1; | |
938 frame_list = XCDR (frame_list); | |
938 } | 939 } |
939 } | 940 } |
940 reset_one_console(c); | 941 reset_one_console (c); |
942 event_stream_unselect_console (c); | |
941 sys_suspend_process(XINT(Fconsole_tty_controlling_process(console))); | 943 sys_suspend_process(XINT(Fconsole_tty_controlling_process(console))); |
942 } | 944 } |
943 | 945 |
944 UNGCPRO; | |
945 #endif | 946 #endif |
946 return Qnil; | 947 return Qnil; |
947 } | 948 } |
948 | 949 |
949 DEFUN ("resume-console", Fresume_console, 1, 1, "", /* | 950 DEFUN ("resume-console", Fresume_console, 1, 1, "", /* |
950 Re-initialize a previously suspended console. For tty consoles, | 951 Re-initialize a previously suspended console. For tty consoles, |
951 do stuff to the tty to make it sane again. | 952 do stuff to the tty to make it sane again. |
952 */ | 953 */ |
953 (console)) | 954 (console)) |
954 { | 955 { |
955 Lisp_Object devcons; | |
956 Lisp_Object framecons; | |
957 struct console *c; | 956 struct console *c; |
958 struct gcpro gcpro1, gcpro2, gcpro3; | |
959 | 957 |
960 #ifdef HAVE_TTY | 958 #ifdef HAVE_TTY |
961 GCPRO2 (console, devcons); | 959 c = decode_console (console); |
962 | 960 |
963 c = decode_console(console); | 961 if (CONSOLE_TTY_P (c)) |
964 | |
965 if (CONSOLE_TTY_P(c)) | |
966 { | 962 { |
967 CONSOLE_DEVICE_LOOP (devcons, c) | 963 /* raise the selected frame */ |
964 Lisp_Object device = CONSOLE_SELECTED_DEVICE (c); | |
965 if (!NILP (device)) | |
968 { | 966 { |
969 struct device *d = XDEVICE (XCAR (devcons)); | 967 struct device *d = XDEVICE (device); |
970 DEVICE_FRAME_LOOP (framecons, d) | 968 Lisp_Object frame = DEVICE_SELECTED_FRAME (d); |
969 if (!NILP (frame)) | |
971 { | 970 { |
972 Fmake_frame_visible(XCAR(framecons)); | 971 /* force the frame to be cleared */ |
972 SET_FRAME_CLEAR (XFRAME (frame)); | |
973 Fraise_frame (frame); | |
973 } | 974 } |
974 } | 975 } |
975 init_one_console(c); | 976 init_one_console (c); |
977 event_stream_select_console (c); | |
976 #ifdef SIGWINCH | 978 #ifdef SIGWINCH |
977 /* The same as in Fsuspend_emacs: it is possible that a size | 979 /* The same as in Fsuspend_emacs: it is possible that a size |
978 change occurred while we were suspended. Assume one did just | 980 change occurred while we were suspended. Assume one did just |
979 to be safe. It won't hurt anything if one didn't. */ | 981 to be safe. It won't hurt anything if one didn't. */ |
980 asynch_device_change_pending++; | 982 asynch_device_change_pending++; |
981 #endif | 983 #endif |
982 } | 984 } |
983 | 985 |
984 UNGCPRO; | |
985 #endif | 986 #endif |
986 return Qnil; | 987 return Qnil; |
987 } | 988 } |
988 | 989 |
989 DEFUN ("set-input-mode", Fset_input_mode, 3, 5, 0, /* | 990 DEFUN ("set-input-mode", Fset_input_mode, 3, 5, 0, /* |