diff options
| author | Karoly Lorentey | 2006-01-11 14:51:51 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-01-11 14:51:51 +0000 |
| commit | 6bbba5a627cf59d22d9b21f8f7405e43af2e94cf (patch) | |
| tree | f7fa2589b087667c561e7e8d9d5e3de5a8d702fb | |
| parent | a8bf7299ee74781dd485c33c5eac20aee0f0ebef (diff) | |
| download | emacs-6bbba5a627cf59d22d9b21f8f7405e43af2e94cf.tar.gz emacs-6bbba5a627cf59d22d9b21f8f7405e43af2e94cf.zip | |
Fix C-g during `make-network-process'. (Reported by Mark Plaksin.)
* src/process.c (Fmake_network_process): Don't unrequest_sigio on modern
systems.
* src/keyboard.c (Fset_input_interrupt_mode): Cosmetic change.
* src/sysdep.c (request_sigio): Make it a no-op if noninteractive.
(unrequest_sigio): Make it a no-op if noninteractive.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-494
| -rw-r--r-- | README.multi-tty | 35 | ||||
| -rw-r--r-- | src/keyboard.c | 8 | ||||
| -rw-r--r-- | src/process.c | 5 | ||||
| -rw-r--r-- | src/sysdep.c | 17 |
4 files changed, 41 insertions, 24 deletions
diff --git a/README.multi-tty b/README.multi-tty index 7ad6bf5b31f..261aa84ae78 100644 --- a/README.multi-tty +++ b/README.multi-tty | |||
| @@ -401,6 +401,16 @@ is probably not very interesting for anyone else.) | |||
| 401 | THINGS TO DO | 401 | THINGS TO DO |
| 402 | ------------ | 402 | ------------ |
| 403 | 403 | ||
| 404 | ** Understand how `quit_throw_to_read_char' works, and fix any bugs | ||
| 405 | that come to light. | ||
| 406 | |||
| 407 | ** Replace wrong_kboard_jmpbuf with a special return value of | ||
| 408 | read_char. It is absurd that we use setjmp/longjmp just to return | ||
| 409 | to the immediate caller. | ||
| 410 | |||
| 411 | ** See if getcjmp can be eliminated somehow. Why does Emacs allow | ||
| 412 | asynchronous input processing while it's reading input anyway? | ||
| 413 | |||
| 404 | ** `delete-frame' events are handled by `special-event-map' | 414 | ** `delete-frame' events are handled by `special-event-map' |
| 405 | immediately when read by `read_char'. This is fine but it prevents | 415 | immediately when read by `read_char'. This is fine but it prevents |
| 406 | higher-level keymaps from binding that event to get notified of the | 416 | higher-level keymaps from binding that event to get notified of the |
| @@ -688,15 +698,6 @@ THINGS TO DO | |||
| 688 | 698 | ||
| 689 | ** Do a grep on XXX and ?? for more issues. | 699 | ** Do a grep on XXX and ?? for more issues. |
| 690 | 700 | ||
| 691 | ** Understand Emacs's low-level input system (it's black magic) :-) | ||
| 692 | What exactly does interrupt_input do? I tried to disable it for | ||
| 693 | raw secondary tty support, but it does not seem to do anything | ||
| 694 | useful. (Update: Look again. X unconditionally enables this, maybe | ||
| 695 | that's why raw terminal support is broken again. I really do need | ||
| 696 | to understand input.) | ||
| 697 | (Update: I am starting to understand the read_key_sequence->read-char | ||
| 698 | ->kbd_buffer_get_event->read_avail_input->read_socket_hook path. Yay!) | ||
| 699 | |||
| 700 | ** flow-ctrl.el must be updated. | 701 | ** flow-ctrl.el must be updated. |
| 701 | 702 | ||
| 702 | ** Fix stuff_char for multi-tty. Doesn't seem to be of high priority. | 703 | ** Fix stuff_char for multi-tty. Doesn't seem to be of high priority. |
| @@ -1435,6 +1436,22 @@ DIARY OF CHANGES | |||
| 1435 | kills the terminal. There was no bug here, but I rewrote the whole | 1436 | kills the terminal. There was no bug here, but I rewrote the whole |
| 1436 | single_kboard mess anyway.) (patch-489) | 1437 | single_kboard mess anyway.) (patch-489) |
| 1437 | 1438 | ||
| 1439 | -- Understand Emacs's low-level input system (it's black magic) :-) | ||
| 1440 | What exactly does interrupt_input do? I tried to disable it for | ||
| 1441 | raw secondary tty support, but it does not seem to do anything | ||
| 1442 | useful. (Update: Look again. X unconditionally enables this, maybe | ||
| 1443 | that's why raw terminal support is broken again. I really do need | ||
| 1444 | to understand input.) | ||
| 1445 | (Update: I am starting to understand the read_key_sequence->read-char | ||
| 1446 | ->kbd_buffer_get_event->read_avail_input->read_socket_hook path. Yay!) | ||
| 1447 | |||
| 1448 | (Update: OK, it all seems so easy now (NOT). Input could be done | ||
| 1449 | synchronously (with wait_reading_process_input), or asynchronously | ||
| 1450 | by SIGIO or polling (SIGALRM). C-g either sets the Vquit_flag, | ||
| 1451 | signals a 'quit condition (when immediate_quit), or throws to | ||
| 1452 | `getcjmp' when Emacs was waiting for input when the C-g event | ||
| 1453 | arrived.) | ||
| 1454 | |||
| 1438 | 1455 | ||
| 1439 | ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d | 1456 | ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d |
| 1440 | 1457 | ||
diff --git a/src/keyboard.c b/src/keyboard.c index d923cfd31a8..6c94ef30efa 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -10741,11 +10741,8 @@ See also `current-input-mode'. */) | |||
| 10741 | int new_interrupt_input; | 10741 | int new_interrupt_input; |
| 10742 | #ifdef SIGIO | 10742 | #ifdef SIGIO |
| 10743 | /* Note SIGIO has been undef'd if FIONREAD is missing. */ | 10743 | /* Note SIGIO has been undef'd if FIONREAD is missing. */ |
| 10744 | if (0 | ||
| 10745 | #ifdef HAVE_X_WINDOWS | 10744 | #ifdef HAVE_X_WINDOWS |
| 10746 | || x_display_list != NULL | 10745 | if (x_display_list != NULL) |
| 10747 | #endif | ||
| 10748 | ) | ||
| 10749 | { | 10746 | { |
| 10750 | /* When using X, don't give the user a real choice, | 10747 | /* When using X, don't give the user a real choice, |
| 10751 | because we haven't implemented the mechanisms to support it. */ | 10748 | because we haven't implemented the mechanisms to support it. */ |
| @@ -10756,6 +10753,7 @@ See also `current-input-mode'. */) | |||
| 10756 | #endif /* NO_SOCK_SIGIO */ | 10753 | #endif /* NO_SOCK_SIGIO */ |
| 10757 | } | 10754 | } |
| 10758 | else | 10755 | else |
| 10756 | #endif | ||
| 10759 | new_interrupt_input = !NILP (interrupt); | 10757 | new_interrupt_input = !NILP (interrupt); |
| 10760 | #else /* not SIGIO */ | 10758 | #else /* not SIGIO */ |
| 10761 | new_interrupt_input = 0; | 10759 | new_interrupt_input = 0; |
| @@ -10787,7 +10785,7 @@ See also `current-input-mode'. */) | |||
| 10787 | } | 10785 | } |
| 10788 | return Qnil; | 10786 | return Qnil; |
| 10789 | } | 10787 | } |
| 10790 | 10788 | ||
| 10791 | DEFUN ("set-output-flow-control", Fset_output_flow_control, Sset_output_flow_control, 1, 2, 0, | 10789 | DEFUN ("set-output-flow-control", Fset_output_flow_control, Sset_output_flow_control, 1, 2, 0, |
| 10792 | doc: /* Enable or disable ^S/^Q flow control for output to TERMINAL. | 10790 | doc: /* Enable or disable ^S/^Q flow control for output to TERMINAL. |
| 10793 | If FLOW is non-nil, flow control is enabled and you cannot use C-s or | 10791 | If FLOW is non-nil, flow control is enabled and you cannot use C-s or |
diff --git a/src/process.c b/src/process.c index 05ea7c863b0..9d4e203452e 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -3086,6 +3086,10 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3086 | 3086 | ||
| 3087 | open_socket: | 3087 | open_socket: |
| 3088 | 3088 | ||
| 3089 | #ifdef __ultrix__ | ||
| 3090 | /* Previously this was compiled unconditionally, but that seems | ||
| 3091 | unnecessary on modern systems, and `unrequest_sigio' was a noop | ||
| 3092 | under X anyway. --lorentey */ | ||
| 3089 | /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR) | 3093 | /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR) |
| 3090 | when connect is interrupted. So let's not let it get interrupted. | 3094 | when connect is interrupted. So let's not let it get interrupted. |
| 3091 | Note we do not turn off polling, because polling is only used | 3095 | Note we do not turn off polling, because polling is only used |
| @@ -3102,6 +3106,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3102 | record_unwind_protect (unwind_request_sigio, Qnil); | 3106 | record_unwind_protect (unwind_request_sigio, Qnil); |
| 3103 | unrequest_sigio (); | 3107 | unrequest_sigio (); |
| 3104 | } | 3108 | } |
| 3109 | #endif | ||
| 3105 | 3110 | ||
| 3106 | /* Do this in case we never enter the for-loop below. */ | 3111 | /* Do this in case we never enter the for-loop below. */ |
| 3107 | count1 = SPECPDL_INDEX (); | 3112 | count1 = SPECPDL_INDEX (); |
diff --git a/src/sysdep.c b/src/sysdep.c index 956323f3a3b..25db4c73080 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1037,12 +1037,8 @@ reset_sigio (fd) | |||
| 1037 | void | 1037 | void |
| 1038 | request_sigio () | 1038 | request_sigio () |
| 1039 | { | 1039 | { |
| 1040 | /* XXX read_socket_hook is not global anymore. Is blocking SIGIO | 1040 | if (noninteractive) |
| 1041 | bad under X? */ | ||
| 1042 | #if 0 | ||
| 1043 | if (noninteractive || read_socket_hook) | ||
| 1044 | return; | 1041 | return; |
| 1045 | #endif | ||
| 1046 | 1042 | ||
| 1047 | #ifdef SIGWINCH | 1043 | #ifdef SIGWINCH |
| 1048 | sigunblock (sigmask (SIGWINCH)); | 1044 | sigunblock (sigmask (SIGWINCH)); |
| @@ -1055,13 +1051,14 @@ request_sigio () | |||
| 1055 | void | 1051 | void |
| 1056 | unrequest_sigio (void) | 1052 | unrequest_sigio (void) |
| 1057 | { | 1053 | { |
| 1058 | /* XXX read_socket_hook is not global anymore. Is blocking SIGIO | 1054 | if (noninteractive) |
| 1059 | bad under X? */ | 1055 | return; |
| 1060 | #if 0 | 1056 | |
| 1061 | if (noninteractive || read_socket_hook) | 1057 | #if 0 /* XXX What's wrong with blocking SIGIO under X? */ |
| 1058 | if (x_display_list) | ||
| 1062 | return; | 1059 | return; |
| 1063 | #endif | 1060 | #endif |
| 1064 | 1061 | ||
| 1065 | #ifdef SIGWINCH | 1062 | #ifdef SIGWINCH |
| 1066 | sigblock (sigmask (SIGWINCH)); | 1063 | sigblock (sigmask (SIGWINCH)); |
| 1067 | #endif | 1064 | #endif |