aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorDan Nicolaescu2008-12-10 14:57:20 +0000
committerDan Nicolaescu2008-12-10 14:57:20 +0000
commit802bdb3c6b681d9af740c010467edb799817eaa6 (patch)
tree0ac068e08a46cad758e6dcf6385588011a87bcab /lib-src
parent2ae37cf085e484ff4e9037eff9f5a88f7e76b447 (diff)
downloademacs-802bdb3c6b681d9af740c010467edb799817eaa6.tar.gz
emacs-802bdb3c6b681d9af740c010467edb799817eaa6.zip
(EMACS_DAEMON): Remove definition.
(decode_options): Do not allow an empty alternate_editor on WINDOWSNT. (print_help_and_exit): Replace EMACS_DAEMON with WINDOWSNT. (start_daemon_and_retry_set_socket): Likewise.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog8
-rw-r--r--lib-src/emacsclient.c23
2 files changed, 22 insertions, 9 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index b8c5868a93e..0a4d91a7e75 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,11 @@
12008-12-10 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * emacsclient.c (EMACS_DAEMON): Remove definition.
4 (decode_options): Do not allow an empty alternate_editor on
5 WINDOWSNT.
6 (print_help_and_exit): Replace EMACS_DAEMON with WINDOWSNT.
7 (start_daemon_and_retry_set_socket): Likewise.
8
12008-12-10 Juanma Barranquero <lekktu@gmail.com> 92008-12-10 Juanma Barranquero <lekktu@gmail.com>
2 10
3 * emacsclient.c [!WINDOWSNT] (EMACS_DAEMON): New define. 11 * emacsclient.c [!WINDOWSNT] (EMACS_DAEMON): New define.
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 005d8853974..db2de82d072 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -54,8 +54,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
54# define CLOSE_SOCKET close 54# define CLOSE_SOCKET close
55# define INITIALIZE() 55# define INITIALIZE()
56 56
57# define EMACS_DAEMON
58
59#endif /* !WINDOWSNT */ 57#endif /* !WINDOWSNT */
60 58
61#undef signal 59#undef signal
@@ -586,6 +584,15 @@ decode_options (argc, argv)
586 arguments or expressions given. */ 584 arguments or expressions given. */
587 if (nowait && tty && argc - optind > 0) 585 if (nowait && tty && argc - optind > 0)
588 current_frame = 1; 586 current_frame = 1;
587
588#ifdef WINDOWSNT
589 if (alternate_editor && alternate_editor == '\0')
590 {
591 message (TRUE, "--alternate-editor argument or ALTERNATE_EDITOR variable cannot be\n\
592an empty string");
593 exit (EXIT_FAILURE);
594 }
595#endif /* WINDOWSNT */
589} 596}
590 597
591 598
@@ -618,10 +625,10 @@ The following OPTIONS are accepted:\n\
618 Set filename of the TCP authentication file\n\ 625 Set filename of the TCP authentication file\n\
619-a, --alternate-editor=EDITOR\n\ 626-a, --alternate-editor=EDITOR\n\
620 Editor to fallback to if the server is not running\n" 627 Editor to fallback to if the server is not running\n"
621#ifdef EMACS_DAEMON 628#ifdef WINDOWSNT
622" If EDITOR is the empty string, start Emacs in daemon\n\ 629" If EDITOR is the empty string, start Emacs in daemon\n\
623 mode and try connecting again\n" 630 mode and try connecting again\n"
624#endif 631#endif /* WINDOWSNT */
625"\n\ 632"\n\
626Report bugs to bug-gnu-emacs@gnu.org.\n", progname); 633Report bugs to bug-gnu-emacs@gnu.org.\n", progname);
627 exit (EXIT_SUCCESS); 634 exit (EXIT_SUCCESS);
@@ -1419,7 +1426,7 @@ w32_give_focus ()
1419void 1426void
1420start_daemon_and_retry_set_socket (void) 1427start_daemon_and_retry_set_socket (void)
1421{ 1428{
1422#ifdef EMACS_DAEMON 1429#ifndef WINDOWSNT
1423 pid_t dpid; 1430 pid_t dpid;
1424 int status; 1431 int status;
1425 pid_t p; 1432 pid_t p;
@@ -1457,7 +1464,7 @@ start_daemon_and_retry_set_socket (void)
1457 execvp ("emacs", d_argv); 1464 execvp ("emacs", d_argv);
1458 message (TRUE, "%s: error starting emacs daemon\n", progname); 1465 message (TRUE, "%s: error starting emacs daemon\n", progname);
1459 } 1466 }
1460#endif /* EMACS_DAEMON */ 1467#endif /* WINDOWSNT */
1461} 1468}
1462 1469
1463int 1470int
@@ -1468,7 +1475,7 @@ main (argc, argv)
1468 int i, rl, needlf = 0; 1475 int i, rl, needlf = 0;
1469 char *cwd, *str; 1476 char *cwd, *str;
1470 char string[BUFSIZ+1]; 1477 char string[BUFSIZ+1];
1471 int null_socket_name, null_server_file, start_daemon_if_needed = 0; 1478 int null_socket_name, null_server_file, start_daemon_if_needed;
1472 1479
1473 main_argv = argv; 1480 main_argv = argv;
1474 progname = argv[0]; 1481 progname = argv[0];
@@ -1484,12 +1491,10 @@ main (argc, argv)
1484 exit (EXIT_FAILURE); 1491 exit (EXIT_FAILURE);
1485 } 1492 }
1486 1493
1487#ifdef EMACS_DAEMON
1488 /* If alternate_editor is the empty string, start the emacs daemon 1494 /* If alternate_editor is the empty string, start the emacs daemon
1489 in case of failure to connect. */ 1495 in case of failure to connect. */
1490 start_daemon_if_needed = (alternate_editor 1496 start_daemon_if_needed = (alternate_editor
1491 && (alternate_editor[0] == '\0')); 1497 && (alternate_editor[0] == '\0'));
1492#endif /* EMACS_DAEMON */
1493 if (start_daemon_if_needed) 1498 if (start_daemon_if_needed)
1494 { 1499 {
1495 /* set_socket changes the values for socket_name and 1500 /* set_socket changes the values for socket_name and