unofficial mirror of bug-gnu-emacs@gnu.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

* bug#21759: 25.0.50; process-menu-delete-process consistent w/ dired
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-23  5:26 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 21759

Tino Calancha <f92capac@gmail.com> writes:

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

Thanks; applied to the Emacs trunk (with some changes).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).