aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorKenichi Handa2011-12-05 16:03:31 +0900
committerKenichi Handa2011-12-05 16:03:31 +0900
commit2ab04b956544fc24132cee405f93c1a757ebca56 (patch)
treef8ff3a51bac0430ed69b6497568de699f6d3b904 /lib-src
parenta79703f53ccd12623371263d93baf0d1be928ec7 (diff)
parent58a70b943c3efcc25e1396c8e67bc440c43a3f0a (diff)
downloademacs-2ab04b956544fc24132cee405f93c1a757ebca56.tar.gz
emacs-2ab04b956544fc24132cee405f93c1a757ebca56.zip
merge trunk
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog13
-rw-r--r--lib-src/emacsclient.c29
2 files changed, 34 insertions, 8 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index db1464f65d8..922a96ad194 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,16 @@
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
92011-11-30 Chong Yidong <cyd@gnu.org>
10
11 * emacsclient.c (main): Condition last change on WINDOWSNT
12 (Bug#10155).
13
12011-11-27 Eli Zaretskii <eliz@gnu.org> 142011-11-27 Eli Zaretskii <eliz@gnu.org>
2 15
3 * makefile.w32-in (LOCAL_FLAGS): Add $(EMACS_EXTRA_C_FLAGS). 16 * makefile.w32-in (LOCAL_FLAGS): Add $(EMACS_EXTRA_C_FLAGS).
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index b46700ba660..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
@@ -1635,6 +1643,11 @@ main (int argc, char **argv)
1635 /* Send over our environment and current directory. */ 1643 /* Send over our environment and current directory. */
1636 if (!current_frame) 1644 if (!current_frame)
1637 { 1645 {
1646#ifndef WINDOWSNT
1647 /* This is defined in stdlib.h on MS-Windows. It's defined in
1648 unistd.h on some POSIX hosts, but not all (Bug#10155). */
1649 extern char **environ;
1650#endif
1638 int i; 1651 int i;
1639 for (i = 0; environ[i]; i++) 1652 for (i = 0; environ[i]; i++)
1640 { 1653 {