summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2008-12-10 09:47:06 +0000
committerJuanma Barranquero <lekktu@gmail.com>2008-12-10 09:47:06 +0000
commitc3f995a2cbc9715b56d732b28b078c102dccccd3 (patch)
tree902328908730006761a34e335e122c8f70e1190c /lib-src
parent08d03897813a047898e80a983d82b0684cc04491 (diff)
* emacsclient.c [!WINDOWSNT] (EMACS_DAEMON): New define.
Changes when EMACS_DAEMON is not defined: (print_help_and_exit): Don't add daemon information to help. (start_daemon_and_retry_set_socket): Make a no-op. (main): Don't set `start_daemon_if_needed' (which is initialized to 0).
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog8
-rw-r--r--lib-src/emacsclient.c20
2 files changed, 21 insertions, 7 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 7cb4cda2013..b8c5868a93e 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-10 Juanma Barranquero <lekktu@gmail.com>
+
+ * emacsclient.c [!WINDOWSNT] (EMACS_DAEMON): New define.
+ Changes when EMACS_DAEMON is not defined:
+ (print_help_and_exit): Don't add daemon information to help.
+ (start_daemon_and_retry_set_socket): Make a no-op.
+ (main): Don't set `start_daemon_if_needed' (which is initialized to 0).
+
2008-12-10 Dan Nicolaescu <dann@ics.uci.edu>
* emacsclient.c (print_help_and_exit): Describe what an empty
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index e96cf4ef358..005d8853974 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -54,6 +54,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
# define CLOSE_SOCKET close
# define INITIALIZE()
+# define EMACS_DAEMON
+
#endif /* !WINDOWSNT */
#undef signal
@@ -615,10 +617,12 @@ The following OPTIONS are accepted:\n\
"-f, --server-file=FILENAME\n\
Set filename of the TCP authentication file\n\
-a, --alternate-editor=EDITOR\n\
- Editor to fallback to if the server is not running\n\
- If EDITOR is the empty string, start Emacs in daemon\n\
- mode and try connecting again
-\n\
+ Editor to fallback to if the server is not running\n"
+#ifdef EMACS_DAEMON
+" If EDITOR is the empty string, start Emacs in daemon\n\
+ mode and try connecting again\n"
+#endif
+"\n\
Report bugs to bug-gnu-emacs@gnu.org.\n", progname);
exit (EXIT_SUCCESS);
}
@@ -1410,12 +1414,12 @@ w32_give_focus ()
}
#endif
-
/* Start the emacs daemon and try to connect to it. */
void
start_daemon_and_retry_set_socket (void)
{
+#ifdef EMACS_DAEMON
pid_t dpid;
int status;
pid_t p;
@@ -1453,9 +1457,9 @@ start_daemon_and_retry_set_socket (void)
execvp ("emacs", d_argv);
message (TRUE, "%s: error starting emacs daemon\n", progname);
}
+#endif /* EMACS_DAEMON */
}
-
int
main (argc, argv)
int argc;
@@ -1464,7 +1468,7 @@ main (argc, argv)
int i, rl, needlf = 0;
char *cwd, *str;
char string[BUFSIZ+1];
- int null_socket_name, null_server_file, start_daemon_if_needed;
+ int null_socket_name, null_server_file, start_daemon_if_needed = 0;
main_argv = argv;
progname = argv[0];
@@ -1480,10 +1484,12 @@ main (argc, argv)
exit (EXIT_FAILURE);
}
+#ifdef EMACS_DAEMON
/* If alternate_editor is the empty string, start the emacs daemon
in case of failure to connect. */
start_daemon_if_needed = (alternate_editor
&& (alternate_editor[0] == '\0'));
+#endif /* EMACS_DAEMON */
if (start_daemon_if_needed)
{
/* set_socket changes the values for socket_name and