aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2017-05-29 22:13:53 -0400
committerNoam Postavsky2017-05-29 22:18:55 -0400
commit75b849294656fd92e77a2a6281ff4dceaaa38475 (patch)
tree3df43d0cc640c8f5522461be9d346530d26e3bcd
parent941a2e7347e3a0d393e67872e6151be8cc66d9a2 (diff)
downloademacs-75b849294656fd92e77a2a6281ff4dceaaa38475.tar.gz
emacs-75b849294656fd92e77a2a6281ff4dceaaa38475.zip
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'.
-rw-r--r--doc/emacs/cmdargs.texi8
-rw-r--r--doc/lispref/os.texi6
-rw-r--r--etc/NEWS5
-rw-r--r--etc/emacs.service2
-rw-r--r--src/emacs.c18
-rw-r--r--src/lisp.h2
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}).
336@opindex -daemon 336@opindex -daemon
337@itemx --daemon[=@var{name}] 337@itemx --daemon[=@var{name}]
338@opindex --daemon 338@opindex --daemon
339@itemx --old-daemon[=@var{name}] 339@itemx --bg-daemon[=@var{name}]
340@itemx --new-daemon[=@var{name}] 340@itemx --fg-daemon[=@var{name}]
341Start Emacs as a daemon---after Emacs starts up, it starts the Emacs 341Start Emacs as a daemon---after Emacs starts up, it starts the Emacs
342server without opening any frames. 342server without opening any frames.
343(Optionally, you can specify an explicit @var{name} for the server.) 343(Optionally, you can specify an explicit @var{name} for the server.)
344You can then use the @command{emacsclient} command to connect to Emacs 344You can then use the @command{emacsclient} command to connect to Emacs
345for editing. @xref{Emacs Server}, for information about using Emacs 345for editing. @xref{Emacs Server}, for information about using Emacs
346as a daemon. An ``old-style'' daemon disconnects from the terminal 346as a daemon. A ``background'' daemon disconnects from the terminal
347and runs in the background (@samp{--daemon} is an alias for 347and runs in the background (@samp{--daemon} is an alias for
348@samp{--old-daemon}). 348@samp{--bg-daemon}).
349 349
350@item --no-desktop 350@item --no-desktop
351@opindex --no-desktop 351@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.
337Run without an interactive terminal. @xref{Batch Mode}. 337Run without an interactive terminal. @xref{Batch Mode}.
338 338
339@item --daemon 339@item --daemon
340@itemx --old-daemon 340@itemx --bg-daemon
341@itemx --new-daemon 341@itemx --fg-daemon
342Do not initialize any display; just start a server. 342Do not initialize any display; just start a server.
343(An ``old-style'' daemon automatically runs in the background.) 343(A ``background'' daemon automatically runs in the background.)
344 344
345@item --no-init-file 345@item --no-init-file
346@itemx -q 346@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.
78 78
79* Startup Changes in Emacs 26.1 79* Startup Changes in Emacs 26.1
80 80
81** New option '--new-daemon'. This is the same as '--daemon', except 81+++
82** New option '--fg-daemon'. This is the same as '--daemon', except
82it runs in the foreground and does not fork. This is intended for 83it runs in the foreground and does not fork. This is intended for
83modern init systems such as systemd, which manage many of the traditional 84modern init systems such as systemd, which manage many of the traditional
84aspects of daemon behavior themselves. '--old-daemon' is now an alias 85aspects of daemon behavior themselves. '--bg-daemon' is now an alias
85for '--daemon'. 86for '--daemon'.
86 87
87+++ 88+++
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/
8 8
9[Service] 9[Service]
10Type=simple 10Type=simple
11ExecStart=emacs --new-daemon 11ExecStart=emacs --fg-daemon
12ExecStop=emacsclient --eval "(kill-emacs)" 12ExecStop=emacsclient --eval "(kill-emacs)"
13Environment=SSH_AUTH_SOCK=%t/keyring/ssh 13Environment=SSH_AUTH_SOCK=%t/keyring/ssh
14Restart=on-failure 14Restart=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\
219 "\ 219 "\
220--batch do not do interactive display; implies -q\n\ 220--batch do not do interactive display; implies -q\n\
221--chdir DIR change to directory DIR\n\ 221--chdir DIR change to directory DIR\n\
222--daemon, --old-daemon[=NAME] start a (named) server in the background\n\ 222--daemon, --bg-daemon[=NAME] start a (named) server in the background\n\
223--new-daemon[=NAME] start a (named) server in the foreground\n\ 223--fg-daemon[=NAME] start a (named) server in the foreground\n\
224--debug-init enable Emacs Lisp debugger for init file\n\ 224--debug-init enable Emacs Lisp debugger for init file\n\
225--display, -d DISPLAY use X server DISPLAY\n\ 225--display, -d DISPLAY use X server DISPLAY\n\
226", 226",
@@ -991,15 +991,15 @@ main (int argc, char **argv)
991 991
992 int sockfd = -1; 992 int sockfd = -1;
993 993
994 if (argmatch (argv, argc, "-new-daemon", "--new-daemon", 10, NULL, &skip_args) 994 if (argmatch (argv, argc, "-fg-daemon", "--fg-daemon", 10, NULL, &skip_args)
995 || argmatch (argv, argc, "-new-daemon", "--new-daemon", 10, &dname_arg, &skip_args)) 995 || argmatch (argv, argc, "-fg-daemon", "--fg-daemon", 10, &dname_arg, &skip_args))
996 { 996 {
997 daemon_type = 1; /* foreground */ 997 daemon_type = 1; /* foreground */
998 } 998 }
999 else if (argmatch (argv, argc, "-daemon", "--daemon", 5, NULL, &skip_args) 999 else if (argmatch (argv, argc, "-daemon", "--daemon", 5, NULL, &skip_args)
1000 || argmatch (argv, argc, "-daemon", "--daemon", 5, &dname_arg, &skip_args) 1000 || argmatch (argv, argc, "-daemon", "--daemon", 5, &dname_arg, &skip_args)
1001 || argmatch (argv, argc, "-old-daemon", "--old-daemon", 10, NULL, &skip_args) 1001 || argmatch (argv, argc, "-bg-daemon", "--bg-daemon", 10, NULL, &skip_args)
1002 || argmatch (argv, argc, "-old-daemon", "--old-daemon", 10, &dname_arg, &skip_args)) 1002 || argmatch (argv, argc, "-bg-daemon", "--bg-daemon", 10, &dname_arg, &skip_args))
1003 { 1003 {
1004 daemon_type = 2; /* background */ 1004 daemon_type = 2; /* background */
1005 } 1005 }
@@ -1114,7 +1114,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1114 char fdStr[80]; 1114 char fdStr[80];
1115 int fdStrlen = 1115 int fdStrlen =
1116 snprintf (fdStr, sizeof fdStr, 1116 snprintf (fdStr, sizeof fdStr,
1117 "--old-daemon=\n%d,%d\n%s", daemon_pipe[0], 1117 "--bg-daemon=\n%d,%d\n%s", daemon_pipe[0],
1118 daemon_pipe[1], dname_arg ? dname_arg : ""); 1118 daemon_pipe[1], dname_arg ? dname_arg : "");
1119 1119
1120 if (! (0 <= fdStrlen && fdStrlen < sizeof fdStr)) 1120 if (! (0 <= fdStrlen && fdStrlen < sizeof fdStr))
@@ -1711,8 +1711,8 @@ static const struct standard_args standard_args[] =
1711 { "-batch", "--batch", 100, 0 }, 1711 { "-batch", "--batch", 100, 0 },
1712 { "-script", "--script", 100, 1 }, 1712 { "-script", "--script", 100, 1 },
1713 { "-daemon", "--daemon", 99, 0 }, 1713 { "-daemon", "--daemon", 99, 0 },
1714 { "-old-daemon", "--old-daemon", 99, 0 }, 1714 { "-bg-daemon", "--bg-daemon", 99, 0 },
1715 { "-new-daemon", "--new-daemon", 99, 0 }, 1715 { "-fg-daemon", "--fg-daemon", 99, 0 },
1716 { "-help", "--help", 90, 0 }, 1716 { "-help", "--help", 90, 0 },
1717 { "-nl", "--no-loadup", 70, 0 }, 1717 { "-nl", "--no-loadup", 70, 0 },
1718 { "-nsl", "--no-site-lisp", 65, 0 }, 1718 { "-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;
4167extern bool build_details; 4167extern bool build_details;
4168 4168
4169#ifndef WINDOWSNT 4169#ifndef WINDOWSNT
4170/* 0 not a daemon, 1 new-style (foreground), 2 old-style (background). */ 4170/* 0 not a daemon, 1 foreground daemon, 2 background daemon. */
4171extern int daemon_type; 4171extern int daemon_type;
4172#define IS_DAEMON (daemon_type != 0) 4172#define IS_DAEMON (daemon_type != 0)
4173#define DAEMON_RUNNING (daemon_type >= 0) 4173#define DAEMON_RUNNING (daemon_type >= 0)