From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: The emacsclient socket vs. etc/emacs.bash Date: Fri, 08 Dec 2006 18:33:48 -0500 Message-ID: References: <87odqe4jg2.fsf@pacem.orebokech.com> <87k6124h38.fsf@pacem.orebokech.com> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1165620854 13147 80.91.229.10 (8 Dec 2006 23:34:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 8 Dec 2006 23:34:14 +0000 (UTC) Cc: Romain Francoise , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 09 00:34:12 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GspEH-0006DQ-Ep for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2006 00:34:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GspEG-0001sa-UW for ged-emacs-devel@m.gmane.org; Fri, 08 Dec 2006 18:34:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GspE4-0001rn-S6 for emacs-devel@gnu.org; Fri, 08 Dec 2006 18:33:56 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GspE2-0001qW-Pt for emacs-devel@gnu.org; Fri, 08 Dec 2006 18:33:55 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GspE1-0001qH-W3 for emacs-devel@gnu.org; Fri, 08 Dec 2006 18:33:54 -0500 Original-Received: from [209.226.175.74] (helo=tomts20-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GspE1-0004i6-R2 for emacs-devel@gnu.org; Fri, 08 Dec 2006 18:33:54 -0500 Original-Received: from pastel.home ([70.55.82.193]) by tomts20-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20061208233351.XTW24907.tomts20-srv.bellnexxia.net@pastel.home> for ; Fri, 8 Dec 2006 18:33:51 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 88D91846D; Fri, 8 Dec 2006 18:33:48 -0500 (EST) Original-To: "Juanma Barranquero" In-Reply-To: (Juanma Barranquero's message of "Fri\, 8 Dec 2006 20\:10\:24 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) 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:63478 Archived-At: >> Yes, the CVS had a code for a short while, where it removed the >> socket file. But it was fixed. > If the Emacs server detects that the server file exists (which means: > another Emacs instance, in the same machine, with the same server > name), The problem is to remove the socket file when the server quits, because we don't know for sure that it's still our socket. > it could read its contents and contact the previous Emacs > instance. Then: > - If it cannot connect, assume it's a leftover and overwrite it > - If it can connect and the previous Emacs wants to keep it, don't > start the server on the new instance (and warn the user) > - If it can connect and the previous Emacs relinquishes the server, > overwrite the server file (and the previous instance knows it is not > the server anymore) Yes, that's a possible way to do it better. But it still will not prevent leftover socket files in case Emacs exited precipitously. So it's still preferable for emacs.bash to use the `alternate-editor' argument. > It should be relatively simple to implement. Not so sure since you don't whether whether you're talking (though the socket) to yourself or to some other process. Stefan