unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: list-processes and signal-process don't communicate
Date: 25 Oct 2002 16:18:04 +0200	[thread overview]
Message-ID: <5xr8eemwkj.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <vafn0qb71m7.fsf@lucy.cs.uni-dortmund.de>

grossjoh@lothlorien.cs.uni-dortmund.de (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 <storm@cua.dk> http://www.cua.dk

  reply	other threads:[~2002-10-25 14:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-21 16:23 list-processes and signal-process don't communicate Kai Großjohann
2002-10-25 14:18 ` Kim F. Storm [this message]
2002-10-25 14:56   ` Kim F. Storm
2002-10-26 12:31     ` Kai Großjohann
2002-10-26 20:13   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5xr8eemwkj.fsf@kfs2.cua.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).