From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: list-processes and signal-process don't communicate Date: 25 Oct 2002 16:18:04 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5xr8eemwkj.fsf@kfs2.cua.dk> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1035551871 5311 80.91.224.249 (25 Oct 2002 13:17:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 25 Oct 2002 13:17:51 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1854LV-0001ND-00 for ; Fri, 25 Oct 2002 15:17:49 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 1854OB-0003Vi-00 for ; Fri, 25 Oct 2002 15:20:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 1854Lv-0000sc-00; Fri, 25 Oct 2002 09:18:15 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 1854Lf-0000e8-00 for emacs-devel@gnu.org; Fri, 25 Oct 2002 09:17:59 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 1854Lc-0000dd-00 for emacs-devel@gnu.org; Fri, 25 Oct 2002 09:17:59 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10) id 1854Lc-0000dZ-00 for emacs-devel@gnu.org; Fri, 25 Oct 2002 09:17:56 -0400 Original-Received: from kfs2.cua.dk.cua.dk (kfs2.local.filanet.dk [192.168.1.182]) by mail.filanet.dk (Postfix) with SMTP id 4DF6C7C017; Fri, 25 Oct 2002 13:17:55 +0000 (GMT) Original-To: grossjoh@lothlorien.cs.uni-dortmund.de (=?iso-8859-1?q?Kai_Gro=DFjohann?=) In-Reply-To: Original-Lines: 87 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:8784 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:8784 grossjoh@lothlorien.cs.uni-dortmund.de (Kai Gro=DFjohann) writes: > I'd expect that the output of M-x list-processes RET helps me for a > subsequent M-x signal-process RET. Alas, this is not the case: > list-processes doesn't print the process id and signal-process > doesn't know about process names. Allowing the user to enter the name of a process in addition to a numeric pid to signal-process would be trivial enhancement to signal-process: Index: process.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/emacs/src/process.c,v retrieving revision 1.382 diff -c -r1.382 process.c *** process.c 24 Oct 2002 08:03:41 -0000 1.382 --- process.c 25 Oct 2002 13:15:28 -0000 *************** *** 5391,5404 **** } =20=20 DEFUN ("signal-process", Fsignal_process, Ssignal_process, ! 2, 2, "nProcess number: \nnSignal code: ", ! doc: /* Send the process with process id PID the signal with code = SIGCODE. ! PID must be an integer. The process need not be a child of this Emacs. SIGCODE may be an integer, or a symbol whose name is a signal name. */) ! (pid, sigcode) ! Lisp_Object pid, sigcode; { ! CHECK_NUMBER (pid); =20=20 #define handle_signal(NAME, VALUE) \ else if (!strcmp (name, NAME)) \ --- 5391,5430 ---- } =20=20 DEFUN ("signal-process", Fsignal_process, Ssignal_process, ! 2, 2, "sProcess (name or number): \nnSignal code: ", ! doc: /* Send PROCESS the signal with code SIGCODE. ! PROCESS may also be an integer specifying the process id of the ! process to signal; in this case, the process need not be a child of ! this Emacs. SIGCODE may be an integer, or a symbol whose name is a signal name. */) ! (process, sigcode) ! Lisp_Object process, sigcode; { ! Lisp_Object pid; !=20 ! if (STRINGP (process)) ! { ! Lisp_Object tem; ! if (tem =3D Fget_process (process), !NILP (tem)) ! process =3D tem; ! else ! process =3D Fstring_to_number (process, make_number (10)); ! } ! else ! process =3D get_process (process); !=20 ! if (NILP (process)) ! return process; !=20 ! if (INTEGERP (process)) ! pid =3D process; ! else ! { ! CHECK_PROCESS (process); ! pid =3D XPROCESS (process)->pid; ! if (!INTEGERP (pid) || XINT (pid) <=3D 0) ! error ("Cannot signal process %s", SDATA (XPROCESS (process)->name)); ! } =20=20 #define handle_signal(NAME, VALUE) \ else if (!strcmp (name, NAME)) \ >=20 > A simple workaround would be to have list-processes show the pid. A more complex approach would be to make the list-processes buffer obey a mouse-3 click on a process to pop-up menu which allowed you to terminate them using the mouse. [and suitable keyboard short-cuts as well of course]. --=20 Kim F. Storm http://www.cua.dk