]> code.delx.au - gnu-emacs/blobdiff - lisp/simple.el
-
[gnu-emacs] / lisp / simple.el
index 2a81ee745cb2c919e0aa16959f8a87ee6a158468..971f60067324800c71215e3d36e985ad847a7ba7 100644 (file)
@@ -3754,8 +3754,13 @@ support pty association, if PROGRAM is nil."
 (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 (min pos (point-max)))
+    (if (eobp)
+        (forward-line -1)
+      (beginning-of-line))))
 
 (defun list-processes--refresh ()
   "Recompute the list of processes for the Process List buffer.