In Emacs 23 or later, you can use M-x proced
to get a list of
running processes. You can sort and filter them in various ways, the
most common end goal being to quickly find and kill certain processes
in my experience.
However, Proced currently doesn't work on OSX. I just spent a few minutes figuring out why, so I hope writing this could save someone else some effort.
Proced is not based on command line tools such as ps
, but uses
Emacs Lisp functions implemented in C to get the list of processes
(list-system-processes
) and to get process attributes
(process-attributes
). list-system-processes
works on OSX, but
process-attributes
does not.
sysdep.c
contains a few different implementations guarded by #ifdef
s, and
this is the one chosen for OSX:
Lisp_Object
system_process_attributes (Lisp_Object pid)
{
return Qnil;
}
In March 2010, this was discussed on the macosx-emacs mailing list, and a patch giving parts of the needed information yielded a screenshot, but it seems that it wasn't finished, nor merged into Emacs.
Update: I got bored and wrote a patch for it. It basically works, but there are some things that it currently doesn't retrieve, notably memory and CPU usage, and command line arguments.
Emacs' process editor (proced) works on many operating systems, but not OSX. Here is why.