help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: server-start preempted by other emacs window


From: John Russell
Subject: Re: server-start preempted by other emacs window
Date: 28 Jan 2004 15:33:45 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > Is there a way to have emacs check to see if another server process
> > is running before it runs server-start?
> 
> Not really.  It's pretty tricky to do.
> One way is to see if the socket file is present in /tmp.
> But then it might be left over from a previous Emacs that's not running
> any more.  You could try and make sure that Emacs removes the socket file
> when it exits, but if it crashes, you're still left with a dead socket in
> /tmp.

Yeah, that doesn't sound like the perfect solution.


> A more robust way is to check whether you can connect to the socket.
> In Emacs-CVS you could do that with make-network-stream.

that has promise, I'll look into that.



> 
> But what people usually do is that they do not start-server automatically
> for each and every Emacs process, instead they either do it manually for
> the Emacs process they care about, or they do it via arguments passed to
> Emacs when starting up.
> E.g. I start my main emacs as `emacs-server' which is an alias for
> something like `emacs -geometry AxB+C+Z -f my-server-mode' where
> my-server-mode is a function defined in my .emacs that calls server-start
> and does a few other things that I only want done in my main Emacs but not
> in the Emacs I use to read Gnus, e.g.
>

That's a good idea.  I have an alternate startup for emacs which just
starts the most minimal set of things possible and just runs in the
terminal.  Its a replacement for vi for sys-admin stuff when I don't
want the whole big emacs IDE thingy.  But this could also work for
gnus as well.  Thanks for the tip.

John


reply via email to

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