diff options
| author | Richard M. Stallman | 1993-08-06 21:17:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-08-06 21:17:16 +0000 |
| commit | 34f04431e23606bd0e0250a05ac211c2fc12df68 (patch) | |
| tree | 2a317bbe1f7a70764899101263ab1a83b7077607 | |
| parent | dad8e392925b680712ecf2ce721b0318c60f25cc (diff) | |
| download | emacs-34f04431e23606bd0e0250a05ac211c2fc12df68.tar.gz emacs-34f04431e23606bd0e0250a05ac211c2fc12df68.zip | |
(Fset_input_mode): Start polling, if appropriate.
At the beginning, stop polling.
Remove period from error message.
(stop_polling, start_polling): Check for interrupt_input.
(POLL_FOR_INPUT): Define whether or not target supports SIGIO.
| -rw-r--r-- | src/keyboard.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index c8e9e824b34..b0534f1dd1f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -430,13 +430,11 @@ int flow_control; | |||
| 430 | #endif | 430 | #endif |
| 431 | #endif | 431 | #endif |
| 432 | 432 | ||
| 433 | /* If we support X Windows, and won't get an interrupt when input | 433 | /* If we support X Windows, turn on the code to poll periodically |
| 434 | arrives from the server, poll periodically so we can detect C-g. */ | 434 | to detect C-g. It isn't actually used when doing interrupt input. */ |
| 435 | #ifdef HAVE_X_WINDOWS | 435 | #ifdef HAVE_X_WINDOWS |
| 436 | #ifndef SIGIO | ||
| 437 | #define POLL_FOR_INPUT | 436 | #define POLL_FOR_INPUT |
| 438 | #endif | 437 | #endif |
| 439 | #endif | ||
| 440 | 438 | ||
| 441 | /* Global variable declarations. */ | 439 | /* Global variable declarations. */ |
| 442 | 440 | ||
| @@ -1231,7 +1229,7 @@ input_poll_signal () | |||
| 1231 | start_polling () | 1229 | start_polling () |
| 1232 | { | 1230 | { |
| 1233 | #ifdef POLL_FOR_INPUT | 1231 | #ifdef POLL_FOR_INPUT |
| 1234 | if (read_socket_hook) | 1232 | if (read_socket_hook && !interrupt_input) |
| 1235 | { | 1233 | { |
| 1236 | poll_suppress_count--; | 1234 | poll_suppress_count--; |
| 1237 | if (poll_suppress_count == 0) | 1235 | if (poll_suppress_count == 0) |
| @@ -1249,7 +1247,7 @@ start_polling () | |||
| 1249 | stop_polling () | 1247 | stop_polling () |
| 1250 | { | 1248 | { |
| 1251 | #ifdef POLL_FOR_INPUT | 1249 | #ifdef POLL_FOR_INPUT |
| 1252 | if (read_socket_hook) | 1250 | if (read_socket_hook && !interrupt_input) |
| 1253 | { | 1251 | { |
| 1254 | if (poll_suppress_count == 0) | 1252 | if (poll_suppress_count == 0) |
| 1255 | { | 1253 | { |
| @@ -4932,7 +4930,11 @@ See also `current-input-mode'.") | |||
| 4932 | if (!NILP (quit) | 4930 | if (!NILP (quit) |
| 4933 | && (XTYPE (quit) != Lisp_Int | 4931 | && (XTYPE (quit) != Lisp_Int |
| 4934 | || XINT (quit) < 0 || XINT (quit) > 0400)) | 4932 | || XINT (quit) < 0 || XINT (quit) > 0400)) |
| 4935 | error ("set-input-mode: QUIT must be an ASCII character."); | 4933 | error ("set-input-mode: QUIT must be an ASCII character"); |
| 4934 | |||
| 4935 | #ifdef POLL_FOR_INPUT | ||
| 4936 | stop_polling (); | ||
| 4937 | #endif | ||
| 4936 | 4938 | ||
| 4937 | reset_sys_modes (); | 4939 | reset_sys_modes (); |
| 4938 | #ifdef SIGIO | 4940 | #ifdef SIGIO |
| @@ -4962,6 +4964,11 @@ See also `current-input-mode'.") | |||
| 4962 | quit_char = XINT (quit) & (meta_key ? 0377 : 0177); | 4964 | quit_char = XINT (quit) & (meta_key ? 0377 : 0177); |
| 4963 | 4965 | ||
| 4964 | init_sys_modes (); | 4966 | init_sys_modes (); |
| 4967 | |||
| 4968 | #ifdef POLL_FOR_INPUT | ||
| 4969 | poll_suppress_count = 1; | ||
| 4970 | start_polling (); | ||
| 4971 | #endif | ||
| 4965 | return Qnil; | 4972 | return Qnil; |
| 4966 | } | 4973 | } |
| 4967 | 4974 | ||