# HG changeset patch # User Juanma Barranquero # Date 1228902426 0 # Node ID 9c9346f62ad8feda86c3017d353d3655ff942056 # Parent 1912976b0dec2e014f01e12a41c729a347457d44 * 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). diff -r 1912976b0dec -r 9c9346f62ad8 lib-src/ChangeLog --- a/lib-src/ChangeLog Wed Dec 10 08:30:54 2008 +0000 +++ b/lib-src/ChangeLog Wed Dec 10 09:47:06 2008 +0000 @@ -1,3 +1,11 @@ +2008-12-10 Juanma Barranquero + + * 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 * emacsclient.c (print_help_and_exit): Describe what an empty diff -r 1912976b0dec -r 9c9346f62ad8 lib-src/emacsclient.c --- a/lib-src/emacsclient.c Wed Dec 10 08:30:54 2008 +0000 +++ b/lib-src/emacsclient.c Wed Dec 10 09:47:06 2008 +0000 @@ -54,6 +54,8 @@ # define CLOSE_SOCKET close # define INITIALIZE() +# define EMACS_DAEMON + #endif /* !WINDOWSNT */ #undef signal @@ -615,10 +617,12 @@ "-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 @@ } #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 @@ 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 @@ 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 @@ 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