emacs-devel
[Top][All Lists]
Advanced

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

Re: list-processes and signal-process don't communicate


From: Kim F. Storm
Subject: Re: list-processes and signal-process don't communicate
Date: 25 Oct 2002 16:18:04 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

address@hidden (Kai Gro├čjohann) 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
===================================================================
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 ****
  }
  
  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);
  
  #define handle_signal(NAME, VALUE)            \
    else if (!strcmp (name, NAME))              \
--- 5391,5430 ----
  }
  
  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;
! 
!   if (STRINGP (process))
!     {
!       Lisp_Object tem;
!       if (tem = Fget_process (process), !NILP (tem))
!       process = tem;
!       else
!       process = Fstring_to_number (process, make_number (10));
!     }
!   else
!     process = get_process (process);
! 
!   if (NILP (process))
!     return process;
! 
!   if (INTEGERP (process))
!     pid = process;
!   else
!     {
!       CHECK_PROCESS (process);
!       pid = XPROCESS (process)->pid;
!       if (!INTEGERP (pid) || XINT (pid) <= 0)
!       error ("Cannot signal process %s", SDATA (XPROCESS (process)->name));
!     }
  
  #define handle_signal(NAME, VALUE)            \
    else if (!strcmp (name, NAME))              \


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

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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