]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix emacsclient/server behavior under --without-x.
authorChong Yidong <cyd@gnu.org>
Fri, 20 Apr 2012 10:37:57 +0000 (18:37 +0800)
committerChong Yidong <cyd@gnu.org>
Fri, 20 Apr 2012 10:37:57 +0000 (18:37 +0800)
* lib-src/emacsclient.c (main): Send -tty to Emacs under more circumstanced (Bug#8314).

* lisp/server.el (server-process-filter): Only try to open a window
system frame if compiled with graphical support (Bug#8314).

Fixes: debbugs:11102
lib-src/ChangeLog
lib-src/emacsclient.c
lisp/ChangeLog
lisp/server.el

index c76303d8fa2683c7bcec4d1892790d1a120472bd..fc6d905cfb2e67c341a65ab8c7d1e58b0e0d6d2a 100644 (file)
@@ -2,6 +2,7 @@
 
        * emacsclient.c (decode_options): Move -t -n corner case handling
        into server.el (Bug#11102).
+       (main): Send -tty to Emacs under more circumstanced (Bug#8314).
 
 2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
 
index 48b4384d4875f948ddd4d251204c71abe841d5ae..ea55398306b016655b7a81ae779c5682bc0f6a99 100644 (file)
@@ -1658,10 +1658,10 @@ main (int argc, char **argv)
       send_to_emacs (emacs_socket, " ");
     }
 
-  /* If using the current frame, send tty information to Emacs anyway.
-     In daemon mode, Emacs may need to occupy this tty if no other
-     frame is available.  */
-  if (tty || (current_frame && !eval))
+  /* Unless we are certain we don't want to occupy the tty, send our
+     tty information to Emacs.  For example, in daemon mode Emacs may
+     need to occupy this tty if no other frame is available.  */
+  if (!current_frame || !eval)
     {
       const char *tty_type, *tty_name;
 
index 947ae6f17f69332d0d4e4532be393dc7cb8a6d66..58f646251d0bf66ee1bb616ce7d5341a18ee1b28 100644 (file)
@@ -4,6 +4,8 @@
        is a string and there are no files to open (Bug#2825).
        (server-create-window-system-frame, server-create-tty-frame):
        Don't switch buffers here.
+       (server-process-filter): Only try to open a window system frame if
+       compiled with graphical support (Bug#8314).
 
 2012-04-20  Dan Nicolaescu  <dann@gnu.org>
 
index f9c8ea5c5771e03d5cd093d8a37a302f68c028fb..1e2f458ac9c0fdd7259533ab87de5def6fd19707 100644 (file)
@@ -1076,8 +1076,9 @@ The following commands are accepted by the client:
 
                 ;; -window-system:  Open a new X frame.
                 (`"-window-system"
-                 (setq dontkill t)
-                 (setq tty-name 'window-system))
+                (if (fboundp 'x-create-frame)
+                    (setq dontkill t
+                          tty-name 'window-system)))
 
                 ;; -resume:  Resume a suspended tty frame.
                 (`"-resume"
@@ -1105,7 +1106,8 @@ The following commands are accepted by the client:
                  (setq dontkill t)
                  (pop args-left))
 
-                ;; -tty DEVICE-NAME TYPE:  Open a new tty frame at the client.
+               ;; -tty DEVICE-NAME TYPE:  Open a new tty frame.
+               ;; (But if we see -window-system later, use that.)
                 (`"-tty"
                  (setq tty-name (pop args-left)
                        tty-type (pop args-left)