=== modified file 'src/process.c' --- src/process.c 2010-10-08 10:14:47 +0000 +++ src/process.c 2010-10-19 18:26:51 +0000 @@ -2978,10 +2978,11 @@ host, and only clients connecting to that address will be accepted. :service SERVICE -- SERVICE is name of the service desired, or an -integer specifying a port number to connect to. If SERVICE is t, -a random port number is selected for the server. (If Emacs was -compiled with getaddrinfo, a port number can also be specified as a -string, e.g. "80", as well as an integer. This is not portable.) +integer specifying a port number to connect to. If SERVICE is t, a +random port number is selected for the server. A port number can also +be specified as a string, e.g. "80", or a symbol whose name will be +used, as well as an integer. This is not necessarily portable; either +getaddrinfo or getservbyname will be used to look up the port number. :type TYPE -- TYPE is the type of connection. The default (nil) is a stream type connection, `datagram' creates a datagram type connection, @@ -3303,6 +3304,11 @@ Otherwise, use getservbyname to lookup the service. */ if (!NILP (host)) { + /* Take a symbol as the service and convert it to a string. */ + if (SYMBOLP (service)) + { + service = Fsymbol_name (service); + } /* SERVICE can either be a string or int. Convert to a C string for later use by getaddrinfo. */ @@ -3347,6 +3353,12 @@ /* We end up here if getaddrinfo is not defined, or in case no hostname has been specified (e.g. for a local server process). */ + /* Take a symbol as the service and convert it to a string. */ + if (SYMBOLP (service)) + { + service = Fsymbol_name (service); + } + if (EQ (service, Qt)) port = 0; else if (INTEGERP (service))