display a warning instead of raising an error.
* startup.el (server-process): Add defvar.
(command-line): If the daemon is unable to start the server,
display a message and exit Emacs.
+2008-12-16 Juanma Barranquero <lekktu@gmail.com>
+
+ * server.el (server-start): If unable to start the server,
+ display a warning instead of raising an error.
+
+ * startup.el (server-process): Add defvar.
+ (command-line): If the daemon is unable to start the server,
+ display a message and exit Emacs.
+
2008-12-15 Sam Steingold <sds@gnu.org>
* progmodes/cc-cmds.el (c-defun-name): Handle DEFFOO(name,...),
;; Remove any leftover socket or authentication file
(ignore-errors (delete-file server-file))
(setq server-mode nil) ;; already set by the minor mode code
- (error "Server %S is already running" server-name))
+ (display-warning 'server
+ (format "Emacs server named %S already running" server-name)
+ :warning)
+ (setq leave-dead t))
;; If this Emacs already had a server, clear out associated status.
(while server-clients
(server-delete-client (car server-clients)))
;; Now any previous server is properly stopped.
(if leave-dead
(progn
- (server-log (message "Server stopped"))
+ (unless (eq t leave-dead) (server-log (message "Server stopped")))
(setq server-process nil))
;; Make sure there is a safe directory in which to place the socket.
(server-ensure-safe-dir server-dir)
(declare-function tool-bar-setup "tool-bar")
(defvar server-name)
+(defvar server-process)
(defun command-line ()
(setq before-init-time (current-time)
(when dn
(when (stringp dn) (setq server-name dn))
(server-start)
- (daemon-initialized)))
+ (if server-process
+ (daemon-initialized)
+ (message "Unable to start daemon: Emacs server named %S already running" server-name)
+ (kill-emacs 1))))
;; Run emacs-session-restore (session management) if started by
;; the session manager and we have a session manager connection.