emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 1b0bf99: Keep the position in the process buffer wh


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 1b0bf99: Keep the position in the process buffer when deleting processes
Date: Tue, 23 Feb 2016 05:26:49 +0000

branch: master
commit 1b0bf990b53a2626e2b825101615d72d78f98ef7
Author: Tino Calancha <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    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
---
 lisp/simple.el |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 4efad8c..8c9d546 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3746,8 +3746,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.



reply via email to

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