1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-27 10:54:40 +00:00

Keep the position in the process buffer when deleting processes

* lisp/simple.el (process-menu-delete-process): Keep the
position in the buffer after killing a process (bug#21759).

Copyright-paperwork-exempt: yes
This commit is contained in:
Tino Calancha 2016-02-23 16:24:52 +11:00 committed by Lars Ingebrigtsen
parent 92da003692
commit 1b0bf990b5

View File

@ -3746,8 +3746,13 @@ support pty association, if PROGRAM is nil."
(defun process-menu-delete-process () (defun process-menu-delete-process ()
"Kill process at point in a `list-processes' buffer." "Kill process at point in a `list-processes' buffer."
(interactive) (interactive)
(delete-process (tabulated-list-get-id)) (let ((pos (point)))
(revert-buffer)) (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 () (defun list-processes--refresh ()
"Recompute the list of processes for the Process List buffer. "Recompute the list of processes for the Process List buffer.