comparison src/process.c @ 73225:ff880e40efba

(list_processes_1): Run sentinels before removing dead processes. Also remove `closed' network connections.
author Kim F. Storm <storm@cua.dk>
date Tue, 03 Oct 2006 09:14:40 +0000
parents 5f2a73453aa3
children 182d429ba6f9 2d56e13fd23d 8dd8c8286063
comparison
equal deleted inserted replaced
73224:36dcde72adad 73225:ff880e40efba
1312 register Lisp_Object tail, tem; 1312 register Lisp_Object tail, tem;
1313 Lisp_Object proc, minspace, tem1; 1313 Lisp_Object proc, minspace, tem1;
1314 register struct Lisp_Process *p; 1314 register struct Lisp_Process *p;
1315 char tembuf[300]; 1315 char tembuf[300];
1316 int w_proc, w_buffer, w_tty; 1316 int w_proc, w_buffer, w_tty;
1317 int exited = 0;
1317 Lisp_Object i_status, i_buffer, i_tty, i_command; 1318 Lisp_Object i_status, i_buffer, i_tty, i_command;
1318 1319
1319 w_proc = 4; /* Proc */ 1320 w_proc = 4; /* Proc */
1320 w_buffer = 6; /* Buffer */ 1321 w_buffer = 6; /* Buffer */
1321 w_tty = 0; /* Omit if no ttys */ 1322 w_tty = 0; /* Omit if no ttys */
1438 sprintf (tembuf, " %d", (int) XFASTINT (tem)); 1439 sprintf (tembuf, " %d", (int) XFASTINT (tem));
1439 write_string (tembuf, -1); 1440 write_string (tembuf, -1);
1440 } 1441 }
1441 } 1442 }
1442 1443
1443 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)) 1444 if (EQ (symbol, Qsignal) || EQ (symbol, Qexit) || EQ (symbol, Qclosed))
1444 remove_process (proc); 1445 exited++;
1445 1446
1446 Findent_to (i_buffer, minspace); 1447 Findent_to (i_buffer, minspace);
1447 if (NILP (p->buffer)) 1448 if (NILP (p->buffer))
1448 insert_string ("(none)"); 1449 insert_string ("(none)");
1449 else if (NILP (XBUFFER (p->buffer)->name)) 1450 else if (NILP (XBUFFER (p->buffer)->name))
1503 insert_string (" "); 1504 insert_string (" ");
1504 } 1505 }
1505 insert_string ("\n"); 1506 insert_string ("\n");
1506 } 1507 }
1507 } 1508 }
1509 if (exited)
1510 status_notify (NULL);
1508 return Qnil; 1511 return Qnil;
1509 } 1512 }
1510 1513
1511 DEFUN ("list-processes", Flist_processes, Slist_processes, 0, 1, "P", 1514 DEFUN ("list-processes", Flist_processes, Slist_processes, 0, 1, "P",
1512 doc: /* Display a list of all processes. 1515 doc: /* Display a list of all processes.