all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#21759: 25.0.50; process-menu-delete-process consistent w/ dired
@ 2015-10-26 10:30 Tino Calancha
  2016-02-23  5:26 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Tino Calancha @ 2015-10-26 10:30 UTC (permalink / raw)
  To: 21759

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]


* 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.

[-- Attachment #2: Type: text/plain, Size: 647 bytes --]

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.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-23  5:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-26 10:30 bug#21759: 25.0.50; process-menu-delete-process consistent w/ dired Tino Calancha
2016-02-23  5:26 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.