diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2011-12-04 18:13:01 +0100 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2011-12-04 18:13:01 +0100 |
commit | 520fca41d6ca6cc860c1f03c76cd472ea149e33a (patch) | |
tree | ae940593c2033d55da3e51b113a12bca88a9e816 /lib-src | |
parent | ec7ae0329e5cfda066433f8c5d5daa6e0d1dde14 (diff) | |
download | emacs-520fca41d6ca6cc860c1f03c76cd472ea149e33a.tar.gz emacs-520fca41d6ca6cc860c1f03c76cd472ea149e33a.tar.bz2 emacs-520fca41d6ca6cc860c1f03c76cd472ea149e33a.zip |
Fix emacsclient bug where "-n -c" does not open a new frame on Windows.
* lib-src/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
* lisp/server.el (server-delete-client): On Windows, do not try to delete
the only terminal.
(server-process-filter): On Windows, treat requests for a tty frame as
if they were for a GUI frame if the running server is in GUI mode.
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 */ } |