[Top][All Lists]

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

Killing a named process.

From: Matt Hodges
Subject: Killing a named process.
Date: 10 Nov 2000 11:59:25 +0000

Feature request: occasionally I want to be able to kill a process (as
seen in the *Process List* buffer) and no convenience command (eg
ispell-kill-ispell) exists.

Did I miss a way of easily doing this? If not, the following can be

(defun kill-named-process ()
  "Kill a process chosen from a list.
The list is built from the function `process-list'."
  (if (equal (length (process-list)) 0)
      (error "No processes exist"))
  (let* ((process-list
           (function (lambda (w)
                       (list (process-name w) w)))
           "Choose process to kill: " process-list nil t))
     ((> (length process-name) 0)
      (setq process (cadr (assoc process-name process-list)))
      (kill-process process)
      ;; Update the *Process List* buffer
      (if (buffer-live-p (get-buffer "*Process List*"))
            ;; Wait until process disappears off list
            (while (member process (process-list))
              (sit-for 0 100))
      (message "Process \"%s\" killed" process-name))
      (message "No process chosen")))))

reply via email to

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