aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorKaroly Lorentey2005-06-15 12:57:51 +0000
committerKaroly Lorentey2005-06-15 12:57:51 +0000
commitef85512e51f043d73788f00a2aed13cccde0682c (patch)
treefc1fa1378533250f260ef8eaa9a84ae882d9df84 /src/process.c
parent8736257554f49445f7b4402ac7a9436b38ce6452 (diff)
parentef88a9999004e6c26148c8d280d6a41f623d7249 (diff)
downloademacs-ef85512e51f043d73788f00a2aed13cccde0682c.tar.gz
emacs-ef85512e51f043d73788f00a2aed13cccde0682c.zip
Merged from miles@gnu.org--gnu-2005 (patch 80-82, 350-422)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-350 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-351 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-352 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-353 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-354 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-355 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-356 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-357 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-358 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-359 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-360 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-361 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-362 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-363 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-364 Remove "-face" suffix from widget faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365 Remove "-face" suffix from custom faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-366 Remove "-face" suffix from change-log faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-367 Remove "-face" suffix from compilation faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-368 Remove "-face" suffix from diff-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-369 lisp/longlines.el (longlines-visible-face): Face removed * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-370 Remove "-face" suffix from woman faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-371 Remove "-face" suffix from whitespace-highlight face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372 Remove "-face" suffix from ruler-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-373 Remove "-face" suffix from show-paren faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374 Remove "-face" suffix from log-view faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-375 Remove "-face" suffix from smerge faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-376 Remove "-face" suffix from show-tabs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-377 Remove "-face" suffix from highlight-changes faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-378 Remove "-face" suffix from and downcase info faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379 Remove "-face" suffix from pcvs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-380 Update uses of renamed pcvs faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-381 Tweak ChangeLog * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-382 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-383 Remove "-face" suffix from strokes-char face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-384 Remove "-face" suffix from compare-windows face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-385 Remove "-face" suffix from calendar faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-386 Remove "-face" suffix from diary-button face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-387 Remove "-face" suffix from testcover faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-388 Remove "-face" suffix from viper faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-389 Remove "-face" suffix from org faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-390 Remove "-face" suffix from sgml-namespace face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-391 Remove "-face" suffix from table-cell face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-392 Remove "-face" suffix from tex-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-393 Remove "-face" suffix from texinfo-heading face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-394 Remove "-face" suffix from flyspell faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-395 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-396 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-397 Remove "-face" suffix from gomoku faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-398 Remove "-face" suffix from mpuz faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-399 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-400 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-401 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-402 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-403 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-404 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-405 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-406 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-407 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-408 Remove "-face" suffix from Buffer-menu-buffer face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-409 Remove "-face" suffix from antlr-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410 Remove "-face" suffix from ebrowse faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-411 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-412 Remove "-face" suffix from flymake faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-413 Remove "-face" suffix from idlwave faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-414 Remove "-face" suffix from sh-script faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-415 Remove "-face" suffix from vhdl-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-416 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-417 Remove "-face" suffix from which-func face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-418 Remove "-face" suffix from cperl-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-419 Remove "-face" suffix from ld-script faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-420 Fix cperl-mode font-lock problem * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-421 Tweak which-func face * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-422 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-80 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-81 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-82 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-350
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/process.c b/src/process.c
index 41e46c53dc9..dd13138e273 100644
--- a/src/process.c
+++ b/src/process.c
@@ -272,17 +272,19 @@ int update_tick;
272#define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5) 272#define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5)
273#define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7) 273#define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7)
274 274
275/* Number of processes which might be delayed. */ 275/* Number of processes which have a non-zero read_output_delay,
276 and therefore might be delayed for adaptive read buffering. */
276 277
277static int process_output_delay_count; 278static int process_output_delay_count;
278 279
279/* Non-zero if any process has non-nil process_output_skip. */ 280/* Non-zero if any process has non-nil read_output_skip. */
280 281
281static int process_output_skip; 282static int process_output_skip;
282 283
283/* Non-nil means to delay reading process output to improve buffering. 284/* Non-nil means to delay reading process output to improve buffering.
284 A value of t means that delay is reset after each send, any other 285 A value of t means that delay is reset after each send, any other
285 non-nil value does not reset the delay. */ 286 non-nil value does not reset the delay. A value of nil disables
287 adaptive read buffering completely. */
286static Lisp_Object Vprocess_adaptive_read_buffering; 288static Lisp_Object Vprocess_adaptive_read_buffering;
287#else 289#else
288#define process_output_delay_count 0 290#define process_output_delay_count 0
@@ -1535,7 +1537,6 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1535 1537
1536 XPROCESS (proc)->childp = Qt; 1538 XPROCESS (proc)->childp = Qt;
1537 XPROCESS (proc)->plist = Qnil; 1539 XPROCESS (proc)->plist = Qnil;
1538 XPROCESS (proc)->command_channel_p = Qnil;
1539 XPROCESS (proc)->buffer = buffer; 1540 XPROCESS (proc)->buffer = buffer;
1540 XPROCESS (proc)->sentinel = Qnil; 1541 XPROCESS (proc)->sentinel = Qnil;
1541 XPROCESS (proc)->filter = Qnil; 1542 XPROCESS (proc)->filter = Qnil;
@@ -4319,6 +4320,11 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
4319#endif 4320#endif
4320 4321
4321#ifdef ADAPTIVE_READ_BUFFERING 4322#ifdef ADAPTIVE_READ_BUFFERING
4323 /* Set the timeout for adaptive read buffering if any
4324 process has non-nil read_output_skip and non-zero
4325 read_output_delay, and we are not reading output for a
4326 specific wait_channel. It is not executed if
4327 Vprocess_adaptive_read_buffering is nil. */
4322 if (process_output_skip && check_delay > 0) 4328 if (process_output_skip && check_delay > 0)
4323 { 4329 {
4324 int usecs = EMACS_USECS (timeout); 4330 int usecs = EMACS_USECS (timeout);
@@ -4329,6 +4335,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
4329 proc = chan_process[channel]; 4335 proc = chan_process[channel];
4330 if (NILP (proc)) 4336 if (NILP (proc))
4331 continue; 4337 continue;
4338 /* Find minimum non-zero read_output_delay among the
4339 processes with non-nil read_output_skip. */
4332 if (XINT (XPROCESS (proc)->read_output_delay) > 0) 4340 if (XINT (XPROCESS (proc)->read_output_delay) > 0)
4333 { 4341 {
4334 check_delay--; 4342 check_delay--;
@@ -4879,10 +4887,10 @@ read_process_output (proc, channel)
4879 { 4887 {
4880 Lisp_Object tem; 4888 Lisp_Object tem;
4881 /* Don't clobber the CURRENT match data, either! */ 4889 /* Don't clobber the CURRENT match data, either! */
4882 tem = Fmatch_data (Qnil, Qnil); 4890 tem = Fmatch_data (Qnil, Qnil, Qnil);
4883 restore_match_data (); 4891 restore_search_regs ();
4884 record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); 4892 record_unwind_save_match_data ();
4885 Fset_match_data (tem); 4893 Fset_match_data (tem, Qt);
4886 } 4894 }
4887 4895
4888 /* For speed, if a search happens within this code, 4896 /* For speed, if a search happens within this code,
@@ -4936,7 +4944,7 @@ read_process_output (proc, channel)
4936 read_process_output_error_handler); 4944 read_process_output_error_handler);
4937 4945
4938 /* If we saved the match data nonrecursively, restore it now. */ 4946 /* If we saved the match data nonrecursively, restore it now. */
4939 restore_match_data (); 4947 restore_search_regs ();
4940 running_asynch_code = outer_running_asynch_code; 4948 running_asynch_code = outer_running_asynch_code;
4941 4949
4942 /* Handling the process output should not deactivate the mark. */ 4950 /* Handling the process output should not deactivate the mark. */
@@ -6340,10 +6348,10 @@ exec_sentinel (proc, reason)
6340 if (outer_running_asynch_code) 6348 if (outer_running_asynch_code)
6341 { 6349 {
6342 Lisp_Object tem; 6350 Lisp_Object tem;
6343 tem = Fmatch_data (Qnil, Qnil); 6351 tem = Fmatch_data (Qnil, Qnil, Qnil);
6344 restore_match_data (); 6352 restore_search_regs ();
6345 record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); 6353 record_unwind_save_match_data ();
6346 Fset_match_data (tem); 6354 Fset_match_data (tem, Qt);
6347 } 6355 }
6348 6356
6349 /* For speed, if a search happens within this code, 6357 /* For speed, if a search happens within this code,
@@ -6357,7 +6365,7 @@ exec_sentinel (proc, reason)
6357 exec_sentinel_error_handler); 6365 exec_sentinel_error_handler);
6358 6366
6359 /* If we saved the match data nonrecursively, restore it now. */ 6367 /* If we saved the match data nonrecursively, restore it now. */
6360 restore_match_data (); 6368 restore_search_regs ();
6361 running_asynch_code = outer_running_asynch_code; 6369 running_asynch_code = outer_running_asynch_code;
6362 6370
6363 Vdeactivate_mark = odeactivate; 6371 Vdeactivate_mark = odeactivate;
@@ -6708,7 +6716,7 @@ init_process ()
6708#endif /* HAVE_SOCKETS */ 6716#endif /* HAVE_SOCKETS */
6709 6717
6710#if defined (DARWIN) || defined (MAC_OSX) 6718#if defined (DARWIN) || defined (MAC_OSX)
6711 /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive 6719 /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive
6712 processes. As such, we only change the default value. */ 6720 processes. As such, we only change the default value. */
6713 if (initialized) 6721 if (initialized)
6714 { 6722 {
@@ -6813,7 +6821,7 @@ The value takes effect when `start-process' is called. */);
6813 doc: /* If non-nil, improve receive buffering by delaying after short reads. 6821 doc: /* If non-nil, improve receive buffering by delaying after short reads.
6814On some systems, when Emacs reads the output from a subprocess, the output data 6822On some systems, when Emacs reads the output from a subprocess, the output data
6815is read in very small blocks, potentially resulting in very poor performance. 6823is read in very small blocks, potentially resulting in very poor performance.
6816This behaviour can be remedied to some extent by setting this variable to a 6824This behavior can be remedied to some extent by setting this variable to a
6817non-nil value, as it will automatically delay reading from such processes, to 6825non-nil value, as it will automatically delay reading from such processes, to
6818allowing them to produce more output before Emacs tries to read it. 6826allowing them to produce more output before Emacs tries to read it.
6819If the value is t, the delay is reset after each write to the process; any other 6827If the value is t, the delay is reset after each write to the process; any other