Subject: bug#21759: 25.0.50; process-menu-delete-process consistent w/ dired

From: Tino Calancha <[email-masked]>
Date: Mon, 26 Oct 2015 19:30:33 +0900 (JST)

* lisp/simple (process-menu-delete-process):
After the process has being deleted and the current buffer reverted 
the point is set at (point-min).

In the other hand, when the file (buffer) at point is deleted with 
dired-do-delete (ibuffer-do-delete), after the current buffer is 
reverted, the point is set in the line right after (before) the line we 
just have deleted.

This patch follow similar behaviour as dired.
Maybe ibuffer should also follow dired on this, but that is a minor thing.

diff --git a/lisp/simple.el b/lisp/simple.el
index 338a060..880ef67 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3560,8 +3560,11 @@ process-menu-mode
 (defun process-menu-delete-process ()
   "Kill process at point in a `list-processes' buffer."
   (interactive)
-  (delete-process (tabulated-list-get-id))
-  (revert-buffer))
+  (let ((pos (point)))
+	(delete-process (tabulated-list-get-id))
+	(revert-buffer)
+	(goto-char pos)
+	(if (= (point) (point-max)) (forward-line -1) (goto-char (line-beginning-position)))))
 
 (defun list-processes--refresh ()
   "Recompute the list of processes for the Process List buffer.