1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

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.
This commit is contained in:
Juanma Barranquero 2011-12-04 18:13:01 +01:00
parent ec7ae0329e
commit 520fca41d6
4 changed files with 43 additions and 14 deletions

View file

@ -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 */
}