connect and create graphical or terminal frames using
@code{emacsclient}.
+@item -daemon=@var{SERVER-NAME}
+Start emacs in background as a daemon, and start the server with the
+name set to @var{SERVER-NAME}.
+
@item --no-splash
@opindex --no-splash
@vindex inhibit-startup-screen
+2008-10-27 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * startup.el (server-name): Pacify byte compiler.
+ (command-line): If --daemon=SERVER_NAME was used, set server-name
+ before calling server-start.
+
2008-10-26 Romain Francoise <romain@orebokech.com>
* startup.el (command-line): Call daemon-initialized after
(declare-function tool-bar-mode "tool-bar" (&optional arg))
(declare-function tool-bar-setup "tool-bar")
+(defvar server-name)
+
(defun command-line ()
(setq before-init-time (current-time)
after-init-time nil
;; 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)
- (daemon-initialized))
+ (let ((dn (daemonp)))
+ (when dn
+ (when (stringp dn) (setq server-name dn))
+ (server-start)
+ (daemon-initialized)))
;; Run emacs-session-restore (session management) if started by
;; the session manager and we have a session manager connection.
+2008-10-27 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * emacs.c (daemon_name): New variable.
+ (main): Deal with --daemon=SERVER_NAME.
+ (Fdaemonp): Return a name if one was passed to --daemon.
+
2008-10-26 Romain Francoise <romain@orebokech.com>
* emacs.c (daemon_pipe): New variable.
/* Nonzero means Emacs was started as a daemon. */
int is_daemon = 0;
+/* Name for the server started by the daemon.*/
+static char *daemon_name;
/* Pipe used to send exit notification to the daemon parent at
startup. */
#endif
int no_loadup = 0;
char *junk = 0;
+ char *dname_arg = 0;
#if GC_MARK_STACK
extern Lisp_Object *stack_base;
exit (0);
}
- if (argmatch (argv, argc, "-daemon", "--daemon", 5, NULL, &skip_args))
+ if (argmatch (argv, argc, "-daemon", "--daemon", 5, NULL, &skip_args)
+ || argmatch (argv, argc, "-daemon", "--daemon", 5, &dname_arg, &skip_args))
{
#ifndef DOS_NT
pid_t f;
exit (1);
}
+ if (dname_arg)
+ daemon_name = xstrdup (dname_arg);
/* Close unused reading end of the pipe. */
close (daemon_pipe[0]);
is_daemon = 1;
}
DEFUN ("daemonp", Fdaemonp, Sdaemonp, 0, 0, 0,
- doc: /* Return t if the current emacs process is a daemon. */)
+ doc: /* Return non-nil if the current emacs process is a daemon.
+If the daemon was given a name argument, return that name. */)
()
{
- return is_daemon ? Qt : Qnil;
+ if (is_daemon)
+ if (daemon_name)
+ return build_string (daemon_name);
+ else
+ return Qt;
+ else
+ return Qnil;
}
DEFUN ("daemon-initialized", Fdaemon_initialized, Sdaemon_initialized, 0, 0, 0,