diff options
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/ChangeLog | 8 | ||||
-rw-r--r-- | lib-src/emacsclient.c | 24 |
2 files changed, 24 insertions, 8 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 1eb67eb6c71..922a96ad194 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,11 @@ +2011-12-04 Juanma Barranquero <lekktu@gmail.com> + + * emacsclient.c (decode_options) [WINDOWSNT]: Don't force tty = 0; + instead, treat both -c and -t as always requesting a new "tty" frame, + and let server.el decide which kind is actually required. + Reported by Uwe Siart <usenet@siart.de> in this thread: + http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00303.html + 2011-11-30 Chong Yidong <cyd@gnu.org> * emacsclient.c (main): Condition last change on WINDOWSNT diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 0ae1f0bddea..5e1c2d61b89 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -638,6 +638,22 @@ 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; + current_frame = 0; + tty = 1; + } +#endif + /* If no display is available, new frames are tty frames. */ if (!current_frame && !display) tty = 1; @@ -654,14 +670,6 @@ decode_options (int argc, char **argv) an empty string"); exit (EXIT_FAILURE); } - - /* TTY frames not supported on Windows. Continue using GUI rather than - forcing the user to change their command-line. This is required since - tty is set above if certain options are given and $DISPLAY is not set, - which is not obvious to users. */ - if (tty) - tty = 0; - #endif /* WINDOWSNT */ } |