changeset 98384:2fee4892d51a

(command-line): Start the daemon server later.
author Romain Francoise <romain@orebokech.com>
date Sun, 28 Sep 2008 09:37:09 +0000
parents fb8c41cd17c4
children 8f747339c80c
files lisp/ChangeLog lisp/startup.el
diffstat 2 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Sep 28 08:43:50 2008 +0000
+++ b/lisp/ChangeLog	Sun Sep 28 09:37:09 2008 +0000
@@ -1,3 +1,7 @@
+2008-09-28  Romain Francoise  <romain@orebokech.com>
+
+	* startup.el (command-line): Start the daemon server later.
+
 2008-09-28  Martin Rudalics  <rudalics@gmx.at>
 
 	* subr.el (read-quoted-char): Call char-resolve-modifiers
--- a/lisp/startup.el	Sun Sep 28 08:43:50 2008 +0000
+++ b/lisp/startup.el	Sun Sep 28 09:37:09 2008 +0000
@@ -881,13 +881,8 @@
 
   (run-hooks 'before-init-hook)
 
-  (if (daemonp)
-      ;; Just start the server here, no need to run
-      ;; `frame-initialize', it deals with creating a frame and
-      ;; setting the parameters for the initial frame, we don't need
-      ;; any oxof those.
-      (server-start)
-    ;; Under X Window, this creates the X frame and deletes the terminal frame.
+  ;; Under X Window, this creates the X frame and deletes the terminal frame.
+  (unless (daemonp)
     (frame-initialize))
 
   ;; Turn off blinking cursor if so specified in X resources.  This is here
@@ -1224,6 +1219,13 @@
   ;; If -batch, terminate after processing the command options.
   (if noninteractive (kill-emacs t))
 
+  ;; In daemon mode, start the server to allow clients to connect.
+  ;; This is done after loading the user's init file and after
+  ;; processing all command line arguments to allow e.g. `server-name'
+  ;; to be changed before the server starts.
+  (when (daemonp)
+    (server-start))
+
   ;; Run emacs-session-restore (session management) if started by
   ;; the session manager and we have a session manager connection.
   (if (and (boundp 'x-session-previous-id)