aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/emacsclient.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 3bb2b70ba6d..1ef45481840 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -95,7 +95,7 @@ struct option longopts[] =
95 { "help", no_argument, NULL, 'H' }, 95 { "help", no_argument, NULL, 'H' },
96 { "version", no_argument, NULL, 'V' }, 96 { "version", no_argument, NULL, 'V' },
97 { "tty", no_argument, NULL, 't' }, 97 { "tty", no_argument, NULL, 't' },
98 { "window-system", no_argument, NULL, 'w' }, 98 { "current-frame", no_argument, NULL, 'c' },
99 { "alternate-editor", required_argument, NULL, 'a' }, 99 { "alternate-editor", required_argument, NULL, 'a' },
100 { "socket-name", required_argument, NULL, 's' }, 100 { "socket-name", required_argument, NULL, 's' },
101 { "display", required_argument, NULL, 'd' }, 101 { "display", required_argument, NULL, 'd' },
@@ -112,11 +112,18 @@ decode_options (argc, argv)
112{ 112{
113 alternate_editor = getenv ("ALTERNATE_EDITOR"); 113 alternate_editor = getenv ("ALTERNATE_EDITOR");
114 display = getenv ("DISPLAY"); 114 display = getenv ("DISPLAY");
115 if (strlen (display) == 0)
116 display = NULL;
117
118 if (display)
119 window_system = 1;
120 else
121 tty = 1;
115 122
116 while (1) 123 while (1)
117 { 124 {
118 int opt = getopt_long (argc, argv, 125 int opt = getopt_long (argc, argv,
119 "VHnea:s:d:tw", longopts, 0); 126 "VHnea:s:d:tc", longopts, 0);
120 127
121 if (opt == EOF) 128 if (opt == EOF)
122 break; 129 break;
@@ -158,8 +165,8 @@ decode_options (argc, argv)
158 window_system = 0; 165 window_system = 0;
159 break; 166 break;
160 167
161 case 'w': 168 case 'c':
162 window_system = 1; 169 window_system = 0;
163 tty = 0; 170 tty = 0;
164 break; 171 break;
165 172
@@ -192,7 +199,7 @@ The following OPTIONS are accepted:\n\
192-V, --version Just print a version info and return\n\ 199-V, --version Just print a version info and return\n\
193-H, --help Print this usage information message\n\ 200-H, --help Print this usage information message\n\
194-t, --tty Open a new Emacs frame on the current terminal\n\ 201-t, --tty Open a new Emacs frame on the current terminal\n\
195-w, --window-system Open a new graphical Emacs frame\n\ 202-c, --current-frame Do not create a new frame; use the current Emacs frame\n\
196-n, --no-wait Don't wait for the server to return\n\ 203-n, --no-wait Don't wait for the server to return\n\
197-e, --eval Evaluate the FILE arguments as ELisp expressions\n\ 204-e, --eval Evaluate the FILE arguments as ELisp expressions\n\
198-d, --display=DISPLAY Visit the file in the given display\n\ 205-d, --display=DISPLAY Visit the file in the given display\n\