Subject: bug#21725: closed (Re: bug#21725: 25.0; list-processes dont show process id)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 07 Jun 2016 19:08:01 +0000

Your bug report

#21725: 25.0; list-processes dont show process id

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
21725: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21725
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#21725: 25.0; list-processes dont show process id
From: Glenn Morris <[email-masked]>
To: [email-masked]
Date: Tue, 07 Jun 2016 15:07:27 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 25.2

Thanks; applied.

Subject: 25.0; list-processes dont show process id
From: Tino Calancha <[email-masked]>
To: [email-masked]
Date: Wed, 21 Oct 2015 18:30:43 +0900 (JST)
List-Id: <debbugs-submit.debbugs.gnu.org>

In GNU Emacs 25.0.50 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23)
  of 2015-10-21

list-processes should show the process id. This is particularly important
for those processes not associated to a buffer: showing a column with
the PID greatly simplify killing those processes when they are not needed.

diff --git a/lisp/simple.el b/lisp/simple.el
index 8acb683..0ec03f9 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3538,6 +3538,7 @@ process-menu-mode-map
 (define-derived-mode process-menu-mode tabulated-list-mode "Process Menu"
   "Major mode for listing the processes called by Emacs."
   (setq tabulated-list-format [("Process" 15 t)
+			       ("PID"      7 t)
 			       ("Status"   7 t)
 			       ("Buffer"  15 t)
 			       ("TTY"     12 t)
@@ -3564,6 +3565,7 @@ list-processes--refresh
 	       (process-query-on-exit-flag p))
 	   (let* ((buf (process-buffer p))
 		  (type (process-type p))
+		  (pid  (if (process-id p) (format "%d" (process-id p)) "--"))
 		  (name (process-name p))
 		  (status (symbol-name (process-status p)))
 		  (buf-label (if (buffer-live-p buf)
@@ -3599,7 +3601,7 @@ list-processes--refresh
 					 (format " at %s b/s" speed)
 				       "")))))
 		     (mapconcat 'identity (process-command p) " "))))
-	     (push (list p (vector name status buf-label tty cmd))
+	     (push (list p (vector name pid status buf-label tty cmd))
 		   tabulated-list-entries))))))
 
 (defun process-menu-visit-buffer (button)