From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Roland Winkler" Newsgroups: gmane.emacs.devel Subject: Re: proced: ppid of process ID 0 can be 0 Date: Sun, 21 Dec 2008 05:48:00 +0100 Message-ID: <18765.51840.943986.608296@tfkp04.physik.uni-erlangen.de> References: <18765.19040.568030.246241@tfkp04.physik.uni-erlangen.de> <18765.29820.997276.703222@tfkp04.physik.uni-erlangen.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1229834903 18129 80.91.229.12 (21 Dec 2008 04:48:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Dec 2008 04:48:23 +0000 (UTC) Cc: lekktu@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 21 05:49:30 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LEGFt-0007yF-Us for ged-emacs-devel@m.gmane.org; Sun, 21 Dec 2008 05:49:30 +0100 Original-Received: from localhost ([127.0.0.1]:35460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LEGEh-0007oT-9s for ged-emacs-devel@m.gmane.org; Sat, 20 Dec 2008 23:48:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LEGEc-0007oE-2P for emacs-devel@gnu.org; Sat, 20 Dec 2008 23:48:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LEGEZ-0007o2-Jj for emacs-devel@gnu.org; Sat, 20 Dec 2008 23:48:08 -0500 Original-Received: from [199.232.76.173] (port=57615 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LEGEZ-0007nz-Ei for emacs-devel@gnu.org; Sat, 20 Dec 2008 23:48:07 -0500 Original-Received: from tfkpsv.physik.uni-erlangen.de ([131.188.164.197]:5333) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LEGEW-0000ln-VG; Sat, 20 Dec 2008 23:48:05 -0500 Original-Received: from tfkp04.physik.uni-erlangen.de (tfkp04.physik.uni-erlangen.de [131.188.164.204]) by tfkpsv.physik.uni-erlangen.de (Postfix) with ESMTP id E85DE21486; Sun, 21 Dec 2008 05:48:02 +0100 (CET) In-Reply-To: X-Mailer: VM 8.0.9 under Emacs 22.2.1 (i686-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:107155 Archived-At: On Sun Dec 21 2008 Eli Zaretskii wrote: > Yes, but nobody said that looking at ppid you will have a proper > tree. Under GNU/linux, the procps package contains not only the ps command. But it also contains the command pstree. Though I didn't look at pstree's source code, I guess it is doing its job by analyzing ppid's. Dan Nicolaescu had suggested ("wishlist") that it would be nice to have an emacs/proced implementation of pstree. I guess he is right. Often it might be much easier to manipulate processes if proced didn't present the processes in some linear order; but instead it made the tree structure with parents and children transparent. > > Is there any possiblity missing? > > Maybe not, but that's not what I was asking. I was asking why you > need the assumption about this behavior. I now understand that it is > only for handling processes as a tree. So I will write a primitive > for the root of that tree that Lisp code should use for such > decisions. Somehow I am missing the point here. Why do you think it is necessary or advantageous to have a separate primitive for that? Isn't it more transparent to implement this on the lisp level? Proced already provides a function proced-process-tree. It seems to me that all one needs for making this more robust is a more accurate rule of how system-process-attributes handles the ppid attribute in certain special cases. (And I expect that proced could easily work around in a robust way if no such rule was implemented. Simply, up to now I didn't worry about that when I wrote the proced code.)