diff options
| author | Kenichi Handa | 2011-07-07 08:28:00 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2011-07-07 08:28:00 +0900 |
| commit | d2a0a50628933d3cdb09818eee2e17f55e22531f (patch) | |
| tree | d19c8e71eb63eb6ccd204c2f36f406e4cf853154 /src/process.c | |
| parent | c805dec0b5fa81b5c9f2b724e2ec12a17d723aca (diff) | |
| parent | 354cf0ba0b20108c9776be1d868458893bc2cd54 (diff) | |
| download | emacs-d2a0a50628933d3cdb09818eee2e17f55e22531f.tar.gz emacs-d2a0a50628933d3cdb09818eee2e17f55e22531f.zip | |
merge trunk
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 261 |
1 files changed, 95 insertions, 166 deletions
diff --git a/src/process.c b/src/process.c index 0040d14a0f6..6bd168d8840 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -102,9 +102,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 102 | #include "gnutls.h" | 102 | #include "gnutls.h" |
| 103 | #endif | 103 | #endif |
| 104 | 104 | ||
| 105 | #if defined (USE_GTK) || defined (HAVE_GCONF) | 105 | #if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) |
| 106 | #include "xgselect.h" | 106 | #include "xgselect.h" |
| 107 | #endif /* defined (USE_GTK) || defined (HAVE_GCONF) */ | 107 | #endif |
| 108 | #ifdef HAVE_NS | 108 | #ifdef HAVE_NS |
| 109 | #include "nsterm.h" | 109 | #include "nsterm.h" |
| 110 | #endif | 110 | #endif |
| @@ -4479,13 +4479,19 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, | |||
| 4479 | set_waiting_for_input (&timeout); | 4479 | set_waiting_for_input (&timeout); |
| 4480 | } | 4480 | } |
| 4481 | 4481 | ||
| 4482 | /* Skip the `select' call if input is available and we're | ||
| 4483 | waiting for keyboard input or a cell change (which can be | ||
| 4484 | triggered by processing X events). In the latter case, set | ||
| 4485 | nfds to 1 to avoid breaking the loop. */ | ||
| 4482 | no_avail = 0; | 4486 | no_avail = 0; |
| 4483 | if (read_kbd && detect_input_pending ()) | 4487 | if ((read_kbd || !NILP (wait_for_cell)) |
| 4488 | && detect_input_pending ()) | ||
| 4484 | { | 4489 | { |
| 4485 | nfds = 0; | 4490 | nfds = read_kbd ? 0 : 1; |
| 4486 | no_avail = 1; | 4491 | no_avail = 1; |
| 4487 | } | 4492 | } |
| 4488 | else | 4493 | |
| 4494 | if (!no_avail) | ||
| 4489 | { | 4495 | { |
| 4490 | 4496 | ||
| 4491 | #ifdef ADAPTIVE_READ_BUFFERING | 4497 | #ifdef ADAPTIVE_READ_BUFFERING |
| @@ -4521,7 +4527,7 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, | |||
| 4521 | process_output_skip = 0; | 4527 | process_output_skip = 0; |
| 4522 | } | 4528 | } |
| 4523 | #endif | 4529 | #endif |
| 4524 | #if defined (USE_GTK) || defined (HAVE_GCONF) | 4530 | #if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) |
| 4525 | nfds = xg_select | 4531 | nfds = xg_select |
| 4526 | #elif defined (HAVE_NS) | 4532 | #elif defined (HAVE_NS) |
| 4527 | nfds = ns_select | 4533 | nfds = ns_select |
| @@ -7236,14 +7242,10 @@ syms_of_process (void) | |||
| 7236 | { | 7242 | { |
| 7237 | #ifdef subprocesses | 7243 | #ifdef subprocesses |
| 7238 | 7244 | ||
| 7239 | Qprocessp = intern_c_string ("processp"); | 7245 | DEFSYM (Qprocessp, "processp"); |
| 7240 | staticpro (&Qprocessp); | 7246 | DEFSYM (Qrun, "run"); |
| 7241 | Qrun = intern_c_string ("run"); | 7247 | DEFSYM (Qstop, "stop"); |
| 7242 | staticpro (&Qrun); | 7248 | DEFSYM (Qsignal, "signal"); |
| 7243 | Qstop = intern_c_string ("stop"); | ||
| 7244 | staticpro (&Qstop); | ||
| 7245 | Qsignal = intern_c_string ("signal"); | ||
| 7246 | staticpro (&Qsignal); | ||
| 7247 | 7249 | ||
| 7248 | /* Qexit is already staticpro'd by syms_of_eval; don't staticpro it | 7250 | /* Qexit is already staticpro'd by syms_of_eval; don't staticpro it |
| 7249 | here again. | 7251 | here again. |
| @@ -7251,92 +7253,52 @@ syms_of_process (void) | |||
| 7251 | Qexit = intern_c_string ("exit"); | 7253 | Qexit = intern_c_string ("exit"); |
| 7252 | staticpro (&Qexit); */ | 7254 | staticpro (&Qexit); */ |
| 7253 | 7255 | ||
| 7254 | Qopen = intern_c_string ("open"); | 7256 | DEFSYM (Qopen, "open"); |
| 7255 | staticpro (&Qopen); | 7257 | DEFSYM (Qclosed, "closed"); |
| 7256 | Qclosed = intern_c_string ("closed"); | 7258 | DEFSYM (Qconnect, "connect"); |
| 7257 | staticpro (&Qclosed); | 7259 | DEFSYM (Qfailed, "failed"); |
| 7258 | Qconnect = intern_c_string ("connect"); | 7260 | DEFSYM (Qlisten, "listen"); |
| 7259 | staticpro (&Qconnect); | 7261 | DEFSYM (Qlocal, "local"); |
| 7260 | Qfailed = intern_c_string ("failed"); | 7262 | DEFSYM (Qipv4, "ipv4"); |
| 7261 | staticpro (&Qfailed); | ||
| 7262 | Qlisten = intern_c_string ("listen"); | ||
| 7263 | staticpro (&Qlisten); | ||
| 7264 | Qlocal = intern_c_string ("local"); | ||
| 7265 | staticpro (&Qlocal); | ||
| 7266 | Qipv4 = intern_c_string ("ipv4"); | ||
| 7267 | staticpro (&Qipv4); | ||
| 7268 | #ifdef AF_INET6 | 7263 | #ifdef AF_INET6 |
| 7269 | Qipv6 = intern_c_string ("ipv6"); | 7264 | DEFSYM (Qipv6, "ipv6"); |
| 7270 | staticpro (&Qipv6); | 7265 | #endif |
| 7271 | #endif | 7266 | DEFSYM (Qdatagram, "datagram"); |
| 7272 | Qdatagram = intern_c_string ("datagram"); | 7267 | DEFSYM (Qseqpacket, "seqpacket"); |
| 7273 | staticpro (&Qdatagram); | 7268 | |
| 7274 | Qseqpacket = intern_c_string ("seqpacket"); | 7269 | DEFSYM (QCport, ":port"); |
| 7275 | staticpro (&Qseqpacket); | 7270 | DEFSYM (QCspeed, ":speed"); |
| 7276 | 7271 | DEFSYM (QCprocess, ":process"); | |
| 7277 | QCport = intern_c_string (":port"); | 7272 | |
| 7278 | staticpro (&QCport); | 7273 | DEFSYM (QCbytesize, ":bytesize"); |
| 7279 | QCspeed = intern_c_string (":speed"); | 7274 | DEFSYM (QCstopbits, ":stopbits"); |
| 7280 | staticpro (&QCspeed); | 7275 | DEFSYM (QCparity, ":parity"); |
| 7281 | QCprocess = intern_c_string (":process"); | 7276 | DEFSYM (Qodd, "odd"); |
| 7282 | staticpro (&QCprocess); | 7277 | DEFSYM (Qeven, "even"); |
| 7283 | 7278 | DEFSYM (QCflowcontrol, ":flowcontrol"); | |
| 7284 | QCbytesize = intern_c_string (":bytesize"); | 7279 | DEFSYM (Qhw, "hw"); |
| 7285 | staticpro (&QCbytesize); | 7280 | DEFSYM (Qsw, "sw"); |
| 7286 | QCstopbits = intern_c_string (":stopbits"); | 7281 | DEFSYM (QCsummary, ":summary"); |
| 7287 | staticpro (&QCstopbits); | 7282 | |
| 7288 | QCparity = intern_c_string (":parity"); | 7283 | DEFSYM (Qreal, "real"); |
| 7289 | staticpro (&QCparity); | 7284 | DEFSYM (Qnetwork, "network"); |
| 7290 | Qodd = intern_c_string ("odd"); | 7285 | DEFSYM (Qserial, "serial"); |
| 7291 | staticpro (&Qodd); | 7286 | DEFSYM (QCbuffer, ":buffer"); |
| 7292 | Qeven = intern_c_string ("even"); | 7287 | DEFSYM (QChost, ":host"); |
| 7293 | staticpro (&Qeven); | 7288 | DEFSYM (QCservice, ":service"); |
| 7294 | QCflowcontrol = intern_c_string (":flowcontrol"); | 7289 | DEFSYM (QClocal, ":local"); |
| 7295 | staticpro (&QCflowcontrol); | 7290 | DEFSYM (QCremote, ":remote"); |
| 7296 | Qhw = intern_c_string ("hw"); | 7291 | DEFSYM (QCcoding, ":coding"); |
| 7297 | staticpro (&Qhw); | 7292 | DEFSYM (QCserver, ":server"); |
| 7298 | Qsw = intern_c_string ("sw"); | 7293 | DEFSYM (QCnowait, ":nowait"); |
| 7299 | staticpro (&Qsw); | 7294 | DEFSYM (QCsentinel, ":sentinel"); |
| 7300 | QCsummary = intern_c_string (":summary"); | 7295 | DEFSYM (QClog, ":log"); |
| 7301 | staticpro (&QCsummary); | 7296 | DEFSYM (QCnoquery, ":noquery"); |
| 7302 | 7297 | DEFSYM (QCstop, ":stop"); | |
| 7303 | Qreal = intern_c_string ("real"); | 7298 | DEFSYM (QCoptions, ":options"); |
| 7304 | staticpro (&Qreal); | 7299 | DEFSYM (QCplist, ":plist"); |
| 7305 | Qnetwork = intern_c_string ("network"); | 7300 | |
| 7306 | staticpro (&Qnetwork); | 7301 | DEFSYM (Qlast_nonmenu_event, "last-nonmenu-event"); |
| 7307 | Qserial = intern_c_string ("serial"); | ||
| 7308 | staticpro (&Qserial); | ||
| 7309 | QCbuffer = intern_c_string (":buffer"); | ||
| 7310 | staticpro (&QCbuffer); | ||
| 7311 | QChost = intern_c_string (":host"); | ||
| 7312 | staticpro (&QChost); | ||
| 7313 | QCservice = intern_c_string (":service"); | ||
| 7314 | staticpro (&QCservice); | ||
| 7315 | QClocal = intern_c_string (":local"); | ||
| 7316 | staticpro (&QClocal); | ||
| 7317 | QCremote = intern_c_string (":remote"); | ||
| 7318 | staticpro (&QCremote); | ||
| 7319 | QCcoding = intern_c_string (":coding"); | ||
| 7320 | staticpro (&QCcoding); | ||
| 7321 | QCserver = intern_c_string (":server"); | ||
| 7322 | staticpro (&QCserver); | ||
| 7323 | QCnowait = intern_c_string (":nowait"); | ||
| 7324 | staticpro (&QCnowait); | ||
| 7325 | QCsentinel = intern_c_string (":sentinel"); | ||
| 7326 | staticpro (&QCsentinel); | ||
| 7327 | QClog = intern_c_string (":log"); | ||
| 7328 | staticpro (&QClog); | ||
| 7329 | QCnoquery = intern_c_string (":noquery"); | ||
| 7330 | staticpro (&QCnoquery); | ||
| 7331 | QCstop = intern_c_string (":stop"); | ||
| 7332 | staticpro (&QCstop); | ||
| 7333 | QCoptions = intern_c_string (":options"); | ||
| 7334 | staticpro (&QCoptions); | ||
| 7335 | QCplist = intern_c_string (":plist"); | ||
| 7336 | staticpro (&QCplist); | ||
| 7337 | |||
| 7338 | Qlast_nonmenu_event = intern_c_string ("last-nonmenu-event"); | ||
| 7339 | staticpro (&Qlast_nonmenu_event); | ||
| 7340 | 7302 | ||
| 7341 | staticpro (&Vprocess_alist); | 7303 | staticpro (&Vprocess_alist); |
| 7342 | #ifdef SIGCHLD | 7304 | #ifdef SIGCHLD |
| @@ -7345,73 +7307,40 @@ syms_of_process (void) | |||
| 7345 | 7307 | ||
| 7346 | #endif /* subprocesses */ | 7308 | #endif /* subprocesses */ |
| 7347 | 7309 | ||
| 7348 | QCname = intern_c_string (":name"); | 7310 | DEFSYM (QCname, ":name"); |
| 7349 | staticpro (&QCname); | 7311 | DEFSYM (QCtype, ":type"); |
| 7350 | QCtype = intern_c_string (":type"); | 7312 | |
| 7351 | staticpro (&QCtype); | 7313 | DEFSYM (Qeuid, "euid"); |
| 7352 | 7314 | DEFSYM (Qegid, "egid"); | |
| 7353 | Qeuid = intern_c_string ("euid"); | 7315 | DEFSYM (Quser, "user"); |
| 7354 | staticpro (&Qeuid); | 7316 | DEFSYM (Qgroup, "group"); |
| 7355 | Qegid = intern_c_string ("egid"); | 7317 | DEFSYM (Qcomm, "comm"); |
| 7356 | staticpro (&Qegid); | 7318 | DEFSYM (Qstate, "state"); |
| 7357 | Quser = intern_c_string ("user"); | 7319 | DEFSYM (Qppid, "ppid"); |
| 7358 | staticpro (&Quser); | 7320 | DEFSYM (Qpgrp, "pgrp"); |
| 7359 | Qgroup = intern_c_string ("group"); | 7321 | DEFSYM (Qsess, "sess"); |
| 7360 | staticpro (&Qgroup); | 7322 | DEFSYM (Qttname, "ttname"); |
| 7361 | Qcomm = intern_c_string ("comm"); | 7323 | DEFSYM (Qtpgid, "tpgid"); |
| 7362 | staticpro (&Qcomm); | 7324 | DEFSYM (Qminflt, "minflt"); |
| 7363 | Qstate = intern_c_string ("state"); | 7325 | DEFSYM (Qmajflt, "majflt"); |
| 7364 | staticpro (&Qstate); | 7326 | DEFSYM (Qcminflt, "cminflt"); |
| 7365 | Qppid = intern_c_string ("ppid"); | 7327 | DEFSYM (Qcmajflt, "cmajflt"); |
| 7366 | staticpro (&Qppid); | 7328 | DEFSYM (Qutime, "utime"); |
| 7367 | Qpgrp = intern_c_string ("pgrp"); | 7329 | DEFSYM (Qstime, "stime"); |
| 7368 | staticpro (&Qpgrp); | 7330 | DEFSYM (Qtime, "time"); |
| 7369 | Qsess = intern_c_string ("sess"); | 7331 | DEFSYM (Qcutime, "cutime"); |
| 7370 | staticpro (&Qsess); | 7332 | DEFSYM (Qcstime, "cstime"); |
| 7371 | Qttname = intern_c_string ("ttname"); | 7333 | DEFSYM (Qctime, "ctime"); |
| 7372 | staticpro (&Qttname); | 7334 | DEFSYM (Qpri, "pri"); |
| 7373 | Qtpgid = intern_c_string ("tpgid"); | 7335 | DEFSYM (Qnice, "nice"); |
| 7374 | staticpro (&Qtpgid); | 7336 | DEFSYM (Qthcount, "thcount"); |
| 7375 | Qminflt = intern_c_string ("minflt"); | 7337 | DEFSYM (Qstart, "start"); |
| 7376 | staticpro (&Qminflt); | 7338 | DEFSYM (Qvsize, "vsize"); |
| 7377 | Qmajflt = intern_c_string ("majflt"); | 7339 | DEFSYM (Qrss, "rss"); |
| 7378 | staticpro (&Qmajflt); | 7340 | DEFSYM (Qetime, "etime"); |
| 7379 | Qcminflt = intern_c_string ("cminflt"); | 7341 | DEFSYM (Qpcpu, "pcpu"); |
| 7380 | staticpro (&Qcminflt); | 7342 | DEFSYM (Qpmem, "pmem"); |
| 7381 | Qcmajflt = intern_c_string ("cmajflt"); | 7343 | DEFSYM (Qargs, "args"); |
| 7382 | staticpro (&Qcmajflt); | ||
| 7383 | Qutime = intern_c_string ("utime"); | ||
| 7384 | staticpro (&Qutime); | ||
| 7385 | Qstime = intern_c_string ("stime"); | ||
| 7386 | staticpro (&Qstime); | ||
| 7387 | Qtime = intern_c_string ("time"); | ||
| 7388 | staticpro (&Qtime); | ||
| 7389 | Qcutime = intern_c_string ("cutime"); | ||
| 7390 | staticpro (&Qcutime); | ||
| 7391 | Qcstime = intern_c_string ("cstime"); | ||
| 7392 | staticpro (&Qcstime); | ||
| 7393 | Qctime = intern_c_string ("ctime"); | ||
| 7394 | staticpro (&Qctime); | ||
| 7395 | Qpri = intern_c_string ("pri"); | ||
| 7396 | staticpro (&Qpri); | ||
| 7397 | Qnice = intern_c_string ("nice"); | ||
| 7398 | staticpro (&Qnice); | ||
| 7399 | Qthcount = intern_c_string ("thcount"); | ||
| 7400 | staticpro (&Qthcount); | ||
| 7401 | Qstart = intern_c_string ("start"); | ||
| 7402 | staticpro (&Qstart); | ||
| 7403 | Qvsize = intern_c_string ("vsize"); | ||
| 7404 | staticpro (&Qvsize); | ||
| 7405 | Qrss = intern_c_string ("rss"); | ||
| 7406 | staticpro (&Qrss); | ||
| 7407 | Qetime = intern_c_string ("etime"); | ||
| 7408 | staticpro (&Qetime); | ||
| 7409 | Qpcpu = intern_c_string ("pcpu"); | ||
| 7410 | staticpro (&Qpcpu); | ||
| 7411 | Qpmem = intern_c_string ("pmem"); | ||
| 7412 | staticpro (&Qpmem); | ||
| 7413 | Qargs = intern_c_string ("args"); | ||
| 7414 | staticpro (&Qargs); | ||
| 7415 | 7344 | ||
| 7416 | DEFVAR_BOOL ("delete-exited-processes", delete_exited_processes, | 7345 | DEFVAR_BOOL ("delete-exited-processes", delete_exited_processes, |
| 7417 | doc: /* *Non-nil means delete processes immediately when they exit. | 7346 | doc: /* *Non-nil means delete processes immediately when they exit. |