[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Allow specifying services as symbols?
From: |
Lars Magne Ingebrigtsen |
Subject: |
Allow specifying services as symbols? |
Date: |
Tue, 19 Oct 2010 20:07:46 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) |
It was suggested that we should allow specifying port names (e.g.,
"imap") as symbols, too, in addition to strings and numbers. Any
objections to something like the following?
=== modified file 'src/process.c'
*** src/process.c 2010-10-08 10:14:47 +0000
--- src/process.c 2010-10-19 18:06:05 +0000
***************
*** 2977,2987 ****
for a server process, it must be a valid name or address for the local
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.)
:type TYPE -- TYPE is the type of connection. The default (nil) is a
stream type connection, `datagram' creates a datagram type connection,
--- 2977,2988 ----
for a server process, it must be a valid name or address for the local
host, and only clients connecting to that address will be accepted.
! :service SERVICE -- SERVICE is name of the service desired (a string
! or a symbol) 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. "http", as well as an integer. This is
! not portable.)
:type TYPE -- TYPE is the type of connection. The default (nil) is a
stream type connection, `datagram' creates a datagram type connection,
***************
*** 3313,3318 ****
--- 3314,3323 ----
sprintf (portbuf, "%ld", (long) XINT (service));
portstring = portbuf;
}
+ else if (SYMBOLP (service))
+ {
+ portstring = SDATA (SYMBOL_NAME (service));
+ }
else
{
CHECK_STRING (service);
--
(domestic pets only, the antidote for overdose, milk.)
address@hidden * Lars Magne Ingebrigtsen
- Allow specifying services as symbols?,
Lars Magne Ingebrigtsen <=