unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Allow specifying services as symbols?
@ 2010-10-19 18:07 Lars Magne Ingebrigtsen
  2010-10-19 18:22 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-19 18:07 UTC (permalink / raw)
  To: emacs-devel

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.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-10-20 16:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-19 18:07 Allow specifying services as symbols? Lars Magne Ingebrigtsen
2010-10-19 18:22 ` Eli Zaretskii
2010-10-19 19:09 ` Ted Zlatanov
2010-10-19 20:17   ` Chong Yidong
2010-10-19 21:25     ` Ted Zlatanov
2010-10-19 21:32 ` Davis Herring
2010-10-19 22:20   ` Chong Yidong
2010-10-19 23:46     ` Lars Magne Ingebrigtsen
2010-10-20 15:36       ` Stefan Monnier
2010-10-20 16:10         ` Chong Yidong
2010-10-20 16:21         ` Ted Zlatanov
2010-10-20 11:32     ` Ted Zlatanov
2010-10-20 11:52       ` Andreas Schwab
2010-10-20 12:29         ` Ted Zlatanov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).