aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-07-12 23:32:14 +0000
committerRichard M. Stallman2002-07-12 23:32:14 +0000
commitedc590bb8a77290f9963b2d0f8520b4cbe7484d6 (patch)
tree6c0be278560963a4d3e72cf31e1c4ca1a1f62bf3
parentce218967c1fc2bc5a1ec96281d05d0e17058e28c (diff)
downloademacs-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.texi113
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
460addition, the total number of @sc{pty}s is limited on many systems and 460addition, the total number of @sc{pty}s is limited on many systems and
461it is good not to waste them. 461it is good not to waste them.
462 462
463The value of @code{process-connection-type} is used when 463The 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
465with one subprocess by binding the variable around the call to 465with 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,
486but not necessarily right away. You can delete a process explicitly 486but not necessarily right away. You can delete a process explicitly
487at any time. If you delete a terminated process explicitly before it 487at any time. If you delete a terminated process explicitly before it
488is deleted automatically, no harm results. Deletion of a running 488is deleted automatically, no harm results. Deletion of a running
489process sends a signal to terminate it and calls the process sentinel 489process sends a signal to terminate it (and its child processes if
490if it has one. 490any), 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
493deleted process, but the process object itself continues to exist as 493deleted 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
855to send; it should be an integer. 855to 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
862the @code{SIGHUP} signal. Because some subprocesses are doing
863valuable work, Emacs normally asks the user to confirm that it is ok
864to terminate them. Each process has a query flag which, if
865non-@code{nil}, says that Emacs should ask for confirmation before
866exiting and thus killing that process. The default for the query flag
867is @code{t}, meaning @emph{do} query.
868
869@tindex process-query-on-exit-flag
870@defun process-query-on-exit-flag process
871This 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
876This function sets the query flag of @var{process} to @var{flag}. It
877returns @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
889This function clears the query flag of @var{process}, so that
890Emacs will not query the user on account of that process.
891
892Actually, the function does more than that: it returns the old value of
893the process's query flag, and sets the query flag to @var{do-query}.
894Please don't use this function to do those things any more---please
895use 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.
897The only way you should use @code{process-kill-without-query} nowadays
898is 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
917the process has no buffer and no filter function, its output is 867the process has no buffer and no filter function, its output is
918discarded. 868discarded.
919 869
870 When a subprocess terminates, Emacs reads any pending output,
871then stops reading output from that subprocess. Therefore, if the
872subprocess has children that are still live and still producing
873output, 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
921reading terminal input, in @code{sit-for} and @code{sleep-for} 876reading 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
1345was not. 1300was 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
1307the @code{SIGHUP} signal. Because some subprocesses are doing
1308valuable work, Emacs normally asks the user to confirm that it is ok
1309to terminate them. Each process has a query flag which, if
1310non-@code{nil}, says that Emacs should ask for confirmation before
1311exiting and thus killing that process. The default for the query flag
1312is @code{t}, meaning @emph{do} query.
1313
1314@tindex process-query-on-exit-flag
1315@defun process-query-on-exit-flag process
1316This 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
1321This function sets the query flag of @var{process} to @var{flag}. It
1322returns @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
1334This function clears the query flag of @var{process}, so that
1335Emacs will not query the user on account of that process.
1336
1337Actually, the function does more than that: it returns the old value of
1338the process's query flag, and sets the query flag to @var{do-query}.
1339Please don't use this function to do those things any more---please
1340use 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.
1342The only way you should use @code{process-kill-without-query} nowadays
1343is 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