Rename '--new-daemon' to 'fg-daemon' and '--old-daemon' to '--bg-daemon'

* doc/emacs/cmdargs.texi (Initial Options):
* doc/lispref/os.texi (Startup Summary):
* etc/NEWS:
* etc/emacs.service:
* src/emacs.c (main):
* src/lisp.h: Rename '--new-daemon' to 'fg-daemon' and '--old-daemon' to
'--bg-daemon'.
This commit is contained in:
Noam Postavsky 2017-05-29 22:13:53 -04:00
parent 941a2e7347
commit 75b8492946
6 changed files with 21 additions and 20 deletions

View file

@ -336,16 +336,16 @@ setting @code{inhibit-x-resources} to @code{t} (@pxref{Resources}).
@opindex -daemon
@itemx --daemon[=@var{name}]
@opindex --daemon
@itemx --old-daemon[=@var{name}]
@itemx --new-daemon[=@var{name}]
@itemx --bg-daemon[=@var{name}]
@itemx --fg-daemon[=@var{name}]
Start Emacs as a daemon---after Emacs starts up, it starts the Emacs
server without opening any frames.
(Optionally, you can specify an explicit @var{name} for the server.)
You can then use the @command{emacsclient} command to connect to Emacs
for editing. @xref{Emacs Server}, for information about using Emacs
as a daemon. An ``old-style'' daemon disconnects from the terminal
as a daemon. A ``background'' daemon disconnects from the terminal
and runs in the background (@samp{--daemon} is an alias for
@samp{--old-daemon}).
@samp{--bg-daemon}).
@item --no-desktop
@opindex --no-desktop

View file

@ -337,10 +337,10 @@ Do not display a splash screen.
Run without an interactive terminal. @xref{Batch Mode}.
@item --daemon
@itemx --old-daemon
@itemx --new-daemon
@itemx --bg-daemon
@itemx --fg-daemon
Do not initialize any display; just start a server.
(An ``old-style'' daemon automatically runs in the background.)
(A ``background'' daemon automatically runs in the background.)
@item --no-init-file
@itemx -q

View file

@ -78,10 +78,11 @@ affected by this, as SGI stopped supporting IRIX in December 2013.
* Startup Changes in Emacs 26.1
** New option '--new-daemon'. This is the same as '--daemon', except
+++
** New option '--fg-daemon'. This is the same as '--daemon', except
it runs in the foreground and does not fork. This is intended for
modern init systems such as systemd, which manage many of the traditional
aspects of daemon behavior themselves. '--old-daemon' is now an alias
aspects of daemon behavior themselves. '--bg-daemon' is now an alias
for '--daemon'.
+++

View file

@ -8,7 +8,7 @@ Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
[Service]
Type=simple
ExecStart=emacs --new-daemon
ExecStart=emacs --fg-daemon
ExecStop=emacsclient --eval "(kill-emacs)"
Environment=SSH_AUTH_SOCK=%t/keyring/ssh
Restart=on-failure

View file

@ -219,8 +219,8 @@ Initialization options:\n\
"\
--batch do not do interactive display; implies -q\n\
--chdir DIR change to directory DIR\n\
--daemon, --old-daemon[=NAME] start a (named) server in the background\n\
--new-daemon[=NAME] start a (named) server in the foreground\n\
--daemon, --bg-daemon[=NAME] start a (named) server in the background\n\
--fg-daemon[=NAME] start a (named) server in the foreground\n\
--debug-init enable Emacs Lisp debugger for init file\n\
--display, -d DISPLAY use X server DISPLAY\n\
",
@ -991,15 +991,15 @@ main (int argc, char **argv)
int sockfd = -1;
if (argmatch (argv, argc, "-new-daemon", "--new-daemon", 10, NULL, &skip_args)
|| argmatch (argv, argc, "-new-daemon", "--new-daemon", 10, &dname_arg, &skip_args))
if (argmatch (argv, argc, "-fg-daemon", "--fg-daemon", 10, NULL, &skip_args)
|| argmatch (argv, argc, "-fg-daemon", "--fg-daemon", 10, &dname_arg, &skip_args))
{
daemon_type = 1; /* foreground */
}
else if (argmatch (argv, argc, "-daemon", "--daemon", 5, NULL, &skip_args)
|| argmatch (argv, argc, "-daemon", "--daemon", 5, &dname_arg, &skip_args)
|| argmatch (argv, argc, "-old-daemon", "--old-daemon", 10, NULL, &skip_args)
|| argmatch (argv, argc, "-old-daemon", "--old-daemon", 10, &dname_arg, &skip_args))
|| argmatch (argv, argc, "-bg-daemon", "--bg-daemon", 10, NULL, &skip_args)
|| argmatch (argv, argc, "-bg-daemon", "--bg-daemon", 10, &dname_arg, &skip_args))
{
daemon_type = 2; /* background */
}
@ -1114,7 +1114,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
char fdStr[80];
int fdStrlen =
snprintf (fdStr, sizeof fdStr,
"--old-daemon=\n%d,%d\n%s", daemon_pipe[0],
"--bg-daemon=\n%d,%d\n%s", daemon_pipe[0],
daemon_pipe[1], dname_arg ? dname_arg : "");
if (! (0 <= fdStrlen && fdStrlen < sizeof fdStr))
@ -1711,8 +1711,8 @@ static const struct standard_args standard_args[] =
{ "-batch", "--batch", 100, 0 },
{ "-script", "--script", 100, 1 },
{ "-daemon", "--daemon", 99, 0 },
{ "-old-daemon", "--old-daemon", 99, 0 },
{ "-new-daemon", "--new-daemon", 99, 0 },
{ "-bg-daemon", "--bg-daemon", 99, 0 },
{ "-fg-daemon", "--fg-daemon", 99, 0 },
{ "-help", "--help", 90, 0 },
{ "-nl", "--no-loadup", 70, 0 },
{ "-nsl", "--no-site-lisp", 65, 0 },

View file

@ -4167,7 +4167,7 @@ extern bool no_site_lisp;
extern bool build_details;
#ifndef WINDOWSNT
/* 0 not a daemon, 1 new-style (foreground), 2 old-style (background). */
/* 0 not a daemon, 1 foreground daemon, 2 background daemon. */
extern int daemon_type;
#define IS_DAEMON (daemon_type != 0)
#define DAEMON_RUNNING (daemon_type >= 0)