diff options
| author | Karoly Lorentey | 2004-08-23 10:12:04 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-08-23 10:12:04 +0000 |
| commit | f5272227fd50f5c3846e63f600601b625b6a6182 (patch) | |
| tree | 85312708f4fa58f09eaeafe2403f9b99c883ebbc /src | |
| parent | 90376e6f1799b1268d6df6d7934b593ee0c4f575 (diff) | |
| parent | 49eac10f921716d0cac034c977731fddd115388a (diff) | |
| download | emacs-f5272227fd50f5c3846e63f600601b625b6a6182.tar.gz emacs-f5272227fd50f5c3846e63f600601b625b6a6182.zip | |
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-501
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-502
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-503
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-504
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-505
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-236
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 42 | ||||
| -rw-r--r-- | src/bytecode.c | 3 | ||||
| -rw-r--r-- | src/dispnew.c | 49 | ||||
| -rw-r--r-- | src/keyboard.c | 7 | ||||
| -rw-r--r-- | src/lisp.h | 5 | ||||
| -rw-r--r-- | src/msdos.c | 2 | ||||
| -rw-r--r-- | src/process.c | 201 | ||||
| -rw-r--r-- | src/syntax.c | 12 | ||||
| -rw-r--r-- | src/sysdep.c | 18 | ||||
| -rw-r--r-- | src/w32proc.c | 2 | ||||
| -rw-r--r-- | src/w32term.c | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 2 | ||||
| -rw-r--r-- | src/xfns.c | 4 | ||||
| -rw-r--r-- | src/xselect.c | 6 | ||||
| -rw-r--r-- | src/xterm.c | 2 |
15 files changed, 164 insertions, 193 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9d9c4ee498c..cbf06bc480f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,45 @@ | |||
| 1 | 2004-08-22 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * process.c (process_send_signal) [SIGNALS_VIA_CHARACTERS, | ||
| 4 | HAVE_TERMIOS]: If there's no char for this signal, drop through | ||
| 5 | and use system calls. | ||
| 6 | |||
| 7 | * bytecode.c (Fbyte_code) <unwind-protect>: Cannot GC. | ||
| 8 | |||
| 9 | 2004-08-20 Kim F. Storm <storm@cua.dk> | ||
| 10 | |||
| 11 | * process.c (wait_reading_process_output): Rename from | ||
| 12 | wait_reading_process_input. All uses changed. | ||
| 13 | (wait_reading_process_output_1): Rename from | ||
| 14 | wait_reading_process_input_1. All uses changed. | ||
| 15 | |||
| 16 | * dispnew.c (Fsleep_for): Remove obsolete code. | ||
| 17 | |||
| 18 | 2004-08-20 Kenichi Handa <handa@m17n.org> | ||
| 19 | |||
| 20 | * syntax.c (skip_chars): Fix for unibyte case. | ||
| 21 | |||
| 22 | 2004-08-19 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 23 | |||
| 24 | * syntax.c (char_quoted): Mixup byte/char pos. | ||
| 25 | (back_comment): Fixup globals in all cases. | ||
| 26 | |||
| 27 | 2004-08-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 28 | |||
| 29 | * xfns.c (x_set_name, x_set_title): Encode title to UTF8 before | ||
| 30 | passing it to gtk_window_set_title. | ||
| 31 | |||
| 32 | 2004-08-19 Kim F. Storm <storm@cua.dk> | ||
| 33 | |||
| 34 | * process.c (wait_reading_process_input): Clean up. | ||
| 35 | Add wait_for_cell, wait_proc, and just_wait_proc args | ||
| 36 | to avoid overloading `read_kbd' and `do_display' args. | ||
| 37 | Change read_kbd arg to int. All callers changed. | ||
| 38 | |||
| 39 | * process.c (process_send_signal): Use CDISABLE. | ||
| 40 | |||
| 41 | * sysdep.c (child_setup_tty, init_sys_modes): Use CDISABLE. | ||
| 42 | |||
| 1 | 2004-08-18 Kim F. Storm <storm@cua.dk> | 43 | 2004-08-18 Kim F. Storm <storm@cua.dk> |
| 2 | 44 | ||
| 3 | * process.c (Faccept_process_output): Add arg JUST-THIS-ONE; | 45 | * process.c (Faccept_process_output): Add arg JUST-THIS-ONE; |
diff --git a/src/bytecode.c b/src/bytecode.c index a13ecc19770..0d3be49877c 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -855,10 +855,7 @@ If the third argument is incorrect, Emacs may crash. */) | |||
| 855 | } | 855 | } |
| 856 | 856 | ||
| 857 | case Bunwind_protect: | 857 | case Bunwind_protect: |
| 858 | /* The function record_unwind_protect can GC. */ | ||
| 859 | BEFORE_POTENTIAL_GC (); | ||
| 860 | record_unwind_protect (Fprogn, POP); | 858 | record_unwind_protect (Fprogn, POP); |
| 861 | AFTER_POTENTIAL_GC (); | ||
| 862 | break; | 859 | break; |
| 863 | 860 | ||
| 864 | case Bcondition_case: | 861 | case Bcondition_case: |
diff --git a/src/dispnew.c b/src/dispnew.c index a89bb0a9bcc..070c9648d1d 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -6358,52 +6358,13 @@ Emacs was built without floating point support. | |||
| 6358 | if (sec < 0 || (sec == 0 && usec == 0)) | 6358 | if (sec < 0 || (sec == 0 && usec == 0)) |
| 6359 | return Qnil; | 6359 | return Qnil; |
| 6360 | 6360 | ||
| 6361 | { | 6361 | wait_reading_process_output (sec, usec, 0, 0, Qnil, NULL, 0); |
| 6362 | Lisp_Object zero; | ||
| 6363 | |||
| 6364 | XSETFASTINT (zero, 0); | ||
| 6365 | wait_reading_process_input (sec, usec, zero, 0); | ||
| 6366 | } | ||
| 6367 | |||
| 6368 | /* We should always have wait_reading_process_input; we have a dummy | ||
| 6369 | implementation for systems which don't support subprocesses. */ | ||
| 6370 | #if 0 | ||
| 6371 | /* No wait_reading_process_input */ | ||
| 6372 | immediate_quit = 1; | ||
| 6373 | QUIT; | ||
| 6374 | |||
| 6375 | #ifdef VMS | ||
| 6376 | sys_sleep (sec); | ||
| 6377 | #else /* not VMS */ | ||
| 6378 | /* The reason this is done this way | ||
| 6379 | (rather than defined (H_S) && defined (H_T)) | ||
| 6380 | is because the VMS preprocessor doesn't grok `defined'. */ | ||
| 6381 | #ifdef HAVE_SELECT | ||
| 6382 | EMACS_GET_TIME (end_time); | ||
| 6383 | EMACS_SET_SECS_USECS (timeout, sec, usec); | ||
| 6384 | EMACS_ADD_TIME (end_time, end_time, timeout); | ||
| 6385 | |||
| 6386 | while (1) | ||
| 6387 | { | ||
| 6388 | EMACS_GET_TIME (timeout); | ||
| 6389 | EMACS_SUB_TIME (timeout, end_time, timeout); | ||
| 6390 | if (EMACS_TIME_NEG_P (timeout) | ||
| 6391 | || !select (1, 0, 0, 0, &timeout)) | ||
| 6392 | break; | ||
| 6393 | } | ||
| 6394 | #else /* not HAVE_SELECT */ | ||
| 6395 | sleep (sec); | ||
| 6396 | #endif /* HAVE_SELECT */ | ||
| 6397 | #endif /* not VMS */ | ||
| 6398 | |||
| 6399 | immediate_quit = 0; | ||
| 6400 | #endif /* no subprocesses */ | ||
| 6401 | 6362 | ||
| 6402 | return Qnil; | 6363 | return Qnil; |
| 6403 | } | 6364 | } |
| 6404 | 6365 | ||
| 6405 | 6366 | ||
| 6406 | /* This is just like wait_reading_process_input, except that | 6367 | /* This is just like wait_reading_process_output, except that |
| 6407 | it does the redisplay. | 6368 | it does the redisplay. |
| 6408 | 6369 | ||
| 6409 | It's also much like Fsit_for, except that it can be used for | 6370 | It's also much like Fsit_for, except that it can be used for |
| @@ -6413,8 +6374,6 @@ Lisp_Object | |||
| 6413 | sit_for (sec, usec, reading, display, initial_display) | 6374 | sit_for (sec, usec, reading, display, initial_display) |
| 6414 | int sec, usec, reading, display, initial_display; | 6375 | int sec, usec, reading, display, initial_display; |
| 6415 | { | 6376 | { |
| 6416 | Lisp_Object read_kbd; | ||
| 6417 | |||
| 6418 | swallow_events (display); | 6377 | swallow_events (display); |
| 6419 | 6378 | ||
| 6420 | if (detect_input_pending_run_timers (display) || !NILP (Vexecuting_macro)) | 6379 | if (detect_input_pending_run_timers (display) || !NILP (Vexecuting_macro)) |
| @@ -6430,8 +6389,8 @@ sit_for (sec, usec, reading, display, initial_display) | |||
| 6430 | gobble_input (0); | 6389 | gobble_input (0); |
| 6431 | #endif | 6390 | #endif |
| 6432 | 6391 | ||
| 6433 | XSETINT (read_kbd, reading ? -1 : 1); | 6392 | wait_reading_process_output (sec, usec, reading ? -1 : 1, display, |
| 6434 | wait_reading_process_input (sec, usec, read_kbd, display); | 6393 | Qnil, NULL, 0); |
| 6435 | 6394 | ||
| 6436 | return detect_input_pending () ? Qnil : Qt; | 6395 | return detect_input_pending () ? Qnil : Qt; |
| 6437 | } | 6396 | } |
diff --git a/src/keyboard.c b/src/keyboard.c index d0b081e5cdd..940802764d2 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -3895,10 +3895,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu) | |||
| 3895 | break; | 3895 | break; |
| 3896 | #endif | 3896 | #endif |
| 3897 | { | 3897 | { |
| 3898 | Lisp_Object minus_one; | 3898 | wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0); |
| 3899 | |||
| 3900 | XSETINT (minus_one, -1); | ||
| 3901 | wait_reading_process_input (0, 0, minus_one, 1); | ||
| 3902 | 3899 | ||
| 3903 | if (!interrupt_input && kbd_fetch_ptr == kbd_store_ptr) | 3900 | if (!interrupt_input && kbd_fetch_ptr == kbd_store_ptr) |
| 3904 | /* Pass 1 for EXPECT since we just waited to have input. */ | 3901 | /* Pass 1 for EXPECT since we just waited to have input. */ |
| @@ -9995,7 +9992,7 @@ clear_input_pending () | |||
| 9995 | } | 9992 | } |
| 9996 | 9993 | ||
| 9997 | /* Return nonzero if there are pending requeued events. | 9994 | /* Return nonzero if there are pending requeued events. |
| 9998 | This isn't used yet. The hope is to make wait_reading_process_input | 9995 | This isn't used yet. The hope is to make wait_reading_process_output |
| 9999 | call it, and return if it runs Lisp code that unreads something. | 9996 | call it, and return if it runs Lisp code that unreads something. |
| 10000 | The problem is, kbd_buffer_get_event needs to be fixed to know what | 9997 | The problem is, kbd_buffer_get_event needs to be fixed to know what |
| 10001 | to do in that case. It isn't trivial. */ | 9998 | to do in that case. It isn't trivial. */ |
diff --git a/src/lisp.h b/src/lisp.h index deb8d6414a2..133c5c07c56 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2964,7 +2964,10 @@ EXFUN (Fprocess_send_eof, 1); | |||
| 2964 | EXFUN (Fwaiting_for_user_input_p, 0); | 2964 | EXFUN (Fwaiting_for_user_input_p, 0); |
| 2965 | extern Lisp_Object Qprocessp; | 2965 | extern Lisp_Object Qprocessp; |
| 2966 | extern void kill_buffer_processes P_ ((Lisp_Object)); | 2966 | extern void kill_buffer_processes P_ ((Lisp_Object)); |
| 2967 | extern int wait_reading_process_input P_ ((int, int, Lisp_Object, int)); | 2967 | extern int wait_reading_process_output P_ ((int, int, int, int, |
| 2968 | Lisp_Object, | ||
| 2969 | struct Lisp_Process *, | ||
| 2970 | int)); | ||
| 2968 | extern void deactivate_process P_ ((Lisp_Object)); | 2971 | extern void deactivate_process P_ ((Lisp_Object)); |
| 2969 | extern void add_keyboard_wait_descriptor P_ ((int)); | 2972 | extern void add_keyboard_wait_descriptor P_ ((int)); |
| 2970 | extern void delete_keyboard_wait_descriptor P_ ((int)); | 2973 | extern void delete_keyboard_wait_descriptor P_ ((int)); |
diff --git a/src/msdos.c b/src/msdos.c index c9fbecf5cb2..8b511abebd7 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -5102,7 +5102,7 @@ dos_yield_time_slice (void) | |||
| 5102 | 5102 | ||
| 5103 | /* Only event queue is checked. */ | 5103 | /* Only event queue is checked. */ |
| 5104 | /* We don't have to call timer_check here | 5104 | /* We don't have to call timer_check here |
| 5105 | because wait_reading_process_input takes care of that. */ | 5105 | because wait_reading_process_output takes care of that. */ |
| 5106 | int | 5106 | int |
| 5107 | sys_select (nfds, rfds, wfds, efds, timeout) | 5107 | sys_select (nfds, rfds, wfds, efds, timeout) |
| 5108 | int nfds; | 5108 | int nfds; |
diff --git a/src/process.c b/src/process.c index 1cebdf07875..dab7bdc3198 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -3777,13 +3777,12 @@ Return non-nil iff we received any output before the timeout expired. */) | |||
| 3777 | else | 3777 | else |
| 3778 | seconds = NILP (process) ? -1 : 0; | 3778 | seconds = NILP (process) ? -1 : 0; |
| 3779 | 3779 | ||
| 3780 | if (NILP (process)) | ||
| 3781 | XSETFASTINT (process, 0); | ||
| 3782 | |||
| 3783 | return | 3780 | return |
| 3784 | (wait_reading_process_input (seconds, useconds, process, | 3781 | (wait_reading_process_output (seconds, useconds, 0, 0, |
| 3785 | NILP (just_this_one) ? 0 : | 3782 | Qnil, |
| 3786 | !INTEGERP (just_this_one) ? -1 : -2) | 3783 | !NILP (process) ? XPROCESS (process) : NULL, |
| 3784 | NILP (just_this_one) ? 0 : | ||
| 3785 | !INTEGERP (just_this_one) ? 1 : -1) | ||
| 3787 | ? Qt : Qnil); | 3786 | ? Qt : Qnil); |
| 3788 | } | 3787 | } |
| 3789 | 3788 | ||
| @@ -3983,12 +3982,12 @@ server_accept_connection (server, channel) | |||
| 3983 | lisp code is being evalled. | 3982 | lisp code is being evalled. |
| 3984 | This is also used in record_asynch_buffer_change. | 3983 | This is also used in record_asynch_buffer_change. |
| 3985 | For that purpose, this must be 0 | 3984 | For that purpose, this must be 0 |
| 3986 | when not inside wait_reading_process_input. */ | 3985 | when not inside wait_reading_process_output. */ |
| 3987 | static int waiting_for_user_input_p; | 3986 | static int waiting_for_user_input_p; |
| 3988 | 3987 | ||
| 3989 | /* This is here so breakpoints can be put on it. */ | 3988 | /* This is here so breakpoints can be put on it. */ |
| 3990 | static void | 3989 | static void |
| 3991 | wait_reading_process_input_1 () | 3990 | wait_reading_process_output_1 () |
| 3992 | { | 3991 | { |
| 3993 | } | 3992 | } |
| 3994 | 3993 | ||
| @@ -4010,28 +4009,32 @@ wait_reading_process_input_1 () | |||
| 4010 | 1 to return when input is available, or | 4009 | 1 to return when input is available, or |
| 4011 | -1 meaning caller will actually read the input, so don't throw to | 4010 | -1 meaning caller will actually read the input, so don't throw to |
| 4012 | the quit handler, or | 4011 | the quit handler, or |
| 4013 | a cons cell, meaning wait until its car is non-nil | 4012 | |
| 4014 | (and gobble terminal input into the buffer if any arrives), or | 4013 | DO_DISPLAY != 0 means redisplay should be done to show subprocess |
| 4015 | a process object, meaning wait until something arrives from that | ||
| 4016 | process. The return value is true iff we read some input from | ||
| 4017 | that process. | ||
| 4018 | |||
| 4019 | If READ_KBD is a process object, DO_DISPLAY < 0 means handle only | ||
| 4020 | output from that process (suspending output from other processes) | ||
| 4021 | and DO_DISPLAY == -2 specifically means don't run any timers either. | ||
| 4022 | Otherwise, != 0 means redisplay should be done to show subprocess | ||
| 4023 | output that arrives. | 4014 | output that arrives. |
| 4024 | 4015 | ||
| 4025 | If READ_KBD is a pointer to a struct Lisp_Process, then the | 4016 | If WAIT_FOR_CELL is a cons cell, wait until its car is non-nil |
| 4026 | function returns true iff we received input from that process | 4017 | (and gobble terminal input into the buffer if any arrives). |
| 4027 | before the timeout elapsed. | 4018 | |
| 4019 | If WAIT_PROC is specified, wait until something arrives from that | ||
| 4020 | process. The return value is true iff we read some input from | ||
| 4021 | that process. | ||
| 4022 | |||
| 4023 | If JUST_WAIT_PROC is non-nil, handle only output from WAIT_PROC | ||
| 4024 | (suspending output from other processes). A negative value | ||
| 4025 | means don't run any timers either. | ||
| 4026 | |||
| 4027 | If WAIT_PROC is specified, then the function returns true iff we | ||
| 4028 | received input from that process before the timeout elapsed. | ||
| 4028 | Otherwise, return true iff we received input from any process. */ | 4029 | Otherwise, return true iff we received input from any process. */ |
| 4029 | 4030 | ||
| 4030 | int | 4031 | int |
| 4031 | wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | 4032 | wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, |
| 4032 | int time_limit, microsecs; | 4033 | wait_for_cell, wait_proc, just_wait_proc) |
| 4033 | Lisp_Object read_kbd; | 4034 | int time_limit, microsecs, read_kbd, do_display; |
| 4034 | int do_display; | 4035 | Lisp_Object wait_for_cell; |
| 4036 | struct Lisp_Process *wait_proc; | ||
| 4037 | int just_wait_proc; | ||
| 4035 | { | 4038 | { |
| 4036 | register int channel, nfds; | 4039 | register int channel, nfds; |
| 4037 | SELECT_TYPE Available; | 4040 | SELECT_TYPE Available; |
| @@ -4041,39 +4044,19 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4041 | Lisp_Object proc; | 4044 | Lisp_Object proc; |
| 4042 | EMACS_TIME timeout, end_time; | 4045 | EMACS_TIME timeout, end_time; |
| 4043 | int wait_channel = -1; | 4046 | int wait_channel = -1; |
| 4044 | struct Lisp_Process *wait_proc = 0; | ||
| 4045 | int just_wait_proc = 0; | ||
| 4046 | int got_some_input = 0; | 4047 | int got_some_input = 0; |
| 4047 | /* Either nil or a cons cell, the car of which is of interest and | 4048 | /* Either nil or a cons cell, the car of which is of interest and |
| 4048 | may be changed outside of this routine. */ | 4049 | may be changed outside of this routine. */ |
| 4049 | Lisp_Object wait_for_cell = Qnil; | ||
| 4050 | int saved_waiting_for_user_input_p = waiting_for_user_input_p; | 4050 | int saved_waiting_for_user_input_p = waiting_for_user_input_p; |
| 4051 | 4051 | ||
| 4052 | FD_ZERO (&Available); | 4052 | FD_ZERO (&Available); |
| 4053 | FD_ZERO (&Connecting); | 4053 | FD_ZERO (&Connecting); |
| 4054 | 4054 | ||
| 4055 | /* If read_kbd is a process to watch, set wait_proc and wait_channel | 4055 | /* If wait_proc is a process to watch, set wait_channel accordingly. */ |
| 4056 | accordingly. */ | 4056 | if (wait_proc != NULL) |
| 4057 | if (PROCESSP (read_kbd)) | 4057 | wait_channel = XINT (wait_proc->infd); |
| 4058 | { | ||
| 4059 | wait_proc = XPROCESS (read_kbd); | ||
| 4060 | wait_channel = XINT (wait_proc->infd); | ||
| 4061 | XSETFASTINT (read_kbd, 0); | ||
| 4062 | if (do_display < 0) | ||
| 4063 | { | ||
| 4064 | just_wait_proc = do_display; | ||
| 4065 | do_display = 0; | ||
| 4066 | } | ||
| 4067 | } | ||
| 4068 | |||
| 4069 | /* If waiting for non-nil in a cell, record where. */ | ||
| 4070 | if (CONSP (read_kbd)) | ||
| 4071 | { | ||
| 4072 | wait_for_cell = read_kbd; | ||
| 4073 | XSETFASTINT (read_kbd, 0); | ||
| 4074 | } | ||
| 4075 | 4058 | ||
| 4076 | waiting_for_user_input_p = XINT (read_kbd); | 4059 | waiting_for_user_input_p = read_kbd; |
| 4077 | 4060 | ||
| 4078 | /* Since we may need to wait several times, | 4061 | /* Since we may need to wait several times, |
| 4079 | compute the absolute time to return at. */ | 4062 | compute the absolute time to return at. */ |
| @@ -4101,7 +4084,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4101 | /* If calling from keyboard input, do not quit | 4084 | /* If calling from keyboard input, do not quit |
| 4102 | since we want to return C-g as an input character. | 4085 | since we want to return C-g as an input character. |
| 4103 | Otherwise, do pending quit if requested. */ | 4086 | Otherwise, do pending quit if requested. */ |
| 4104 | if (XINT (read_kbd) >= 0) | 4087 | if (read_kbd >= 0) |
| 4105 | QUIT; | 4088 | QUIT; |
| 4106 | #ifdef SYNC_INPUT | 4089 | #ifdef SYNC_INPUT |
| 4107 | else if (interrupt_input_pending) | 4090 | else if (interrupt_input_pending) |
| @@ -4139,7 +4122,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4139 | the wait is supposed to be short, | 4122 | the wait is supposed to be short, |
| 4140 | and those callers cannot handle running arbitrary Lisp code here. */ | 4123 | and those callers cannot handle running arbitrary Lisp code here. */ |
| 4141 | if (NILP (wait_for_cell) | 4124 | if (NILP (wait_for_cell) |
| 4142 | && just_wait_proc != -2) | 4125 | && just_wait_proc >= 0) |
| 4143 | { | 4126 | { |
| 4144 | EMACS_TIME timer_delay; | 4127 | EMACS_TIME timer_delay; |
| 4145 | 4128 | ||
| @@ -4167,7 +4150,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4167 | while (!detect_input_pending ()); | 4150 | while (!detect_input_pending ()); |
| 4168 | 4151 | ||
| 4169 | /* If there is unread keyboard input, also return. */ | 4152 | /* If there is unread keyboard input, also return. */ |
| 4170 | if (XINT (read_kbd) != 0 | 4153 | if (read_kbd != 0 |
| 4171 | && requeued_events_pending_p ()) | 4154 | && requeued_events_pending_p ()) |
| 4172 | break; | 4155 | break; |
| 4173 | 4156 | ||
| @@ -4185,7 +4168,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4185 | else if (time_limit != -1) | 4168 | else if (time_limit != -1) |
| 4186 | { | 4169 | { |
| 4187 | /* This is so a breakpoint can be put here. */ | 4170 | /* This is so a breakpoint can be put here. */ |
| 4188 | wait_reading_process_input_1 (); | 4171 | wait_reading_process_output_1 (); |
| 4189 | } | 4172 | } |
| 4190 | } | 4173 | } |
| 4191 | 4174 | ||
| @@ -4195,7 +4178,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4195 | It is important that we do this before checking for process | 4178 | It is important that we do this before checking for process |
| 4196 | activity. If we get a SIGCHLD after the explicit checks for | 4179 | activity. If we get a SIGCHLD after the explicit checks for |
| 4197 | process activity, timeout is the only way we will know. */ | 4180 | process activity, timeout is the only way we will know. */ |
| 4198 | if (XINT (read_kbd) < 0) | 4181 | if (read_kbd < 0) |
| 4199 | set_waiting_for_input (&timeout); | 4182 | set_waiting_for_input (&timeout); |
| 4200 | 4183 | ||
| 4201 | /* If status of something has changed, and no input is | 4184 | /* If status of something has changed, and no input is |
| @@ -4275,8 +4258,10 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4275 | 4258 | ||
| 4276 | /* Wait till there is something to do */ | 4259 | /* Wait till there is something to do */ |
| 4277 | 4260 | ||
| 4278 | if (just_wait_proc) | 4261 | if (wait_proc && just_wait_proc) |
| 4279 | { | 4262 | { |
| 4263 | if (XINT (wait_proc->infd) < 0) /* Terminated */ | ||
| 4264 | break; | ||
| 4280 | FD_SET (XINT (wait_proc->infd), &Available); | 4265 | FD_SET (XINT (wait_proc->infd), &Available); |
| 4281 | check_connect = check_delay = 0; | 4266 | check_connect = check_delay = 0; |
| 4282 | } | 4267 | } |
| @@ -4287,7 +4272,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4287 | } | 4272 | } |
| 4288 | else | 4273 | else |
| 4289 | { | 4274 | { |
| 4290 | if (! XINT (read_kbd)) | 4275 | if (! read_kbd) |
| 4291 | Available = non_keyboard_wait_mask; | 4276 | Available = non_keyboard_wait_mask; |
| 4292 | else | 4277 | else |
| 4293 | Available = input_wait_mask; | 4278 | Available = input_wait_mask; |
| @@ -4304,12 +4289,12 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4304 | { | 4289 | { |
| 4305 | clear_waiting_for_input (); | 4290 | clear_waiting_for_input (); |
| 4306 | redisplay_preserve_echo_area (11); | 4291 | redisplay_preserve_echo_area (11); |
| 4307 | if (XINT (read_kbd) < 0) | 4292 | if (read_kbd < 0) |
| 4308 | set_waiting_for_input (&timeout); | 4293 | set_waiting_for_input (&timeout); |
| 4309 | } | 4294 | } |
| 4310 | 4295 | ||
| 4311 | no_avail = 0; | 4296 | no_avail = 0; |
| 4312 | if (XINT (read_kbd) && detect_input_pending ()) | 4297 | if (read_kbd && detect_input_pending ()) |
| 4313 | { | 4298 | { |
| 4314 | nfds = 0; | 4299 | nfds = 0; |
| 4315 | no_avail = 1; | 4300 | no_avail = 1; |
| @@ -4426,10 +4411,10 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4426 | /* If we are using polling for input, | 4411 | /* If we are using polling for input, |
| 4427 | and we see input available, make it get read now. | 4412 | and we see input available, make it get read now. |
| 4428 | Otherwise it might not actually get read for a second. | 4413 | Otherwise it might not actually get read for a second. |
| 4429 | And on hpux, since we turn off polling in wait_reading_process_input, | 4414 | And on hpux, since we turn off polling in wait_reading_process_output, |
| 4430 | it might never get read at all if we don't spend much time | 4415 | it might never get read at all if we don't spend much time |
| 4431 | outside of wait_reading_process_input. */ | 4416 | outside of wait_reading_process_output. */ |
| 4432 | if (XINT (read_kbd) && interrupt_input | 4417 | if (read_kbd && interrupt_input |
| 4433 | && keyboard_bit_set (&Available) | 4418 | && keyboard_bit_set (&Available) |
| 4434 | && input_polling_used ()) | 4419 | && input_polling_used ()) |
| 4435 | kill (getpid (), SIGALRM); | 4420 | kill (getpid (), SIGALRM); |
| @@ -4439,7 +4424,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4439 | /* If there is any, return immediately | 4424 | /* If there is any, return immediately |
| 4440 | to give it higher priority than subprocesses */ | 4425 | to give it higher priority than subprocesses */ |
| 4441 | 4426 | ||
| 4442 | if (XINT (read_kbd) != 0) | 4427 | if (read_kbd != 0) |
| 4443 | { | 4428 | { |
| 4444 | int old_timers_run = timers_run; | 4429 | int old_timers_run = timers_run; |
| 4445 | struct buffer *old_buffer = current_buffer; | 4430 | struct buffer *old_buffer = current_buffer; |
| @@ -4464,7 +4449,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4464 | } | 4449 | } |
| 4465 | 4450 | ||
| 4466 | /* If there is unread keyboard input, also return. */ | 4451 | /* If there is unread keyboard input, also return. */ |
| 4467 | if (XINT (read_kbd) != 0 | 4452 | if (read_kbd != 0 |
| 4468 | && requeued_events_pending_p ()) | 4453 | && requeued_events_pending_p ()) |
| 4469 | break; | 4454 | break; |
| 4470 | 4455 | ||
| @@ -4475,7 +4460,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4475 | That would causes delays in pasting selections, for example. | 4460 | That would causes delays in pasting selections, for example. |
| 4476 | 4461 | ||
| 4477 | (We used to do this only if wait_for_cell.) */ | 4462 | (We used to do this only if wait_for_cell.) */ |
| 4478 | if (XINT (read_kbd) == 0 && detect_input_pending ()) | 4463 | if (read_kbd == 0 && detect_input_pending ()) |
| 4479 | { | 4464 | { |
| 4480 | swallow_events (do_display); | 4465 | swallow_events (do_display); |
| 4481 | #if 0 /* Exiting when read_kbd doesn't request that seems wrong, though. */ | 4466 | #if 0 /* Exiting when read_kbd doesn't request that seems wrong, though. */ |
| @@ -4494,7 +4479,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4494 | In that case, there really is no input and no SIGIO, | 4479 | In that case, there really is no input and no SIGIO, |
| 4495 | but select says there is input. */ | 4480 | but select says there is input. */ |
| 4496 | 4481 | ||
| 4497 | if (XINT (read_kbd) && interrupt_input | 4482 | if (read_kbd && interrupt_input |
| 4498 | && keyboard_bit_set (&Available) && ! noninteractive) | 4483 | && keyboard_bit_set (&Available) && ! noninteractive) |
| 4499 | kill (getpid (), SIGIO); | 4484 | kill (getpid (), SIGIO); |
| 4500 | #endif | 4485 | #endif |
| @@ -4504,7 +4489,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4504 | 4489 | ||
| 4505 | /* If checking input just got us a size-change event from X, | 4490 | /* If checking input just got us a size-change event from X, |
| 4506 | obey it now if we should. */ | 4491 | obey it now if we should. */ |
| 4507 | if (XINT (read_kbd) || ! NILP (wait_for_cell)) | 4492 | if (read_kbd || ! NILP (wait_for_cell)) |
| 4508 | do_pending_window_change (0); | 4493 | do_pending_window_change (0); |
| 4509 | 4494 | ||
| 4510 | /* Check for data from a process. */ | 4495 | /* Check for data from a process. */ |
| @@ -4679,7 +4664,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4679 | /* If calling from keyboard input, do not quit | 4664 | /* If calling from keyboard input, do not quit |
| 4680 | since we want to return C-g as an input character. | 4665 | since we want to return C-g as an input character. |
| 4681 | Otherwise, do pending quit if requested. */ | 4666 | Otherwise, do pending quit if requested. */ |
| 4682 | if (XINT (read_kbd) >= 0) | 4667 | if (read_kbd >= 0) |
| 4683 | { | 4668 | { |
| 4684 | /* Prevent input_pending from remaining set if we quit. */ | 4669 | /* Prevent input_pending from remaining set if we quit. */ |
| 4685 | clear_input_pending (); | 4670 | clear_input_pending (); |
| @@ -5326,7 +5311,6 @@ send_process (proc, buf, len, object) | |||
| 5326 | that may allow the program | 5311 | that may allow the program |
| 5327 | to finish doing output and read more. */ | 5312 | to finish doing output and read more. */ |
| 5328 | { | 5313 | { |
| 5329 | Lisp_Object zero; | ||
| 5330 | int offset = 0; | 5314 | int offset = 0; |
| 5331 | 5315 | ||
| 5332 | #ifdef BROKEN_PTY_READ_AFTER_EAGAIN | 5316 | #ifdef BROKEN_PTY_READ_AFTER_EAGAIN |
| @@ -5361,11 +5345,10 @@ send_process (proc, buf, len, object) | |||
| 5361 | else if (STRINGP (object)) | 5345 | else if (STRINGP (object)) |
| 5362 | offset = buf - SDATA (object); | 5346 | offset = buf - SDATA (object); |
| 5363 | 5347 | ||
| 5364 | XSETFASTINT (zero, 0); | ||
| 5365 | #ifdef EMACS_HAS_USECS | 5348 | #ifdef EMACS_HAS_USECS |
| 5366 | wait_reading_process_input (0, 20000, zero, 0); | 5349 | wait_reading_process_output (0, 20000, 0, 0, Qnil, NULL, 0); |
| 5367 | #else | 5350 | #else |
| 5368 | wait_reading_process_input (1, 0, zero, 0); | 5351 | wait_reading_process_output (1, 0, 0, 0, Qnil, NULL, 0); |
| 5369 | #endif | 5352 | #endif |
| 5370 | 5353 | ||
| 5371 | if (BUFFERP (object)) | 5354 | if (BUFFERP (object)) |
| @@ -5594,17 +5577,13 @@ process_send_signal (process, signo, current_group, nomsg) | |||
| 5594 | break; | 5577 | break; |
| 5595 | } | 5578 | } |
| 5596 | 5579 | ||
| 5597 | #ifndef _POSIX_VDISABLE | 5580 | if (sig_char && *sig_char != CDISABLE) |
| 5598 | #ifdef CVDISABLE | 5581 | { |
| 5599 | #define _POSIX_VDISABLE CVDISABLE | 5582 | send_process (proc, sig_char, 1, Qnil); |
| 5600 | #else | 5583 | return; |
| 5601 | #define _POSIX_VDISABLE '\0' | 5584 | } |
| 5602 | #endif | 5585 | /* If we can't send the signal with a character, |
| 5603 | #endif | 5586 | fall through and send it another way. */ |
| 5604 | |||
| 5605 | if (sig_char && *sig_char != _POSIX_VDISABLE) | ||
| 5606 | send_process (proc, sig_char, 1, Qnil); | ||
| 5607 | return; | ||
| 5608 | #else /* ! HAVE_TERMIOS */ | 5587 | #else /* ! HAVE_TERMIOS */ |
| 5609 | 5588 | ||
| 5610 | /* On Berkeley descendants, the following IOCTL's retrieve the | 5589 | /* On Berkeley descendants, the following IOCTL's retrieve the |
| @@ -5661,9 +5640,12 @@ process_send_signal (process, signo, current_group, nomsg) | |||
| 5661 | you'd better be using one of the alternatives above! */ | 5640 | you'd better be using one of the alternatives above! */ |
| 5662 | #endif /* ! defined (TCGETA) */ | 5641 | #endif /* ! defined (TCGETA) */ |
| 5663 | #endif /* ! defined (TIOCGLTC) && defined (TIOCGETC) */ | 5642 | #endif /* ! defined (TIOCGLTC) && defined (TIOCGETC) */ |
| 5664 | #endif /* ! defined HAVE_TERMIOS */ | 5643 | /* In this case, the code above should alway returns. */ |
| 5665 | abort (); | 5644 | abort (); |
| 5666 | /* The code above always returns from the function. */ | 5645 | #endif /* ! defined HAVE_TERMIOS */ |
| 5646 | |||
| 5647 | /* The code above may fall through if it can't | ||
| 5648 | handle the signal. */ | ||
| 5667 | #endif /* defined (SIGNALS_VIA_CHARACTERS) */ | 5649 | #endif /* defined (SIGNALS_VIA_CHARACTERS) */ |
| 5668 | 5650 | ||
| 5669 | #ifdef TIOCGPGRP | 5651 | #ifdef TIOCGPGRP |
| @@ -6235,7 +6217,7 @@ sigchld_handler (signo) | |||
| 6235 | FD_CLR (XINT (p->infd), &non_keyboard_wait_mask); | 6217 | FD_CLR (XINT (p->infd), &non_keyboard_wait_mask); |
| 6236 | } | 6218 | } |
| 6237 | 6219 | ||
| 6238 | /* Tell wait_reading_process_input that it needs to wake up and | 6220 | /* Tell wait_reading_process_output that it needs to wake up and |
| 6239 | look around. */ | 6221 | look around. */ |
| 6240 | if (input_available_clear_time) | 6222 | if (input_available_clear_time) |
| 6241 | EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); | 6223 | EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); |
| @@ -6253,7 +6235,7 @@ sigchld_handler (signo) | |||
| 6253 | else if (WIFSIGNALED (w)) | 6235 | else if (WIFSIGNALED (w)) |
| 6254 | synch_process_termsig = WTERMSIG (w); | 6236 | synch_process_termsig = WTERMSIG (w); |
| 6255 | 6237 | ||
| 6256 | /* Tell wait_reading_process_input that it needs to wake up and | 6238 | /* Tell wait_reading_process_output that it needs to wake up and |
| 6257 | look around. */ | 6239 | look around. */ |
| 6258 | if (input_available_clear_time) | 6240 | if (input_available_clear_time) |
| 6259 | EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); | 6241 | EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); |
| @@ -6892,10 +6874,9 @@ Lisp_Object QCtype; | |||
| 6892 | 1 to return when input is available, or | 6874 | 1 to return when input is available, or |
| 6893 | -1 means caller will actually read the input, so don't throw to | 6875 | -1 means caller will actually read the input, so don't throw to |
| 6894 | the quit handler. | 6876 | the quit handler. |
| 6895 | a cons cell, meaning wait until its car is non-nil | 6877 | |
| 6896 | (and gobble terminal input into the buffer if any arrives), or | 6878 | see full version for other parameters. We know that wait_proc will |
| 6897 | We know that read_kbd will never be a Lisp_Process, since | 6879 | always be NULL, since `subprocesses' isn't defined. |
| 6898 | `subprocesses' isn't defined. | ||
| 6899 | 6880 | ||
| 6900 | do_display != 0 means redisplay should be done to show subprocess | 6881 | do_display != 0 means redisplay should be done to show subprocess |
| 6901 | output that arrives. | 6882 | output that arrives. |
| @@ -6903,27 +6884,17 @@ Lisp_Object QCtype; | |||
| 6903 | Return true iff we received input from any process. */ | 6884 | Return true iff we received input from any process. */ |
| 6904 | 6885 | ||
| 6905 | int | 6886 | int |
| 6906 | wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | 6887 | wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, |
| 6907 | int time_limit, microsecs; | 6888 | wait_for_cell, wait_proc, just_wait_proc) |
| 6908 | Lisp_Object read_kbd; | 6889 | int time_limit, microsecs, read_kbd, do_display; |
| 6909 | int do_display; | 6890 | Lisp_Object wait_for_cell; |
| 6891 | struct Lisp_Process *wait_proc; | ||
| 6892 | int just_wait_proc; | ||
| 6910 | { | 6893 | { |
| 6911 | register int nfds; | 6894 | register int nfds; |
| 6912 | EMACS_TIME end_time, timeout; | 6895 | EMACS_TIME end_time, timeout; |
| 6913 | SELECT_TYPE waitchannels; | 6896 | SELECT_TYPE waitchannels; |
| 6914 | int xerrno; | 6897 | int xerrno; |
| 6915 | /* Either nil or a cons cell, the car of which is of interest and | ||
| 6916 | may be changed outside of this routine. */ | ||
| 6917 | Lisp_Object wait_for_cell; | ||
| 6918 | |||
| 6919 | wait_for_cell = Qnil; | ||
| 6920 | |||
| 6921 | /* If waiting for non-nil in a cell, record where. */ | ||
| 6922 | if (CONSP (read_kbd)) | ||
| 6923 | { | ||
| 6924 | wait_for_cell = read_kbd; | ||
| 6925 | XSETFASTINT (read_kbd, 0); | ||
| 6926 | } | ||
| 6927 | 6898 | ||
| 6928 | /* What does time_limit really mean? */ | 6899 | /* What does time_limit really mean? */ |
| 6929 | if (time_limit || microsecs) | 6900 | if (time_limit || microsecs) |
| @@ -6946,7 +6917,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 6946 | /* If calling from keyboard input, do not quit | 6917 | /* If calling from keyboard input, do not quit |
| 6947 | since we want to return C-g as an input character. | 6918 | since we want to return C-g as an input character. |
| 6948 | Otherwise, do pending quit if requested. */ | 6919 | Otherwise, do pending quit if requested. */ |
| 6949 | if (XINT (read_kbd) >= 0) | 6920 | if (read_kbd >= 0) |
| 6950 | QUIT; | 6921 | QUIT; |
| 6951 | 6922 | ||
| 6952 | /* Exit now if the cell we're waiting for became non-nil. */ | 6923 | /* Exit now if the cell we're waiting for became non-nil. */ |
| @@ -6997,7 +6968,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 6997 | while (!detect_input_pending ()); | 6968 | while (!detect_input_pending ()); |
| 6998 | 6969 | ||
| 6999 | /* If there is unread keyboard input, also return. */ | 6970 | /* If there is unread keyboard input, also return. */ |
| 7000 | if (XINT (read_kbd) != 0 | 6971 | if (read_kbd != 0 |
| 7001 | && requeued_events_pending_p ()) | 6972 | && requeued_events_pending_p ()) |
| 7002 | break; | 6973 | break; |
| 7003 | 6974 | ||
| @@ -7015,12 +6986,12 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 7015 | 6986 | ||
| 7016 | /* Cause C-g and alarm signals to take immediate action, | 6987 | /* Cause C-g and alarm signals to take immediate action, |
| 7017 | and cause input available signals to zero out timeout. */ | 6988 | and cause input available signals to zero out timeout. */ |
| 7018 | if (XINT (read_kbd) < 0) | 6989 | if (read_kbd < 0) |
| 7019 | set_waiting_for_input (&timeout); | 6990 | set_waiting_for_input (&timeout); |
| 7020 | 6991 | ||
| 7021 | /* Wait till there is something to do. */ | 6992 | /* Wait till there is something to do. */ |
| 7022 | 6993 | ||
| 7023 | if (! XINT (read_kbd) && NILP (wait_for_cell)) | 6994 | if (! read_kbd && NILP (wait_for_cell)) |
| 7024 | FD_ZERO (&waitchannels); | 6995 | FD_ZERO (&waitchannels); |
| 7025 | else | 6996 | else |
| 7026 | FD_SET (0, &waitchannels); | 6997 | FD_SET (0, &waitchannels); |
| @@ -7031,11 +7002,11 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 7031 | { | 7002 | { |
| 7032 | clear_waiting_for_input (); | 7003 | clear_waiting_for_input (); |
| 7033 | redisplay_preserve_echo_area (15); | 7004 | redisplay_preserve_echo_area (15); |
| 7034 | if (XINT (read_kbd) < 0) | 7005 | if (read_kbd < 0) |
| 7035 | set_waiting_for_input (&timeout); | 7006 | set_waiting_for_input (&timeout); |
| 7036 | } | 7007 | } |
| 7037 | 7008 | ||
| 7038 | if (XINT (read_kbd) && detect_input_pending ()) | 7009 | if (read_kbd && detect_input_pending ()) |
| 7039 | { | 7010 | { |
| 7040 | nfds = 0; | 7011 | nfds = 0; |
| 7041 | FD_ZERO (&waitchannels); | 7012 | FD_ZERO (&waitchannels); |
| @@ -7071,13 +7042,13 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 7071 | kill (getpid (), SIGIO); | 7042 | kill (getpid (), SIGIO); |
| 7072 | #endif | 7043 | #endif |
| 7073 | #ifdef SIGIO | 7044 | #ifdef SIGIO |
| 7074 | if (XINT (read_kbd) && interrupt_input && (waitchannels & 1)) | 7045 | if (read_kbd && interrupt_input && (waitchannels & 1)) |
| 7075 | kill (getpid (), SIGIO); | 7046 | kill (getpid (), SIGIO); |
| 7076 | #endif | 7047 | #endif |
| 7077 | 7048 | ||
| 7078 | /* Check for keyboard input */ | 7049 | /* Check for keyboard input */ |
| 7079 | 7050 | ||
| 7080 | if ((XINT (read_kbd) != 0) | 7051 | if (read_kbd |
| 7081 | && detect_input_pending_run_timers (do_display)) | 7052 | && detect_input_pending_run_timers (do_display)) |
| 7082 | { | 7053 | { |
| 7083 | swallow_events (do_display); | 7054 | swallow_events (do_display); |
| @@ -7086,7 +7057,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 7086 | } | 7057 | } |
| 7087 | 7058 | ||
| 7088 | /* If there is unread keyboard input, also return. */ | 7059 | /* If there is unread keyboard input, also return. */ |
| 7089 | if (XINT (read_kbd) != 0 | 7060 | if (read_kbd |
| 7090 | && requeued_events_pending_p ()) | 7061 | && requeued_events_pending_p ()) |
| 7091 | break; | 7062 | break; |
| 7092 | 7063 | ||
diff --git a/src/syntax.c b/src/syntax.c index 83763061d82..272e9cf1b12 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -292,7 +292,7 @@ char_quoted (charpos, bytepos) | |||
| 292 | 292 | ||
| 293 | DEC_BOTH (charpos, bytepos); | 293 | DEC_BOTH (charpos, bytepos); |
| 294 | 294 | ||
| 295 | while (bytepos >= beg) | 295 | while (charpos >= beg) |
| 296 | { | 296 | { |
| 297 | int c; | 297 | int c; |
| 298 | 298 | ||
| @@ -673,7 +673,7 @@ back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_p | |||
| 673 | { | 673 | { |
| 674 | from = comstart_pos; | 674 | from = comstart_pos; |
| 675 | from_byte = comstart_byte; | 675 | from_byte = comstart_byte; |
| 676 | /* Globals are correct now. */ | 676 | UPDATE_SYNTAX_TABLE_FORWARD (from - 1); |
| 677 | } | 677 | } |
| 678 | else | 678 | else |
| 679 | { | 679 | { |
| @@ -1728,12 +1728,12 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes) | |||
| 1728 | if (negate) | 1728 | if (negate) |
| 1729 | break; | 1729 | break; |
| 1730 | else | 1730 | else |
| 1731 | goto fwd_ok; | 1731 | goto fwd_unibyte_ok; |
| 1732 | } | 1732 | } |
| 1733 | 1733 | ||
| 1734 | if (!fastmap[*p]) | 1734 | if (!fastmap[*p]) |
| 1735 | break; | 1735 | break; |
| 1736 | 1736 | fwd_unibyte_ok: | |
| 1737 | p++, pos++; | 1737 | p++, pos++; |
| 1738 | } | 1738 | } |
| 1739 | } | 1739 | } |
| @@ -1801,12 +1801,12 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes) | |||
| 1801 | if (negate) | 1801 | if (negate) |
| 1802 | break; | 1802 | break; |
| 1803 | else | 1803 | else |
| 1804 | goto fwd_ok; | 1804 | goto back_unibyte_ok; |
| 1805 | } | 1805 | } |
| 1806 | 1806 | ||
| 1807 | if (!fastmap[p[-1]]) | 1807 | if (!fastmap[p[-1]]) |
| 1808 | break; | 1808 | break; |
| 1809 | 1809 | back_unibyte_ok: | |
| 1810 | p--, pos--; | 1810 | p--, pos--; |
| 1811 | } | 1811 | } |
| 1812 | } | 1812 | } |
diff --git a/src/sysdep.c b/src/sysdep.c index 26f433c9a1d..a887b8c2d96 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -610,9 +610,9 @@ child_setup_tty (out) | |||
| 610 | #ifdef SIGNALS_VIA_CHARACTERS | 610 | #ifdef SIGNALS_VIA_CHARACTERS |
| 611 | /* the QUIT and INTR character are used in process_send_signal | 611 | /* the QUIT and INTR character are used in process_send_signal |
| 612 | so set them here to something useful. */ | 612 | so set them here to something useful. */ |
| 613 | if (s.main.c_cc[VQUIT] == 0377) | 613 | if (s.main.c_cc[VQUIT] == CDISABLE) |
| 614 | s.main.c_cc[VQUIT] = '\\'&037; /* Control-\ */ | 614 | s.main.c_cc[VQUIT] = '\\'&037; /* Control-\ */ |
| 615 | if (s.main.c_cc[VINTR] == 0377) | 615 | if (s.main.c_cc[VINTR] == CDISABLE) |
| 616 | s.main.c_cc[VINTR] = 'C'&037; /* Control-C */ | 616 | s.main.c_cc[VINTR] = 'C'&037; /* Control-C */ |
| 617 | #endif /* not SIGNALS_VIA_CHARACTERS */ | 617 | #endif /* not SIGNALS_VIA_CHARACTERS */ |
| 618 | 618 | ||
| @@ -631,11 +631,11 @@ child_setup_tty (out) | |||
| 631 | would force it to 0377. That looks like duplicated code. */ | 631 | would force it to 0377. That looks like duplicated code. */ |
| 632 | #ifndef SIGNALS_VIA_CHARACTERS | 632 | #ifndef SIGNALS_VIA_CHARACTERS |
| 633 | /* QUIT and INTR work better as signals, so disable character forms */ | 633 | /* QUIT and INTR work better as signals, so disable character forms */ |
| 634 | s.main.c_cc[VQUIT] = 0377; | 634 | s.main.c_cc[VQUIT] = CDISABLE; |
| 635 | s.main.c_cc[VINTR] = 0377; | 635 | s.main.c_cc[VINTR] = CDISABLE; |
| 636 | s.main.c_lflag &= ~ISIG; | 636 | s.main.c_lflag &= ~ISIG; |
| 637 | #endif /* no TIOCGPGRP or no TIOCGLTC or no TIOCGETC */ | 637 | #endif /* no TIOCGPGRP or no TIOCGLTC or no TIOCGETC */ |
| 638 | s.main.c_cc[VEOL] = 0377; | 638 | s.main.c_cc[VEOL] = CDISABLE; |
| 639 | s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */ | 639 | s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */ |
| 640 | #endif /* AIX */ | 640 | #endif /* AIX */ |
| 641 | 641 | ||
| @@ -1550,10 +1550,10 @@ nil means don't delete them until `list-processes' is run. */); | |||
| 1550 | tty.main.c_line = 0; | 1550 | tty.main.c_line = 0; |
| 1551 | tty.main.c_iflag &= ~ASCEDIT; | 1551 | tty.main.c_iflag &= ~ASCEDIT; |
| 1552 | #else | 1552 | #else |
| 1553 | tty.main.c_cc[VSTRT] = 255; | 1553 | tty.main.c_cc[VSTRT] = CDISABLE; |
| 1554 | tty.main.c_cc[VSTOP] = 255; | 1554 | tty.main.c_cc[VSTOP] = CDISABLE; |
| 1555 | tty.main.c_cc[VSUSP] = 255; | 1555 | tty.main.c_cc[VSUSP] = CDISABLE; |
| 1556 | tty.main.c_cc[VDSUSP] = 255; | 1556 | tty.main.c_cc[VDSUSP] = CDISABLE; |
| 1557 | #endif /* IBMR2AIX */ | 1557 | #endif /* IBMR2AIX */ |
| 1558 | if (tty_out->flow_control) | 1558 | if (tty_out->flow_control) |
| 1559 | { | 1559 | { |
diff --git a/src/w32proc.c b/src/w32proc.c index 8452337f7e2..9abee2bf0c2 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -1218,7 +1218,7 @@ count_children: | |||
| 1218 | { | 1218 | { |
| 1219 | DebPrint (("select.WaitForMultipleObjects (%d, %lu) failed with %lu\n", | 1219 | DebPrint (("select.WaitForMultipleObjects (%d, %lu) failed with %lu\n", |
| 1220 | nh + nc, timeout_ms, GetLastError ())); | 1220 | nh + nc, timeout_ms, GetLastError ())); |
| 1221 | /* don't return EBADF - this causes wait_reading_process_input to | 1221 | /* don't return EBADF - this causes wait_reading_process_output to |
| 1222 | abort; WAIT_FAILED is returned when single-stepping under | 1222 | abort; WAIT_FAILED is returned when single-stepping under |
| 1223 | Windows 95 after switching thread focus in debugger, and | 1223 | Windows 95 after switching thread focus in debugger, and |
| 1224 | possibly at other times. */ | 1224 | possibly at other times. */ |
diff --git a/src/w32term.c b/src/w32term.c index 9629595561c..0614522a178 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -4570,7 +4570,7 @@ w32_read_socket (sd, expected, hold_quit) | |||
| 4570 | f->async_visible = 1; | 4570 | f->async_visible = 1; |
| 4571 | f->async_iconified = 0; | 4571 | f->async_iconified = 0; |
| 4572 | 4572 | ||
| 4573 | /* wait_reading_process_input will notice this and update | 4573 | /* wait_reading_process_output will notice this and update |
| 4574 | the frame's display structures. */ | 4574 | the frame's display structures. */ |
| 4575 | SET_FRAME_GARBAGED (f); | 4575 | SET_FRAME_GARBAGED (f); |
| 4576 | 4576 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 70854b7d269..7cbc022380d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -10377,7 +10377,7 @@ redisplay_internal (preserve_echo_area) | |||
| 10377 | This is useful in situations where you need to redisplay but no | 10377 | This is useful in situations where you need to redisplay but no |
| 10378 | user action has occurred, making it inappropriate for the message | 10378 | user action has occurred, making it inappropriate for the message |
| 10379 | area to be cleared. See tracking_off and | 10379 | area to be cleared. See tracking_off and |
| 10380 | wait_reading_process_input for examples of these situations. | 10380 | wait_reading_process_output for examples of these situations. |
| 10381 | 10381 | ||
| 10382 | FROM_WHERE is an integer saying from where this function was | 10382 | FROM_WHERE is an integer saying from where this function was |
| 10383 | called. This is useful for debugging. */ | 10383 | called. This is useful for debugging. */ |
diff --git a/src/xfns.c b/src/xfns.c index 7963a910d14..762b45d0089 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1661,7 +1661,7 @@ x_set_name (f, name, explicit) | |||
| 1661 | } | 1661 | } |
| 1662 | #ifdef USE_GTK | 1662 | #ifdef USE_GTK |
| 1663 | gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | 1663 | gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
| 1664 | SDATA (name)); | 1664 | SDATA (ENCODE_UTF_8 (name))); |
| 1665 | #else /* not USE_GTK */ | 1665 | #else /* not USE_GTK */ |
| 1666 | XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text); | 1666 | XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text); |
| 1667 | #endif /* not USE_GTK */ | 1667 | #endif /* not USE_GTK */ |
| @@ -1769,7 +1769,7 @@ x_set_title (f, name, old_name) | |||
| 1769 | 1769 | ||
| 1770 | #ifdef USE_GTK | 1770 | #ifdef USE_GTK |
| 1771 | gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | 1771 | gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
| 1772 | SDATA (name)); | 1772 | SDATA (ENCODE_UTF_8 (name))); |
| 1773 | #else /* not USE_GTK */ | 1773 | #else /* not USE_GTK */ |
| 1774 | XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text); | 1774 | XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text); |
| 1775 | #endif /* not USE_GTK */ | 1775 | #endif /* not USE_GTK */ |
diff --git a/src/xselect.c b/src/xselect.c index 8c8f1f98668..a10befe2cdb 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -1117,7 +1117,8 @@ wait_for_property_change (location) | |||
| 1117 | secs = x_selection_timeout / 1000; | 1117 | secs = x_selection_timeout / 1000; |
| 1118 | usecs = (x_selection_timeout % 1000) * 1000; | 1118 | usecs = (x_selection_timeout % 1000) * 1000; |
| 1119 | TRACE2 (" Waiting %d secs, %d usecs", secs, usecs); | 1119 | TRACE2 (" Waiting %d secs, %d usecs", secs, usecs); |
| 1120 | wait_reading_process_input (secs, usecs, property_change_reply, 0); | 1120 | wait_reading_process_output (secs, usecs, 0, 0, |
| 1121 | property_change_reply, NULL, 0); | ||
| 1121 | 1122 | ||
| 1122 | if (NILP (XCAR (property_change_reply))) | 1123 | if (NILP (XCAR (property_change_reply))) |
| 1123 | { | 1124 | { |
| @@ -1305,7 +1306,8 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp) | |||
| 1305 | secs = x_selection_timeout / 1000; | 1306 | secs = x_selection_timeout / 1000; |
| 1306 | usecs = (x_selection_timeout % 1000) * 1000; | 1307 | usecs = (x_selection_timeout % 1000) * 1000; |
| 1307 | TRACE1 (" Start waiting %d secs for SelectionNotify", secs); | 1308 | TRACE1 (" Start waiting %d secs for SelectionNotify", secs); |
| 1308 | wait_reading_process_input (secs, usecs, reading_selection_reply, 0); | 1309 | wait_reading_process_output (secs, usecs, 0, 0, |
| 1310 | reading_selection_reply, NULL, 0); | ||
| 1309 | TRACE1 (" Got event = %d", !NILP (XCAR (reading_selection_reply))); | 1311 | TRACE1 (" Got event = %d", !NILP (XCAR (reading_selection_reply))); |
| 1310 | 1312 | ||
| 1311 | BLOCK_INPUT; | 1313 | BLOCK_INPUT; |
diff --git a/src/xterm.c b/src/xterm.c index c8b5921a3b5..eb455522d1c 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -6178,7 +6178,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6178 | f = x_top_window_to_frame (dpyinfo, event.xmap.window); | 6178 | f = x_top_window_to_frame (dpyinfo, event.xmap.window); |
| 6179 | if (f) | 6179 | if (f) |
| 6180 | { | 6180 | { |
| 6181 | /* wait_reading_process_input will notice this and update | 6181 | /* wait_reading_process_output will notice this and update |
| 6182 | the frame's display structures. | 6182 | the frame's display structures. |
| 6183 | If we where iconified, we should not set garbaged, | 6183 | If we where iconified, we should not set garbaged, |
| 6184 | because that stops redrawing on Expose events. This looks | 6184 | because that stops redrawing on Expose events. This looks |