emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107143: * simple.el (list-processes-


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107143: * simple.el (list-processes--refresh): Delete exited processes.
Date: Mon, 06 Feb 2012 22:40:10 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107143
fixes bug(s): http://debbugs.gnu.org/8094
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Mon 2012-02-06 22:40:10 +0800
message:
  * simple.el (list-processes--refresh): Delete exited processes.
modified:
  lisp/ChangeLog
  lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-02-06 13:56:40 +0000
+++ b/lisp/ChangeLog    2012-02-06 14:40:10 +0000
@@ -1,5 +1,8 @@
 2012-02-06  Chong Yidong  <address@hidden>
 
+       * simple.el (list-processes--refresh): Delete exited processes
+       (Bug#8094).
+
        * comint.el (comint-next-prompt): next-single-char-property-change
        and prev-single-char-property-change never return nil (Bug#8657).
 

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2012-02-04 19:48:06 +0000
+++ b/lisp/simple.el    2012-02-06 14:40:10 +0000
@@ -2713,47 +2713,50 @@
   (tabulated-list-init-header))
 
 (defun list-processes--refresh ()
-  "Recompute the list of processes for the Process List buffer."
+  "Recompute the list of processes for the Process List buffer.
+Also, delete any process that is exited or signaled."
   (setq tabulated-list-entries nil)
   (dolist (p (process-list))
-    (when (or (not process-menu-query-only)
-             (process-query-on-exit-flag p))
-      (let* ((buf (process-buffer p))
-            (type (process-type p))
-            (name (process-name p))
-            (status (symbol-name (process-status p)))
-            (buf-label (if (buffer-live-p buf)
-                           `(,(buffer-name buf)
-                             face link
-                             help-echo ,(concat "Visit buffer `"
-                                                (buffer-name buf) "'")
-                             follow-link t
-                             process-buffer ,buf
-                             action process-menu-visit-buffer)
-                         "--"))
-            (tty (or (process-tty-name p) "--"))
-            (cmd
-             (if (memq type '(network serial))
-                 (let ((contact (process-contact p t)))
-                   (if (eq type 'network)
-                       (format "(%s %s)"
-                               (if (plist-get contact :type)
-                                   "datagram"
-                                 "network")
-                               (if (plist-get contact :server)
-                                   (format "server on %s"
-                                           (plist-get contact :server))
-                                 (format "connection to %s"
-                                         (plist-get contact :host))))
-                     (format "(serial port %s%s)"
-                             (or (plist-get contact :port) "?")
-                             (let ((speed (plist-get contact :speed)))
-                               (if speed
-                                   (format " at %s b/s" speed)
-                                 "")))))
-               (mapconcat 'identity (process-command p) " "))))
-       (push (list p (vector name status buf-label tty cmd))
-             tabulated-list-entries)))))
+    (cond ((memq (process-status p) '(exit signal closed))
+          (delete-process p))
+         ((or (not process-menu-query-only)
+              (process-query-on-exit-flag p))
+          (let* ((buf (process-buffer p))
+                 (type (process-type p))
+                 (name (process-name p))
+                 (status (symbol-name (process-status p)))
+                 (buf-label (if (buffer-live-p buf)
+                                `(,(buffer-name buf)
+                                  face link
+                                  help-echo ,(concat "Visit buffer `"
+                                                     (buffer-name buf) "'")
+                                  follow-link t
+                                  process-buffer ,buf
+                                  action process-menu-visit-buffer)
+                              "--"))
+                 (tty (or (process-tty-name p) "--"))
+                 (cmd
+                  (if (memq type '(network serial))
+                      (let ((contact (process-contact p t)))
+                        (if (eq type 'network)
+                            (format "(%s %s)"
+                                    (if (plist-get contact :type)
+                                        "datagram"
+                                      "network")
+                                    (if (plist-get contact :server)
+                                        (format "server on %s"
+                                                (plist-get contact :server))
+                                      (format "connection to %s"
+                                              (plist-get contact :host))))
+                          (format "(serial port %s%s)"
+                                  (or (plist-get contact :port) "?")
+                                  (let ((speed (plist-get contact :speed)))
+                                    (if speed
+                                        (format " at %s b/s" speed)
+                                      "")))))
+                    (mapconcat 'identity (process-command p) " "))))
+            (push (list p (vector name status buf-label tty cmd))
+                  tabulated-list-entries))))))
 
 (defun process-menu-visit-buffer (button)
   (display-buffer (button-get button 'process-buffer)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]