From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: desktop.el and his lock file Date: Wed, 03 Dec 2008 08:26:10 +0100 Message-ID: <87vdu1k9d9.fsf@tux.homenetwork> References: <87ej0qfeu5.fsf@tux.homenetwork> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228326859 20667 80.91.229.12 (3 Dec 2008 17:54:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Dec 2008 17:54:19 +0000 (UTC) Cc: emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 03 18:55:21 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 1L7vvl-0003dg-N9 for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 18:54:33 +0100 Original-Received: from localhost ([127.0.0.1]:34872 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7vub-0007vu-8j for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 12:53:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L7mCS-0004sX-QH for emacs-devel@gnu.org; Wed, 03 Dec 2008 02:31:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L7mCR-0004sK-Jg for emacs-devel@gnu.org; Wed, 03 Dec 2008 02:31:07 -0500 Original-Received: from [199.232.76.173] (port=58044 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7mCR-0004sH-DB for emacs-devel@gnu.org; Wed, 03 Dec 2008 02:31:07 -0500 Original-Received: from ey-out-1920.google.com ([74.125.78.149]:33311) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7mCQ-0004t6-O3 for emacs-devel@gnu.org; Wed, 03 Dec 2008 02:31:07 -0500 Original-Received: by ey-out-1920.google.com with SMTP id 4so1512194eyg.24 for ; Tue, 02 Dec 2008 23:31:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=CGESpaprxwudb6b2LgedfxnRwvzROfPiA2byQK5MOOA=; b=xcGLKWA0tbHgkQk+i/fpjE/AsEBTCkzsbLuJOPFSZFJm1cbGnpPDHuilcVBFvgyaII 20gSEtK8GGVixw9CXezp6xk3Jaeu6WtWMq8j+hFYS8gs8z7vz5y988ghTHMShjp1Cik1 2v54RTwWU0FQC3VNwNHDXzwRNu9bUvCmSju6s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=pmYMuz7r59LJUADoEt+hy2stBlHdfq8kYnjlJIvlaOb83LqeL5c7DcS7OjxgUWaaQd hsQCRKHQlB3pWw12ungqNfEJG934Dal+hdIeUq8JJefb/EzAd64vunECHLpTwGTJ9dor FxYLgNM/7jcvXSMVhJE809G87SV84HzXDXHp0= Original-Received: by 10.103.172.7 with SMTP id z7mr5767639muo.15.1228289465544; Tue, 02 Dec 2008 23:31:05 -0800 (PST) Original-Received: from tux.homenetwork (49.78.88-79.rev.gaoland.net [79.88.78.49]) by mx.google.com with ESMTPS id u9sm13253434muf.34.2008.12.02.23.31.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 02 Dec 2008 23:31:05 -0800 (PST) In-Reply-To: (Miles Bader's message of "Wed, 03 Dec 2008 16:19:11 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Wed, 03 Dec 2008 12:53:18 -0500 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:106522 Archived-At: Miles Bader writes: > Thierry Volpiatto writes: >> here is the code i put after line 967 in desktop.el: >> >> the function is desktop-read >> ,---- >> | (if (and owner >> | (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs | grep %d" (getenv "USER") owner))) >> | ..... >> `---- > > It might be better to use the `signal-process' function with signal > number 0 -- that will just check to see if the process exists and return > an appropriate exit code (0 = exists, -1 = doesn't exist), without > actually sending any signal. > > [I guess it won't work on windows, but presumably neither does your > pipeline... :-] yes: ,---- | (and (system-process-attributes owner) | (string-match "emacs" | (cdr (assq 'comm | (system-process-attributes owner))))) `---- -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France