Subject: bug#1058: 23.0.60; emacs --daemon should not return until socket is ready

From: Dan Nicolaescu <[email-masked]>
Date: Thu, 2 Oct 2008 21:52:02 -0700 (PDT)

Stefan Monnier <[email-masked]> writes:

  > > Depending on what the definition if "right" is... If it means enabling
  > > interaction before detaching, then you might be right (haven't checked).
  > > If it means the patch that Romain posted, that should be fine to go in
  > > now.
  > 
  > I can't tell yet whether Romain's patch does the right thing: do errors
  > in .emacs get properly reported to stdout?

Romain's patch solves the other problem: the fact that the initial
parent process returns before the server is started, so that 
emacs --daemon && emacsclient -c 
does not work.

I am not sure if moving the code that forks/disconnects from the
terminal later solves the reporting errors problem.  (and I can't really
try at the moment).

  > >> What happens to messages resulting from executing .emacs in solution nb
  > >> 2 are they sent to stdout or are they silently dropped?
  > > deamon's stdin/stdout/stderr go to /dev/null.
  > 
  > That's mostly OK, but not before the .emacs (and --eval) get processed.
  > 
  > >> PS: Currently "emacs --daemon" doesn't do anything for me: it
  > >> immediately (as in "I've never seen Emacs start or stop so fast")
  > >> returns with no output and no remaining process.
  > 
  > > How about "emacs -Q --daemon" ?
  > 
  > Same thing.

Hmm, you mean that after "emacs -Q --daemon" if you look with ps there's
no emacs process at all?  And "emacsclient -t" does not connect to it?