diff options
| author | Kenichi Handa | 2010-07-14 12:52:10 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2010-07-14 12:52:10 +0900 |
| commit | 73a4405a3539be595a6360c9e207d6ee2995a0c4 (patch) | |
| tree | bc88158d4b38262950717832d2a4bea2ab6c6409 /src | |
| parent | f6c1c771dee561ddc00a114d17c44d8edeaf2f77 (diff) | |
| parent | 0c4371fe36c081259c29f6952c1b83b0dcddc3d6 (diff) | |
| download | emacs-73a4405a3539be595a6360c9e207d6ee2995a0c4.tar.gz emacs-73a4405a3539be595a6360c9e207d6ee2995a0c4.zip | |
merge trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 31 | ||||
| -rw-r--r-- | src/callproc.c | 8 | ||||
| -rw-r--r-- | src/emacs.c | 2 | ||||
| -rw-r--r-- | src/keyboard.c | 9 | ||||
| -rw-r--r-- | src/process.c | 32 | ||||
| -rw-r--r-- | src/sysdep.c | 33 | ||||
| -rw-r--r-- | src/xdisp.c | 2 |
7 files changed, 61 insertions, 56 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4fe34cb5944..74931328585 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -3,6 +3,37 @@ | |||
| 3 | * font.c (font_open_entity): Cancel previous change. | 3 | * font.c (font_open_entity): Cancel previous change. |
| 4 | (Ffont_get): Don't check FONT_ENTITY_INDEX of a font-object. | 4 | (Ffont_get): Don't check FONT_ENTITY_INDEX of a font-object. |
| 5 | 5 | ||
| 6 | 2010-07-13 Eli Zaretskii <eliz@gnu.org> | ||
| 7 | |||
| 8 | Remove subprocesses #ifdefs. | ||
| 9 | * process.c <inhibit_sentinels>: Move to the common part. | ||
| 10 | (Fwaiting_for_user_input_p): Move to the common part; return nil | ||
| 11 | if async subprocesses aren't supported. | ||
| 12 | * sysdep.c (wait_for_termination) [!MSDOS]: Don't compile on | ||
| 13 | MS-DOS. Remove "#ifdef subprocesses". | ||
| 14 | (sys_subshell, sys_select): Remove "#ifdef subprocesses". | ||
| 15 | (gettimeofday): Remove "#ifdef subprocesses". | ||
| 16 | (wait_without_blocking): Remove function. | ||
| 17 | (flush_pending_output, child_setup_tty): Don't compile on MS-DOS. | ||
| 18 | Remove "#ifdef subprocesses". | ||
| 19 | (child_setup_tty): Use WINDOWSNT instead of DOS_NT, since not | ||
| 20 | compiled on MS-DOS. | ||
| 21 | * callproc.c (Fcall_process) [!MSDOS]: Don't call | ||
| 22 | wait_for_termination on MS-DOS. | ||
| 23 | * emacs.c (shut_down_emacs): Remove "#ifndef subprocesses" from | ||
| 24 | initialization of inhibit_sentinels. | ||
| 25 | * keyboard.c (record_asynch_buffer_change): Remove "#ifdef | ||
| 26 | subprocesses" conditional. | ||
| 27 | * callproc.c (Fcall_process) [!subprocesses]: Don't call | ||
| 28 | wait_for_termination, since `buffer' cannot be an integer when | ||
| 29 | async subprocesses are not supported | ||
| 30 | * xdisp.c (decode_mode_spec): Use `MSDOS' instead of `subprocesses' | ||
| 31 | for ifdefing away the call to Fprocess_status. | ||
| 32 | |||
| 33 | * process.c (add_keyboard_wait_descriptor) [!subprocesses]: Ifdef | ||
| 34 | away the entire body of the function. | ||
| 35 | >>>>>>> MERGE-SOURCE | ||
| 36 | |||
| 6 | 2010-07-13 Dan Nicolaescu <dann@ics.uci.edu> | 37 | 2010-07-13 Dan Nicolaescu <dann@ics.uci.edu> |
| 7 | 38 | ||
| 8 | Remove subprocesses #ifdefs from term.c. | 39 | Remove subprocesses #ifdefs from term.c. |
diff --git a/src/callproc.c b/src/callproc.c index fd2cf6356ec..4286ab1ae29 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -612,12 +612,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 612 | { | 612 | { |
| 613 | if (fd[0] >= 0) | 613 | if (fd[0] >= 0) |
| 614 | emacs_close (fd[0]); | 614 | emacs_close (fd[0]); |
| 615 | #ifndef subprocesses | ||
| 616 | /* If Emacs has been built with asynchronous subprocess support, | ||
| 617 | we don't need to do this, I think because it will then have | ||
| 618 | the facilities for handling SIGCHLD. */ | ||
| 619 | wait_without_blocking (); | ||
| 620 | #endif /* subprocesses */ | ||
| 621 | return Qnil; | 615 | return Qnil; |
| 622 | } | 616 | } |
| 623 | 617 | ||
| @@ -811,8 +805,10 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 811 | make_number (total_read)); | 805 | make_number (total_read)); |
| 812 | } | 806 | } |
| 813 | 807 | ||
| 808 | #ifndef MSDOS | ||
| 814 | /* Wait for it to terminate, unless it already has. */ | 809 | /* Wait for it to terminate, unless it already has. */ |
| 815 | wait_for_termination (pid); | 810 | wait_for_termination (pid); |
| 811 | #endif | ||
| 816 | 812 | ||
| 817 | immediate_quit = 0; | 813 | immediate_quit = 0; |
| 818 | 814 | ||
diff --git a/src/emacs.c b/src/emacs.c index f5cd46cfc27..fbae7763877 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -2130,9 +2130,7 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff) | |||
| 2130 | 2130 | ||
| 2131 | stuff_buffered_input (stuff); | 2131 | stuff_buffered_input (stuff); |
| 2132 | 2132 | ||
| 2133 | #ifdef subprocesses | ||
| 2134 | inhibit_sentinels = 1; | 2133 | inhibit_sentinels = 1; |
| 2135 | #endif | ||
| 2136 | kill_buffer_processes (Qnil); | 2134 | kill_buffer_processes (Qnil); |
| 2137 | Fdo_auto_save (Qt, Qnil); | 2135 | Fdo_auto_save (Qt, Qnil); |
| 2138 | 2136 | ||
diff --git a/src/keyboard.c b/src/keyboard.c index 4ce915d28ab..c2f010cf4e7 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -6901,18 +6901,15 @@ record_asynch_buffer_change (void) | |||
| 6901 | event.frame_or_window = Qnil; | 6901 | event.frame_or_window = Qnil; |
| 6902 | event.arg = Qnil; | 6902 | event.arg = Qnil; |
| 6903 | 6903 | ||
| 6904 | #ifdef subprocesses | ||
| 6905 | /* We don't need a buffer-switch event unless Emacs is waiting for input. | 6904 | /* We don't need a buffer-switch event unless Emacs is waiting for input. |
| 6906 | The purpose of the event is to make read_key_sequence look up the | 6905 | The purpose of the event is to make read_key_sequence look up the |
| 6907 | keymaps again. If we aren't in read_key_sequence, we don't need one, | 6906 | keymaps again. If we aren't in read_key_sequence, we don't need one, |
| 6908 | and the event could cause trouble by messing up (input-pending-p). */ | 6907 | and the event could cause trouble by messing up (input-pending-p). |
| 6908 | Note: Fwaiting_for_user_input_p always returns nil when async | ||
| 6909 | subprocesses aren't supported. */ | ||
| 6909 | tem = Fwaiting_for_user_input_p (); | 6910 | tem = Fwaiting_for_user_input_p (); |
| 6910 | if (NILP (tem)) | 6911 | if (NILP (tem)) |
| 6911 | return; | 6912 | return; |
| 6912 | #else | ||
| 6913 | /* We never need these events if we have no asynchronous subprocesses. */ | ||
| 6914 | return; | ||
| 6915 | #endif | ||
| 6916 | 6913 | ||
| 6917 | /* Make sure no interrupt happens while storing the event. */ | 6914 | /* Make sure no interrupt happens while storing the event. */ |
| 6918 | #ifdef SIGIO | 6915 | #ifdef SIGIO |
diff --git a/src/process.c b/src/process.c index 275f3c15898..219098905cf 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -304,6 +304,10 @@ static int kbd_is_on_hold; | |||
| 304 | /* Nonzero means delete a process right away if it exits. */ | 304 | /* Nonzero means delete a process right away if it exits. */ |
| 305 | static int delete_exited_processes; | 305 | static int delete_exited_processes; |
| 306 | 306 | ||
| 307 | /* Nonzero means don't run process sentinels. This is used | ||
| 308 | when exiting. */ | ||
| 309 | int inhibit_sentinels; | ||
| 310 | |||
| 307 | #ifdef subprocesses | 311 | #ifdef subprocesses |
| 308 | 312 | ||
| 309 | /* Mask of bits indicating the descriptors that we wait for input on. */ | 313 | /* Mask of bits indicating the descriptors that we wait for input on. */ |
| @@ -381,10 +385,6 @@ struct sockaddr_and_len { | |||
| 381 | /* Maximum number of bytes to send to a pty without an eof. */ | 385 | /* Maximum number of bytes to send to a pty without an eof. */ |
| 382 | static int pty_max_bytes; | 386 | static int pty_max_bytes; |
| 383 | 387 | ||
| 384 | /* Nonzero means don't run process sentinels. This is used | ||
| 385 | when exiting. */ | ||
| 386 | int inhibit_sentinels; | ||
| 387 | |||
| 388 | #ifdef HAVE_PTYS | 388 | #ifdef HAVE_PTYS |
| 389 | #ifdef HAVE_PTY_H | 389 | #ifdef HAVE_PTY_H |
| 390 | #include <pty.h> | 390 | #include <pty.h> |
| @@ -5433,15 +5433,6 @@ read_process_output (Lisp_Object proc, register int channel) | |||
| 5433 | unbind_to (count, Qnil); | 5433 | unbind_to (count, Qnil); |
| 5434 | return nbytes; | 5434 | return nbytes; |
| 5435 | } | 5435 | } |
| 5436 | |||
| 5437 | DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, Swaiting_for_user_input_p, | ||
| 5438 | 0, 0, 0, | ||
| 5439 | doc: /* Returns non-nil if Emacs is waiting for input from the user. | ||
| 5440 | This is intended for use by asynchronous process output filters and sentinels. */) | ||
| 5441 | (void) | ||
| 5442 | { | ||
| 5443 | return (waiting_for_user_input_p ? Qt : Qnil); | ||
| 5444 | } | ||
| 5445 | 5436 | ||
| 5446 | /* Sending data to subprocess */ | 5437 | /* Sending data to subprocess */ |
| 5447 | 5438 | ||
| @@ -7122,10 +7113,12 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, | |||
| 7122 | void | 7113 | void |
| 7123 | add_keyboard_wait_descriptor (int desc) | 7114 | add_keyboard_wait_descriptor (int desc) |
| 7124 | { | 7115 | { |
| 7116 | #ifdef subprocesses | ||
| 7125 | FD_SET (desc, &input_wait_mask); | 7117 | FD_SET (desc, &input_wait_mask); |
| 7126 | FD_SET (desc, &non_process_wait_mask); | 7118 | FD_SET (desc, &non_process_wait_mask); |
| 7127 | if (desc > max_keyboard_desc) | 7119 | if (desc > max_keyboard_desc) |
| 7128 | max_keyboard_desc = desc; | 7120 | max_keyboard_desc = desc; |
| 7121 | #endif | ||
| 7129 | } | 7122 | } |
| 7130 | 7123 | ||
| 7131 | /* From now on, do not expect DESC to give keyboard input. */ | 7124 | /* From now on, do not expect DESC to give keyboard input. */ |
| @@ -7277,6 +7270,19 @@ kill_buffer_processes (Lisp_Object buffer) | |||
| 7277 | #endif /* subprocesses */ | 7270 | #endif /* subprocesses */ |
| 7278 | } | 7271 | } |
| 7279 | 7272 | ||
| 7273 | DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, Swaiting_for_user_input_p, | ||
| 7274 | 0, 0, 0, | ||
| 7275 | doc: /* Returns non-nil if Emacs is waiting for input from the user. | ||
| 7276 | This is intended for use by asynchronous process output filters and sentinels. */) | ||
| 7277 | (void) | ||
| 7278 | { | ||
| 7279 | #ifdef subprocesses | ||
| 7280 | return (waiting_for_user_input_p ? Qt : Qnil); | ||
| 7281 | #else | ||
| 7282 | return Qnil; | ||
| 7283 | #endif | ||
| 7284 | } | ||
| 7285 | |||
| 7280 | /* Stop reading input from keyboard sources. */ | 7286 | /* Stop reading input from keyboard sources. */ |
| 7281 | 7287 | ||
| 7282 | void | 7288 | void |
diff --git a/src/sysdep.c b/src/sysdep.c index e45664a8bd6..d720c7c5811 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -355,16 +355,6 @@ set_exclusive_use (int fd) | |||
| 355 | /* Ok to do nothing if this feature does not exist */ | 355 | /* Ok to do nothing if this feature does not exist */ |
| 356 | } | 356 | } |
| 357 | 357 | ||
| 358 | #ifndef subprocesses | ||
| 359 | |||
| 360 | void | ||
| 361 | wait_without_blocking (void) | ||
| 362 | { | ||
| 363 | croak ("wait_without_blocking"); | ||
| 364 | synch_process_alive = 0; | ||
| 365 | } | ||
| 366 | |||
| 367 | #endif /* not subprocesses */ | ||
| 368 | 358 | ||
| 369 | int wait_debugging; /* Set nonzero to make following function work under dbx | 359 | int wait_debugging; /* Set nonzero to make following function work under dbx |
| 370 | (at least for bsd). */ | 360 | (at least for bsd). */ |
| @@ -373,6 +363,7 @@ SIGTYPE | |||
| 373 | wait_for_termination_signal (void) | 363 | wait_for_termination_signal (void) |
| 374 | {} | 364 | {} |
| 375 | 365 | ||
| 366 | #ifndef MSDOS | ||
| 376 | /* Wait for subprocess with process id `pid' to terminate and | 367 | /* Wait for subprocess with process id `pid' to terminate and |
| 377 | make sure it will get eliminated (not remain forever as a zombie) */ | 368 | make sure it will get eliminated (not remain forever as a zombie) */ |
| 378 | 369 | ||
| @@ -381,7 +372,6 @@ wait_for_termination (int pid) | |||
| 381 | { | 372 | { |
| 382 | while (1) | 373 | while (1) |
| 383 | { | 374 | { |
| 384 | #ifdef subprocesses | ||
| 385 | #if defined (BSD_SYSTEM) || defined (HPUX) | 375 | #if defined (BSD_SYSTEM) || defined (HPUX) |
| 386 | /* Note that kill returns -1 even if the process is just a zombie now. | 376 | /* Note that kill returns -1 even if the process is just a zombie now. |
| 387 | But inevitably a SIGCHLD interrupt should be generated | 377 | But inevitably a SIGCHLD interrupt should be generated |
| @@ -417,14 +407,9 @@ wait_for_termination (int pid) | |||
| 417 | sigsuspend (&empty_mask); | 407 | sigsuspend (&empty_mask); |
| 418 | #endif /* not WINDOWSNT */ | 408 | #endif /* not WINDOWSNT */ |
| 419 | #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ | 409 | #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ |
| 420 | #else /* not subprocesses */ | ||
| 421 | break; | ||
| 422 | #endif /* not subprocesses */ | ||
| 423 | } | 410 | } |
| 424 | } | 411 | } |
| 425 | 412 | ||
| 426 | #ifdef subprocesses | ||
| 427 | |||
| 428 | /* | 413 | /* |
| 429 | * flush any pending output | 414 | * flush any pending output |
| 430 | * (may flush input as well; it does not matter the way we use it) | 415 | * (may flush input as well; it does not matter the way we use it) |
| @@ -459,7 +444,7 @@ flush_pending_output (int channel) | |||
| 459 | void | 444 | void |
| 460 | child_setup_tty (int out) | 445 | child_setup_tty (int out) |
| 461 | { | 446 | { |
| 462 | #ifndef DOS_NT | 447 | #ifndef WINDOWSNT |
| 463 | struct emacs_tty s; | 448 | struct emacs_tty s; |
| 464 | 449 | ||
| 465 | EMACS_GET_TTY (out, &s); | 450 | EMACS_GET_TTY (out, &s); |
| @@ -543,10 +528,10 @@ child_setup_tty (int out) | |||
| 543 | 528 | ||
| 544 | EMACS_SET_TTY (out, &s, 0); | 529 | EMACS_SET_TTY (out, &s, 0); |
| 545 | 530 | ||
| 546 | #endif /* not DOS_NT */ | 531 | #endif /* not WINDOWSNT */ |
| 547 | } | 532 | } |
| 533 | #endif /* MSDOS */ | ||
| 548 | 534 | ||
| 549 | #endif /* subprocesses */ | ||
| 550 | 535 | ||
| 551 | /* Record a signal code and the handler for it. */ | 536 | /* Record a signal code and the handler for it. */ |
| 552 | struct save_signal | 537 | struct save_signal |
| @@ -650,9 +635,7 @@ sys_subshell (void) | |||
| 650 | if (str) | 635 | if (str) |
| 651 | chdir ((char *) str); | 636 | chdir ((char *) str); |
| 652 | 637 | ||
| 653 | #ifdef subprocesses | ||
| 654 | close_process_descs (); /* Close Emacs's pipes/ptys */ | 638 | close_process_descs (); /* Close Emacs's pipes/ptys */ |
| 655 | #endif | ||
| 656 | 639 | ||
| 657 | #ifdef SET_EMACS_PRIORITY | 640 | #ifdef SET_EMACS_PRIORITY |
| 658 | { | 641 | { |
| @@ -1699,11 +1682,7 @@ sys_select (int nfds, | |||
| 1699 | int timeoutval; | 1682 | int timeoutval; |
| 1700 | int *local_timeout; | 1683 | int *local_timeout; |
| 1701 | extern int proc_buffered_char[]; | 1684 | extern int proc_buffered_char[]; |
| 1702 | #ifndef subprocesses | ||
| 1703 | int process_tick = 0, update_tick = 0; | ||
| 1704 | #else | ||
| 1705 | extern int process_tick, update_tick; | 1685 | extern int process_tick, update_tick; |
| 1706 | #endif | ||
| 1707 | unsigned char buf; | 1686 | unsigned char buf; |
| 1708 | 1687 | ||
| 1709 | #if defined (HAVE_SELECT) && defined (HAVE_X_WINDOWS) | 1688 | #if defined (HAVE_SELECT) && defined (HAVE_X_WINDOWS) |
| @@ -2433,7 +2412,6 @@ dup2 (int oldd, int newd) | |||
| 2433 | * Only needed when subprocesses are defined. | 2412 | * Only needed when subprocesses are defined. |
| 2434 | */ | 2413 | */ |
| 2435 | 2414 | ||
| 2436 | #ifdef subprocesses | ||
| 2437 | #ifndef HAVE_GETTIMEOFDAY | 2415 | #ifndef HAVE_GETTIMEOFDAY |
| 2438 | #ifdef HAVE_TIMEVAL | 2416 | #ifdef HAVE_TIMEVAL |
| 2439 | 2417 | ||
| @@ -2451,8 +2429,7 @@ gettimeofday (struct timeval *tp, struct timezone *tzp) | |||
| 2451 | } | 2429 | } |
| 2452 | 2430 | ||
| 2453 | #endif | 2431 | #endif |
| 2454 | #endif | 2432 | #endif /* !HAVE_GETTIMEOFDAY && HAVE_TIMEVAL */ |
| 2455 | #endif /* subprocess && !HAVE_GETTIMEOFDAY && HAVE_TIMEVAL */ | ||
| 2456 | 2433 | ||
| 2457 | /* | 2434 | /* |
| 2458 | * This function will go away as soon as all the stubs fixed. (fnf) | 2435 | * This function will go away as soon as all the stubs fixed. (fnf) |
diff --git a/src/xdisp.c b/src/xdisp.c index 8879fa41b75..3464efd6435 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -19597,7 +19597,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 19597 | obj = Fget_buffer_process (Fcurrent_buffer ()); | 19597 | obj = Fget_buffer_process (Fcurrent_buffer ()); |
| 19598 | if (NILP (obj)) | 19598 | if (NILP (obj)) |
| 19599 | return "no process"; | 19599 | return "no process"; |
| 19600 | #ifdef subprocesses | 19600 | #ifndef MSDOS |
| 19601 | obj = Fsymbol_name (Fprocess_status (obj)); | 19601 | obj = Fsymbol_name (Fprocess_status (obj)); |
| 19602 | #endif | 19602 | #endif |
| 19603 | break; | 19603 | break; |