all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Romain Francoise <romain@orebokech.com>, emacs-devel@gnu.org
Subject: Re: The emacsclient socket vs. etc/emacs.bash
Date: Fri, 08 Dec 2006 20:28:15 -0500	[thread overview]
Message-ID: <jwvveklg8y8.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <f7ccd24b0612081547m352547f4o3466504d2f637180@mail.gmail.com> (Juanma Barranquero's message of "Sat\, 9 Dec 2006 00\:47\:45 +0100")

>> Yes, that's a possible way to do it better.  But it still will not prevent
>> leftover socket files in case Emacs exited precipitously.

> No, but if an instance finds a socket/server-file and no one answers
> its request, it can assume the socket is a leftover, because there's
> no one listening out there. There's a tiny possibility for a race
> condition, but it would still be nicer to the user than the current "I
> can assume nothing, so I'll overwrite" method used now.

I'm not sure which problem you're trying to solve.  I'm talking here about
the problem in emacs.bash which uses the existence of the socket to decide
whether there is a live server or not.

Given the possibility of an Emacs crash leaving a dead socket, this
technique is simply not good enough.  Especially since you'll want to
connect to that socket anyway, so why not first try to connect: if it
succeeds keep on with the actual communication and if it fails then you know
for sure that there's no server available.  That's exactly what the
`alternate-editor' arg does.

>> Not so sure since you don't whether whether you're talking (though the
>> socket) to yourself or to some other process.

> I thought the socket name includes the pid of the Emacs instance; the
> server-file certainly does, so for TCP sockets it's easy to know.

No, the socket name is a "constant" and needs to be constructed without
knowing the process id of the server.  I believe the same holds for the
server-file: the pid is inside the file, not in the file name.  For sockets
we don't have such a place to put this kind of info right now.


        Stefan

  reply	other threads:[~2006-12-09  1:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-08 13:15 The emacsclient socket vs. etc/emacs.bash Romain Francoise
2006-12-08 13:46 ` Stefan Monnier
2006-12-08 14:06   ` Romain Francoise
2006-12-08 18:38     ` Stefan Monnier
2006-12-08 19:10       ` Juanma Barranquero
2006-12-08 23:33         ` Stefan Monnier
2006-12-08 23:47           ` Juanma Barranquero
2006-12-09  1:28             ` Stefan Monnier [this message]
2006-12-09 11:36           ` Romain Francoise
2006-12-09  1:26 ` Richard Stallman
2006-12-09  3:55   ` Stefan Monnier
2006-12-09 18:25     ` Richard Stallman
2006-12-15 12:45       ` Juanma Barranquero
2006-12-15 13:37         ` Kim F. Storm
2006-12-15 14:05           ` Juanma Barranquero
2006-12-15 23:40             ` Stefan Monnier
2006-12-15 23:47               ` Juanma Barranquero
2006-12-16  9:54                 ` Eli Zaretskii
2006-12-16 11:07                   ` Juanma Barranquero
2006-12-15 21:07           ` Andreas Schwab
  -- strict thread matches above, loose matches on Subject: below --
2006-12-15 13:54 LENNART BORGMAN
2006-12-15 15:18 ` Kim F. Storm
2006-12-15 15:24   ` Lennart Borgman
2006-12-15 15:38     ` Kim F. Storm
2006-12-15 15:48       ` Lennart Borgman
2006-12-15 23:21         ` Kim F. Storm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvveklg8y8.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=romain@orebokech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.