emacs-devel
[Top][All Lists]
Advanced

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

Re: process-list in Elisp


From: Leo
Subject: Re: process-list in Elisp
Date: Tue, 22 Feb 2011 15:11:43 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.94 (Mac OS X 10.6.6)

On 2011-02-22 05:48 +0800, Stefan Monnier wrote:
> It looks like this died down. Could the two authors of the two
> competing implementations comment on their opinion on the best way to
> replace the current C code with Elisp code?
>
> It would be good if it could be installed first as a "replace the C
> code with functionally equivalent code" and then a bunch of patches
> adding new features (e.g. addressing bug#8087).

I think first we need to find a way to clean up signalled/exited/closed
processes in the elisp version of list-processes in order to keep its
documented behaviour.

Any objection to using this:

(mapc (lambda (p)
        (when (memq (process-status p) '(exit signal closed))
          (delete-process p)))
      (process-list))

This re-use delete-process instead of another primitive.

,----[ (info "(elisp)Deleting Processes") ]
| If you delete a terminated process explicitly before it is
| deleted automatically, no harm results.
`----

I attach an implementation of list-processes in elisp that's more or
less equivalent to the primitive list-processes except it no longer pops
up an empty buffer when the process list is empty.

Best wishes,
Leo

Attachment: emacs-process.el
Description: application/emacs-lisp


reply via email to

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