From 75b849294656fd92e77a2a6281ff4dceaaa38475 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Mon, 29 May 2017 22:13:53 -0400 Subject: [PATCH] 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'. --- doc/emacs/cmdargs.texi | 8 ++++---- doc/lispref/os.texi | 6 +++--- etc/NEWS | 5 +++-- etc/emacs.service | 2 +- src/emacs.c | 18 +++++++++--------- src/lisp.h | 2 +- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 6f76ef39d9b..0b1a400b364 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -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 diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 438f48c3471..e6ec60f9236 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -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 diff --git a/etc/NEWS b/etc/NEWS index 60066b7c9fa..14cada4d4f5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -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'. +++ diff --git a/etc/emacs.service b/etc/emacs.service index d9f7fc569d2..b29177b120c 100644 --- a/etc/emacs.service +++ b/etc/emacs.service @@ -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 diff --git a/src/emacs.c b/src/emacs.c index 4477f5bc017..6ed16e80372 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -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 }, diff --git a/src/lisp.h b/src/lisp.h index 7290386b255..7b8f1e754d8 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -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) -- 2.39.2