diff options
| author | Richard M. Stallman | 2002-07-12 23:32:14 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-07-12 23:32:14 +0000 |
| commit | edc590bb8a77290f9963b2d0f8520b4cbe7484d6 (patch) | |
| tree | 6c0be278560963a4d3e72cf31e1c4ca1a1f62bf3 | |
| parent | ce218967c1fc2bc5a1ec96281d05d0e17058e28c (diff) | |
| download | emacs-edc590bb8a77290f9963b2d0f8520b4cbe7484d6.tar.gz emacs-edc590bb8a77290f9963b2d0f8520b4cbe7484d6.zip | |
Move the node Query Before Exit down.
Say that Emacs stops reading when a process terminates.
| -rw-r--r-- | lispref/processes.texi | 113 |
1 files changed, 59 insertions, 54 deletions
diff --git a/lispref/processes.texi b/lispref/processes.texi index 0b5786f2cd8..1ccc449f4e3 100644 --- a/lispref/processes.texi +++ b/lispref/processes.texi | |||
| @@ -43,9 +43,9 @@ This function returns @code{t} if @var{object} is a process, | |||
| 43 | * Input to Processes:: Sending input to an asynchronous subprocess. | 43 | * Input to Processes:: Sending input to an asynchronous subprocess. |
| 44 | * Signals to Processes:: Stopping, continuing or interrupting | 44 | * Signals to Processes:: Stopping, continuing or interrupting |
| 45 | an asynchronous subprocess. | 45 | an asynchronous subprocess. |
| 46 | * Query Before Exit:: Whether to query if exiting will kill a process. | ||
| 47 | * Output from Processes:: Collecting output from an asynchronous subprocess. | 46 | * Output from Processes:: Collecting output from an asynchronous subprocess. |
| 48 | * Sentinels:: Sentinels run when process run-status changes. | 47 | * Sentinels:: Sentinels run when process run-status changes. |
| 48 | * Query Before Exit:: Whether to query if exiting will kill a process. | ||
| 49 | * Transaction Queues:: Transaction-based communication with subprocesses. | 49 | * Transaction Queues:: Transaction-based communication with subprocesses. |
| 50 | * Network:: Opening network connections. | 50 | * Network:: Opening network connections. |
| 51 | @end menu | 51 | @end menu |
| @@ -460,7 +460,7 @@ often better to use a pipe, because they are more efficient. In | |||
| 460 | addition, the total number of @sc{pty}s is limited on many systems and | 460 | addition, the total number of @sc{pty}s is limited on many systems and |
| 461 | it is good not to waste them. | 461 | it is good not to waste them. |
| 462 | 462 | ||
| 463 | The value of @code{process-connection-type} is used when | 463 | The value of @code{process-connection-type} takes effect when |
| 464 | @code{start-process} is called. So you can specify how to communicate | 464 | @code{start-process} is called. So you can specify how to communicate |
| 465 | with one subprocess by binding the variable around the call to | 465 | with one subprocess by binding the variable around the call to |
| 466 | @code{start-process}. | 466 | @code{start-process}. |
| @@ -486,8 +486,8 @@ subprocess. Processes are deleted automatically after they terminate, | |||
| 486 | but not necessarily right away. You can delete a process explicitly | 486 | but not necessarily right away. You can delete a process explicitly |
| 487 | at any time. If you delete a terminated process explicitly before it | 487 | at any time. If you delete a terminated process explicitly before it |
| 488 | is deleted automatically, no harm results. Deletion of a running | 488 | is deleted automatically, no harm results. Deletion of a running |
| 489 | process sends a signal to terminate it and calls the process sentinel | 489 | process sends a signal to terminate it (and its child processes if |
| 490 | if it has one. | 490 | any), and calls the process sentinel if it has one. |
| 491 | 491 | ||
| 492 | @code{get-buffer-process} and @code{process-list} do not remember a | 492 | @code{get-buffer-process} and @code{process-list} do not remember a |
| 493 | deleted process, but the process object itself continues to exist as | 493 | deleted process, but the process object itself continues to exist as |
| @@ -855,56 +855,6 @@ a child of Emacs. The argument @var{signal} specifies which signal | |||
| 855 | to send; it should be an integer. | 855 | to send; it should be an integer. |
| 856 | @end defun | 856 | @end defun |
| 857 | 857 | ||
| 858 | @node Query Before Exit | ||
| 859 | @section Querying Before Exit | ||
| 860 | |||
| 861 | When Emacs exits, it terminates all its subprocesses by sending them | ||
| 862 | the @code{SIGHUP} signal. Because some subprocesses are doing | ||
| 863 | valuable work, Emacs normally asks the user to confirm that it is ok | ||
| 864 | to terminate them. Each process has a query flag which, if | ||
| 865 | non-@code{nil}, says that Emacs should ask for confirmation before | ||
| 866 | exiting and thus killing that process. The default for the query flag | ||
| 867 | is @code{t}, meaning @emph{do} query. | ||
| 868 | |||
| 869 | @tindex process-query-on-exit-flag | ||
| 870 | @defun process-query-on-exit-flag process | ||
| 871 | This returns the query flag of @var{process}. | ||
| 872 | @end defun | ||
| 873 | |||
| 874 | @tindex set-process-query-on-exit-flag | ||
| 875 | @defun set-process-query-on-exit-flag process flag | ||
| 876 | This function sets the query flag of @var{process} to @var{flag}. It | ||
| 877 | returns @var{flag}. | ||
| 878 | |||
| 879 | @smallexample | ||
| 880 | @group | ||
| 881 | ;; @r{Don't query about the shell process} | ||
| 882 | (set-process-query-on-exit-flag (get-process "shell") nil) | ||
| 883 | @result{} t | ||
| 884 | @end group | ||
| 885 | @end smallexample | ||
| 886 | @end defun | ||
| 887 | |||
| 888 | @defun process-kill-without-query process &optional do-query | ||
| 889 | This function clears the query flag of @var{process}, so that | ||
| 890 | Emacs will not query the user on account of that process. | ||
| 891 | |||
| 892 | Actually, the function does more than that: it returns the old value of | ||
| 893 | the process's query flag, and sets the query flag to @var{do-query}. | ||
| 894 | Please don't use this function to do those things any more---please | ||
| 895 | use the newer, cleaner functions @code{process-query-on-exit-flag} and | ||
| 896 | @code{set-process-query-on-exit-flag} in all but the simplest cases. | ||
| 897 | The only way you should use @code{process-kill-without-query} nowadays | ||
| 898 | is like this: | ||
| 899 | |||
| 900 | @smallexample | ||
| 901 | @group | ||
| 902 | ;; @r{Don't query about the shell process} | ||
| 903 | (process-kill-without-query (get-process "shell")) | ||
| 904 | @end group | ||
| 905 | @end smallexample | ||
| 906 | @end defun | ||
| 907 | |||
| 908 | @node Output from Processes | 858 | @node Output from Processes |
| 909 | @section Receiving Output from Processes | 859 | @section Receiving Output from Processes |
| 910 | @cindex process output | 860 | @cindex process output |
| @@ -917,6 +867,11 @@ called the @dfn{filter function} can be called to act on the output. If | |||
| 917 | the process has no buffer and no filter function, its output is | 867 | the process has no buffer and no filter function, its output is |
| 918 | discarded. | 868 | discarded. |
| 919 | 869 | ||
| 870 | When a subprocess terminates, Emacs reads any pending output, | ||
| 871 | then stops reading output from that subprocess. Therefore, if the | ||
| 872 | subprocess has children that are still live and still producing | ||
| 873 | output, Emacs won't receive that output. | ||
| 874 | |||
| 920 | Output from a subprocess can arrive only while Emacs is waiting: when | 875 | Output from a subprocess can arrive only while Emacs is waiting: when |
| 921 | reading terminal input, in @code{sit-for} and @code{sleep-for} | 876 | reading terminal input, in @code{sit-for} and @code{sleep-for} |
| 922 | (@pxref{Waiting}), and in @code{accept-process-output} (@pxref{Accepting | 877 | (@pxref{Waiting}), and in @code{accept-process-output} (@pxref{Accepting |
| @@ -1345,6 +1300,56 @@ the time the sentinel or filter function was called, @code{nil} if it | |||
| 1345 | was not. | 1300 | was not. |
| 1346 | @end defun | 1301 | @end defun |
| 1347 | 1302 | ||
| 1303 | @node Query Before Exit | ||
| 1304 | @section Querying Before Exit | ||
| 1305 | |||
| 1306 | When Emacs exits, it terminates all its subprocesses by sending them | ||
| 1307 | the @code{SIGHUP} signal. Because some subprocesses are doing | ||
| 1308 | valuable work, Emacs normally asks the user to confirm that it is ok | ||
| 1309 | to terminate them. Each process has a query flag which, if | ||
| 1310 | non-@code{nil}, says that Emacs should ask for confirmation before | ||
| 1311 | exiting and thus killing that process. The default for the query flag | ||
| 1312 | is @code{t}, meaning @emph{do} query. | ||
| 1313 | |||
| 1314 | @tindex process-query-on-exit-flag | ||
| 1315 | @defun process-query-on-exit-flag process | ||
| 1316 | This returns the query flag of @var{process}. | ||
| 1317 | @end defun | ||
| 1318 | |||
| 1319 | @tindex set-process-query-on-exit-flag | ||
| 1320 | @defun set-process-query-on-exit-flag process flag | ||
| 1321 | This function sets the query flag of @var{process} to @var{flag}. It | ||
| 1322 | returns @var{flag}. | ||
| 1323 | |||
| 1324 | @smallexample | ||
| 1325 | @group | ||
| 1326 | ;; @r{Don't query about the shell process} | ||
| 1327 | (set-process-query-on-exit-flag (get-process "shell") nil) | ||
| 1328 | @result{} t | ||
| 1329 | @end group | ||
| 1330 | @end smallexample | ||
| 1331 | @end defun | ||
| 1332 | |||
| 1333 | @defun process-kill-without-query process &optional do-query | ||
| 1334 | This function clears the query flag of @var{process}, so that | ||
| 1335 | Emacs will not query the user on account of that process. | ||
| 1336 | |||
| 1337 | Actually, the function does more than that: it returns the old value of | ||
| 1338 | the process's query flag, and sets the query flag to @var{do-query}. | ||
| 1339 | Please don't use this function to do those things any more---please | ||
| 1340 | use the newer, cleaner functions @code{process-query-on-exit-flag} and | ||
| 1341 | @code{set-process-query-on-exit-flag} in all but the simplest cases. | ||
| 1342 | The only way you should use @code{process-kill-without-query} nowadays | ||
| 1343 | is like this: | ||
| 1344 | |||
| 1345 | @smallexample | ||
| 1346 | @group | ||
| 1347 | ;; @r{Don't query about the shell process} | ||
| 1348 | (process-kill-without-query (get-process "shell")) | ||
| 1349 | @end group | ||
| 1350 | @end smallexample | ||
| 1351 | @end defun | ||
| 1352 | |||
| 1348 | @node Transaction Queues | 1353 | @node Transaction Queues |
| 1349 | @section Transaction Queues | 1354 | @section Transaction Queues |
| 1350 | @cindex transaction queue | 1355 | @cindex transaction queue |