diff lib-src/emacsclient.c @ 83246:5bc762f84335

Prevent emacsclient errors when Emacs is compiled without X support. * lisp/frame.el (make-frame-on-display): Protect condition on x-initialized when x-win.el is not loaded. * lib-src/emacsclient.c (main): Handle -window-system-unsupported command. Doc update. * lisp/server.el (server-process-filter): Don't try to create an X frame when Emacs does not support it. Improve logging. * lisp/server.el (server-send-string): New function. (server-handle-suspend-tty, server-process-filter): Use it. * lisp/server.el (server-process-filter, server-unquote-arg) (server-quote-arg): Doc updates. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-286
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 04 Feb 2005 13:56:51 +0000
parents ed82e09208c9
children 1830bcd0eec0
line wrap: on
line diff
--- a/lib-src/emacsclient.c	Fri Feb 04 00:09:46 2005 +0000
+++ b/lib-src/emacsclient.c	Fri Feb 04 13:56:51 2005 +0000
@@ -704,6 +704,7 @@
       }
   }
 
+ retry:
   if (nowait)
     fprintf (out, "-nowait ");
 
@@ -832,14 +833,25 @@
 
       if (strprefix ("-good-version ", str))
         {
-          /* OK, we got the green light. */
+          /* -good-version: The versions match. */
         }
       else if (strprefix ("-emacs-pid ", str))
         {
+          /* -emacs-pid PID: The process id of the Emacs process. */
           emacs_pid = strtol (string + strlen ("-emacs-pid"), NULL, 10);
         }
+      else if (strprefix ("-window-system-unsupported ", str))
+        {
+          /* -window-system-unsupported: Emacs was compiled without X
+              support.  Try again on the terminal. */
+          window_system = 0;
+          nowait = 0;
+          tty = 1;
+          goto retry;
+        }
       else if (strprefix ("-print ", str))
         {
+          /* -print STRING: Print STRING on the terminal. */
           str = unquote_argument (str + strlen ("-print "));
           if (needlf)
             printf ("\n");
@@ -848,6 +860,7 @@
         }
       else if (strprefix ("-error ", str))
         {
+          /* -error DESCRIPTION: Signal an error on the terminal. */
           str = unquote_argument (str + strlen ("-error "));
           if (needlf)
             printf ("\n");
@@ -856,6 +869,7 @@
         }
       else if (strprefix ("-suspend ", str))
         {
+          /* -suspend: Suspend this terminal, i.e., stop the process. */
           if (needlf)
             printf ("\n");
           needlf = 0;
@@ -863,6 +877,7 @@
         }
       else
         {
+          /* Unknown command. */
           if (needlf)
             printf ("\n");
           printf ("*ERROR*: Unknown message: %s", str);