aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorJuanma Barranquero2011-12-04 18:13:01 +0100
committerJuanma Barranquero2011-12-04 18:13:01 +0100
commit520fca41d6ca6cc860c1f03c76cd472ea149e33a (patch)
treeae940593c2033d55da3e51b113a12bca88a9e816 /lib-src
parentec7ae0329e5cfda066433f8c5d5daa6e0d1dde14 (diff)
downloademacs-520fca41d6ca6cc860c1f03c76cd472ea149e33a.tar.gz
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/ChangeLog8
-rw-r--r--lib-src/emacsclient.c24
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 @@
12011-12-04 Juanma Barranquero <lekktu@gmail.com>
2
3 * emacsclient.c (decode_options) [WINDOWSNT]: Don't force tty = 0;
4 instead, treat both -c and -t as always requesting a new "tty" frame,
5 and let server.el decide which kind is actually required.
6 Reported by Uwe Siart <usenet@siart.de> in this thread:
7 http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00303.html
8
12011-11-30 Chong Yidong <cyd@gnu.org> 92011-11-30 Chong Yidong <cyd@gnu.org>
2 10
3 * emacsclient.c (main): Condition last change on WINDOWSNT 11 * 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)
638 if (display && strlen (display) == 0) 638 if (display && strlen (display) == 0)
639 display = NULL; 639 display = NULL;
640 640
641#ifdef WINDOWSNT
642 /* Emacs on Windows does not support GUI and console frames in the same
643 instance. So, it makes sense to treat the -t and -c options as
644 equivalent, and open a new frame regardless of whether the running
645 instance is GUI or console. Ideally, we would only set tty = 1 when
646 the instance is running in a console, but alas we don't know that.
647 The simplest workaround is to always ask for a tty frame, and let
648 server.el check whether it makes sense. */
649 if (tty || !current_frame)
650 {
651 display = (const char *) ttyname;
652 current_frame = 0;
653 tty = 1;
654 }
655#endif
656
641 /* If no display is available, new frames are tty frames. */ 657 /* If no display is available, new frames are tty frames. */
642 if (!current_frame && !display) 658 if (!current_frame && !display)
643 tty = 1; 659 tty = 1;
@@ -654,14 +670,6 @@ decode_options (int argc, char **argv)
654an empty string"); 670an empty string");
655 exit (EXIT_FAILURE); 671 exit (EXIT_FAILURE);
656 } 672 }
657
658 /* TTY frames not supported on Windows. Continue using GUI rather than
659 forcing the user to change their command-line. This is required since
660 tty is set above if certain options are given and $DISPLAY is not set,
661 which is not obvious to users. */
662 if (tty)
663 tty = 0;
664
665#endif /* WINDOWSNT */ 673#endif /* WINDOWSNT */
666} 674}
667 675