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

From: Juanma Barranquero <[email-masked]>
Date: Fri, 24 Sep 2010 21:38:28 +0200

On Tue, Aug 10, 2010 at 15:31, Stefan Monnier <[email-masked]> wrote:
>
>> But, all in all, I agree that if `localhost' can be interpreted as
>> variably as Ken has pointed out, we shouldn't use it.
>
> Could you make the corresponding change in `trunk'?

OK to this change, then?

    Juanma

2010-09-24  Juanma Barranquero	<[email-masked]>

	* server.el (server-start): Revert part of 2010-08-08 change.  Using
	address 127.0.0.1 for local host is now done in Fmake_network_process.

2010-09-24  Juanma Barranquero	<[email-masked]>

	* process.c (Fmake_network_process): When arg :host is 'local,
	use address 127.0.0.1, not name "localhost".  (Bug#6781)

=== modified file 'lisp/server.el'
--- lisp/server.el	2010-08-26 13:46:19 +0000
+++ lisp/server.el	2010-09-24 19:16:01 +0000
@@ -565,7 +565,7 @@
 		       (if server-use-tcp
 			   (list :family 'ipv4  ;; We're not ready for IPv6 yet
 				 :service t
-				 :host (or server-host "127.0.0.1") ;; See bug#6781
+				 :host (or server-host 'local)
 				 :plist '(:authenticated nil))
 			 (list :family 'local
 			       :service server-file

=== modified file 'src/process.c'
--- src/process.c	2010-09-17 15:47:49 +0000
+++ src/process.c	2010-09-24 19:31:13 +0000
@@ -3170,7 +3170,9 @@
   if (!NILP (host))
     {
       if (EQ (host, Qlocal))
-	host = build_string ("localhost");
+	/* Depending on setup, "localhost" may map to different IPv4 and/or
+	   IPv6 addresses, so it's better to be explicit.  (Bug#6781) */
+	host = build_string ("127.0.0.1");
       CHECK_STRING (host);
     }