Mercurial > emacs
comparison lispref/processes.texi @ 66152:6677034b52bb
(Sentinels): Clarify about output and quitting.
(Filter Functions): Mention with-local-quit.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 17 Oct 2005 16:16:27 +0000 |
parents | 989a5fc8da03 |
children | a40ac89f9800 0ca0d9181b5e |
comparison
equal
deleted
inserted
replaced
66151:934d10a9685c | 66152:6677034b52bb |
---|---|
1094 and a string, which is output just received from it. The function is | 1094 and a string, which is output just received from it. The function is |
1095 then free to do whatever it chooses with the output. | 1095 then free to do whatever it chooses with the output. |
1096 | 1096 |
1097 Quitting is normally inhibited within a filter function---otherwise, | 1097 Quitting is normally inhibited within a filter function---otherwise, |
1098 the effect of typing @kbd{C-g} at command level or to quit a user | 1098 the effect of typing @kbd{C-g} at command level or to quit a user |
1099 command would be unpredictable. If you want to permit quitting inside a | 1099 command would be unpredictable. If you want to permit quitting inside |
1100 filter function, bind @code{inhibit-quit} to @code{nil}. | 1100 a filter function, bind @code{inhibit-quit} to @code{nil}. In most |
1101 @xref{Quitting}. | 1101 cases, the right way to do this is with the macro |
1102 @code{with-local-quit}. @xref{Quitting}. | |
1102 | 1103 |
1103 If an error happens during execution of a filter function, it is | 1104 If an error happens during execution of a filter function, it is |
1104 caught automatically, so that it doesn't stop the execution of whatever | 1105 caught automatically, so that it doesn't stop the execution of whatever |
1105 program was running when the filter function was started. However, if | 1106 program was running when the filter function was started. However, if |
1106 @code{debug-on-error} is non-@code{nil}, the error-catching is turned | 1107 @code{debug-on-error} is non-@code{nil}, the error-catching is turned |
1373 there has been a change. Therefore two changes in status, coming in | 1374 there has been a change. Therefore two changes in status, coming in |
1374 quick succession, can call the sentinel just once. However, process | 1375 quick succession, can call the sentinel just once. However, process |
1375 termination will always run the sentinel exactly once. This is | 1376 termination will always run the sentinel exactly once. This is |
1376 because the process status can't change again after termination. | 1377 because the process status can't change again after termination. |
1377 | 1378 |
1378 Quitting is normally inhibited within a sentinel---otherwise, the | 1379 Emacs explicitly checks for output from the process before running |
1379 effect of typing @kbd{C-g} at command level or to quit a user command | 1380 the process sentinel. Once the sentinel runs due to process |
1380 would be unpredictable. If you want to permit quitting inside a | 1381 termination, no further output can arrive from the process. |
1381 sentinel, bind @code{inhibit-quit} to @code{nil}. @xref{Quitting}. | |
1382 | 1382 |
1383 A sentinel that writes the output into the buffer of the process | 1383 A sentinel that writes the output into the buffer of the process |
1384 should check whether the buffer is still alive. If it tries to insert | 1384 should check whether the buffer is still alive. If it tries to insert |
1385 into a dead buffer, it will get an error. If the buffer is dead, | 1385 into a dead buffer, it will get an error. If the buffer is dead, |
1386 @code{(buffer-name (process-buffer @var{process}))} returns @code{nil}. | 1386 @code{(buffer-name (process-buffer @var{process}))} returns @code{nil}. |
1387 | |
1388 Quitting is normally inhibited within a sentinel---otherwise, the | |
1389 effect of typing @kbd{C-g} at command level or to quit a user command | |
1390 would be unpredictable. If you want to permit quitting inside a | |
1391 sentinel, bind @code{inhibit-quit} to @code{nil}. In most cases, the | |
1392 right way to do this is with the macro @code{with-local-quit}. | |
1393 @xref{Quitting}. | |
1387 | 1394 |
1388 If an error happens during execution of a sentinel, it is caught | 1395 If an error happens during execution of a sentinel, it is caught |
1389 automatically, so that it doesn't stop the execution of whatever | 1396 automatically, so that it doesn't stop the execution of whatever |
1390 programs was running when the sentinel was started. However, if | 1397 programs was running when the sentinel was started. However, if |
1391 @code{debug-on-error} is non-@code{nil}, the error-catching is turned | 1398 @code{debug-on-error} is non-@code{nil}, the error-catching is turned |