]> code.delx.au - gnu-emacs/blobdiff - lisp/startup.el
(doc-view-scroll-up-or-next-page)
[gnu-emacs] / lisp / startup.el
index 253ac887fe7a22aedae280ca56863fa209571b87..22a9fa02103e97b26b261dbd3d3cb8b2165edf6c 100644 (file)
@@ -1,7 +1,7 @@
 ;;; startup.el --- process Emacs shell arguments
 
 ;; Copyright (C) 1985, 1986, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-;;   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;;   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 ;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -47,7 +47,7 @@ directory using `find-file'.  If t, open the `*scratch*' buffer."
   :type '(choice
          (const     :tag "Startup screen" nil)
          (directory :tag "Directory" :value "~/")
-         (file      :tag "File" :value "~/file.txt")
+         (file      :tag "File" :value "~/.emacs")
          (const     :tag "Lisp scratch buffer" t))
   :version "23.1"
   :group 'initialization)
@@ -694,6 +694,7 @@ opening the first frame (e.g. open a connection to an X server).")
 (declare-function tool-bar-setup "tool-bar")
 
 (defvar server-name)
+(defvar server-process)
 
 (defun command-line ()
   (setq before-init-time (current-time)
@@ -1220,7 +1221,14 @@ the `--debug-init' option to view a complete error backtrace."
     (when dn
       (when (stringp dn) (setq server-name dn))
       (server-start)
-      (daemon-initialized)))
+      (if server-process
+         (daemon-initialized)
+       (if (stringp dn)
+           (message
+            "Unable to start daemon: Emacs server named %S already running"
+            server-name)
+         (message "Unable to start the daemon.\nAnother instance of Emacs is running the server, either as daemon or interactively.\nYou can use emacsclient to connect to that Emacs process."))
+       (kill-emacs 1))))
 
   ;; Run emacs-session-restore (session management) if started by
   ;; the session manager and we have a session manager connection.