GNU bug report logs - #1058
23.0.60; emacs --daemon should not return until socket is ready

Previous Next

Package: emacs;

Reported by: SRS0+wOMF+22+gmail.com=trentbuck <at> internode.on.net

Date: Tue, 30 Sep 2008 14:10:04 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Trent W. Buck" <trentbuck <at> gmail.com>
To: Romain Francoise <romain <at> orebokech.com>
Cc: Dan Nicolaescu <dann <at> ics.uci.edu>, 1058 <at> debbugs.gnu.org
Subject: bug#1058: 23.0.60; emacs --daemon should not return until socket is ready
Date: Thu, 2 Oct 2008 10:50:21 +1000
On Wed, Oct 01, 2008 at 09:39:40PM +0200, Romain Francoise wrote:
>> Just curious, what do you get if you do: emacs -Q --daemon; while !
>> ls /tmp/emacs1187/; do sleep 1; done
>
> Yes, the delay is caused by my change to load the init file before
> starting the server.

It's vaguely relevant that I have this in my .emacs:

  (progn
    (unless (< emacs-major-version 22)
      ;; Support multiple, concurrent Emacs servers.
      (setq server-name (format "server%d" (emacs-pid)))
      ;; Allow child processes to find the correct one.
      (setenv "EMACS_SOCKET_FILE" server-name)
      ;; Have other processes use the youngest server.
      (defadvice server-start (after multiple-server-start)
        (make-symbolic-link server-name
                            (concat server-socket-dir "/server")
                            t))
      (ad-activate 'server-start))
    (server-start))

and an emacsclient wrapper that includes

    ## In M-x shell always use the focused emacs, even if there are
    ## other Emacs servers.  Requires non-standard $EMACS_SOCKET_FILE,
    ## which is set in my .emacs.  Needs Emacs 22 or better.
    if [[ $EMACS_SOCKET_FILE && $INSIDE_EMACS && $v -ge 22 ]]
    ## With DISPLAY emacsclient tries to pop up an X frame.
    then exec env -u DISPLAY emacsclient -s "$EMACS_SOCKET_FILE" "$@"
    fi




This bug report was last modified 16 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.