summaryrefslogtreecommitdiff
path: root/lib-src/emacsclient.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-04-15 16:49:24 +0800
committerChong Yidong <cyd@gnu.org>2012-04-15 16:49:24 +0800
commit9a864fa27d1bdc85c3542d34e6a2fc02fe03c718 (patch)
treedae3f52efe9b0d03a5ccf974b4bd5c22f075ba4a /lib-src/emacsclient.c
parent467a33d09f0e6d445fb020013ac65b12adffc35e (diff)
downloademacs-9a864fa27d1bdc85c3542d34e6a2fc02fe03c718.tar.gz
Move "emacsclient -t -n" handling from emacsclient.c to server.el.
Fix its buggy logic for the Windows case (regression from 23.4). * lib-src/emacsclient.c (decode_options): Move -t -n corner case handling into server.el. * lisp/server.el (server-process-filter): Handle corner case where both tty and nowait options are present. Fixes: debbugs:11102
Diffstat (limited to 'lib-src/emacsclient.c')
-rw-r--r--lib-src/emacsclient.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 05fd0f3515e..48b4384d487 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -638,32 +638,23 @@ decode_options (int argc, char **argv)
if (display && strlen (display) == 0)
display = NULL;
-#ifdef WINDOWSNT
- /* Emacs on Windows does not support GUI and console frames in the same
- instance. So, it makes sense to treat the -t and -c options as
- equivalent, and open a new frame regardless of whether the running
- instance is GUI or console. Ideally, we would only set tty = 1 when
- the instance is running in a console, but alas we don't know that.
- The simplest workaround is to always ask for a tty frame, and let
- server.el check whether it makes sense. */
- if (tty || !current_frame)
- {
- display = (const char *) ttyname (0); /* Arg is ignored. */
- current_frame = 0;
- tty = 1;
- }
-#endif
-
/* If no display is available, new frames are tty frames. */
if (!current_frame && !display)
tty = 1;
- /* --no-wait implies --current-frame on ttys when there are file
- arguments or expressions given. */
- if (nowait && tty && argc - optind > 0)
- current_frame = 1;
-
#ifdef WINDOWSNT
+ /* Emacs on Windows does not support graphical and text terminal
+ frames in the same instance. So, treat the -t and -c options as
+ equivalent, and open a new frame on the server's terminal.
+ Ideally, we would only set tty = 1 when the serve is running in a
+ console, but alas we don't know that. As a workaround, always
+ ask for a tty frame, and let server.el figure it out. */
+ if (!current_frame)
+ {
+ display = NULL;
+ tty = 1;
+ }
+
if (alternate_editor && alternate_editor[0] == '\0')
{
message (TRUE, "--alternate-editor argument or ALTERNATE_EDITOR variable cannot be\n\