Subject: bug#6781: emacs server with X11 build on OSX

From: Leo <[email-masked]>
Date: Tue, 03 Aug 2010 06:01:49 +0100

On 2010-08-03 03:47 +0100, Juanma Barranquero wrote:
> I think you're right, because in Leo's examples it works when he
> specifically sets "127.0.0.1", so it's clear that Emacs isn't
> selecting that address with "localhost" or 'local. I suppose the Right
> Thing to do for server.el is to force it to use "127.0.0.1" instead of
> 'local for the :host argument.
>
>     Juanma
[...]

I think this can be the workaround for now while waiting for Ken to look
at the C side for more bugs there. Thank you both.

Could you also simplify (more readable) the loop in server-start like
this:

diff --git a/lisp/server.el b/lisp/server.el
index 1042bee..bd0d62b 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -572,11 +572,11 @@ server or call `M-x server-force-delete' to forcibly disconnect it.")
 	  (when server-use-tcp
 	    (let ((auth-key
 		   (loop
-		      ;; The auth key is a 64-byte string of random chars in the
-		      ;; range `!'..`~'.
-		      for i below 64
-		      collect (+ 33 (random 94)) into auth
-		      finally return (concat auth))))
+		    ;; The auth key is a 64-byte string of random chars in the
+		    ;; range `!'..`~'.
+		    repeat 64
+		    collect (+ 33 (random 94)) into auth
+		    finally return (concat auth))))
 	      (process-put server-process :auth-key auth-key)
 	      (with-temp-file server-file
 		(set-buffer-multibyte nil)

Leo