[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107839: Move "emacsclient -t -n"
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107839: Move "emacsclient -t -n" handling from emacsclient.c to server.el. |
Date: |
Sun, 15 Apr 2012 16:49:24 +0800 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 107839
fixes bug(s): http://debbugs.gnu.org/11102
committer: Chong Yidong <address@hidden>
branch nick: emacs-24
timestamp: Sun 2012-04-15 16:49:24 +0800
message:
Move "emacsclient -t -n" handling from emacsclient.c to server.el.
Fix its buggy logic for the Windows case (regression from 23.4).
* lib-src/emacsclient.c (decode_options): Move -t -n corner case handling
into server.el.
* lisp/server.el (server-process-filter): Handle corner case where both
tty and nowait options are present.
modified:
lib-src/ChangeLog
lib-src/emacsclient.c
lisp/ChangeLog
lisp/server.el
=== modified file 'lib-src/ChangeLog'
--- a/lib-src/ChangeLog 2012-04-12 18:22:06 +0000
+++ b/lib-src/ChangeLog 2012-04-15 08:49:24 +0000
@@ -1,3 +1,8 @@
+2012-04-15 Chong Yidong <address@hidden>
+
+ * emacsclient.c (decode_options): Move -t -n corner case handling
+ into server.el (Bug#11102).
+
2012-04-12 Juanma Barranquero <address@hidden>
* emacsclient.c (decode_options) [WINDOWSNT]:
=== modified file 'lib-src/emacsclient.c'
--- a/lib-src/emacsclient.c 2012-04-12 18:22:06 +0000
+++ b/lib-src/emacsclient.c 2012-04-15 08:49:24 +0000
@@ -638,32 +638,23 @@
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 (0); /* Arg is ignored. */
- current_frame = 0;
- tty = 1;
- }
-#endif
-
/* If no display is available, new frames are tty frames. */
if (!current_frame && !display)
tty = 1;
- /* --no-wait implies --current-frame on ttys when there are file
- arguments or expressions given. */
- if (nowait && tty && argc - optind > 0)
- current_frame = 1;
-
#ifdef WINDOWSNT
+ /* Emacs on Windows does not support graphical and text terminal
+ frames in the same instance. So, treat the -t and -c options as
+ equivalent, and open a new frame on the server's terminal.
+ Ideally, we would only set tty = 1 when the serve is running in a
+ console, but alas we don't know that. As a workaround, always
+ ask for a tty frame, and let server.el figure it out. */
+ if (!current_frame)
+ {
+ display = NULL;
+ tty = 1;
+ }
+
if (alternate_editor && alternate_editor[0] == '\0')
{
message (TRUE, "--alternate-editor argument or ALTERNATE_EDITOR variable
cannot be\n\
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-04-15 01:37:16 +0000
+++ b/lisp/ChangeLog 2012-04-15 08:49:24 +0000
@@ -1,3 +1,8 @@
+2012-04-15 Chong Yidong <address@hidden>
+
+ * server.el (server-process-filter): Handle corner case where both
+ tty and nowait options are present (Bug#11102).
+
2012-04-15 Glenn Morris <address@hidden>
* simple.el (process-file-side-effects): Doc fix.
=== modified file 'lisp/server.el'
--- a/lisp/server.el 2012-04-04 17:13:00 +0000
+++ b/lisp/server.el 2012-04-15 08:49:24 +0000
@@ -1133,6 +1133,13 @@
;; Unknown command.
(arg (error "Unknown command: %s" arg))))
+ ;; If both -no-wait and -tty are given with file or sexp
+ ;; arguments, use an existing frame.
+ (and nowait
+ (not (eq tty-name 'window-system))
+ (or files commands)
+ (setq use-current-frame t))
+
(setq frame
(cond
((and use-current-frame
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107839: Move "emacsclient -t -n" handling from emacsclient.c to server.el.,
Chong Yidong <=