From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/73312 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: nnimap ignoring server options? Date: Tue, 19 Oct 2010 13:28:08 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87lj5uox53.fsf@lifelogs.com> References: <87ocb1frcu.fsf@gira.fitness2live.net.au> <87ocb0ctqy.fsf@gira.fitness2live.net.au> <87k4ll67u2.fsf@gira.fitness2live.net.au> <87fww8tktr.fsf@gira.fitness2live.net.au> <87sk0432pb.fsf@gira.fitness2live.net.au> <87lj5vtbt6.fsf@gira.fitness2live.net.au> <87mxqas225.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1287512937 22228 80.91.229.12 (19 Oct 2010 18:28:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 19 Oct 2010 18:28:57 +0000 (UTC) To: Original-X-From: ding-owner+M21684@lists.math.uh.edu Tue Oct 19 20:28:56 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P8Gvf-0007vf-RQ for ding-account@gmane.org; Tue, 19 Oct 2010 20:28:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1P8GvZ-0007dX-7Z; Tue, 19 Oct 2010 13:28:49 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1P8GvX-0007dF-Jx for ding@lists.math.uh.edu; Tue, 19 Oct 2010 13:28:47 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1P8GvS-0002Yd-IU for ding@lists.math.uh.edu; Tue, 19 Oct 2010 13:28:47 -0500 Original-Received: from chirelay1o.jumptrading.com ([38.98.147.153] helo=chirelay1.jumptrading.com) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1P8GvR-0005o4-00 for ; Tue, 19 Oct 2010 20:28:41 +0200 Original-Received: from chirelay1.jumptrading.com (unknown [127.0.0.1]) by chirelay1.jumptrading.com (Symantec Mail Security) with ESMTP id 9A423320003 for ; Tue, 19 Oct 2010 13:28:10 -0500 (CDT) X-AuditID: 26629395-9d425bb000004608-7a-4cbde33a9c01 Original-Received: from chiexchange02.w2k.jumptrading.com (unknown [38.98.147.140]) by chirelay1.jumptrading.com (Symantec Mail Security) with ESMTP id 5BAC22DC003 for ; Tue, 19 Oct 2010 13:28:10 -0500 (CDT) Original-Received: from internalsmtp.w2k.jumptrading.com (10.2.4.29) by chiexchange02.w2k.jumptrading.com (10.2.4.71) with Microsoft SMTP Server id 8.1.291.1; Tue, 19 Oct 2010 13:28:09 -0500 Original-Received: from tzlatanov-ubuntu-desktop.jumptrading.com ([10.2.14.81]) by internalsmtp.w2k.jumptrading.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 19 Oct 2010 13:28:09 -0500 X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" In-Reply-To: (Lars Magne Ingebrigtsen's message of "Tue, 19 Oct 2010 19:54:42 +0200") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) X-OriginalArrivalTime: 19 Oct 2010 18:28:09.0920 (UTC) FILETIME=[61B7E400:01CB6FBB] X-Brightmail-Tracker: AAAAAA== X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:73312 Archived-At: On Tue, 19 Oct 2010 19:54:42 +0200 Lars Magne Ingebrigtsen wrote: LMI> Ted Zlatanov writes: >> That seems easy to fix: >> >> (when (symbolp port) (setq port (symbol-name port))) >> >> ...and I think it would be a good fit, generally, since service names >> tend to be within the symbol character set. Any reasons not to do this? LMI> This should be done in the code that maps service names to numbers to LMI> avoid having some taking 'imaps and other taking "imaps". That would LMI> probably be Fmake_network_process. Here's a patch. It also corrects the docs (getservbyname will be called if getaddrinfo is not available, so either way a string will work, which is not what the docs say). WDYT? Ted === 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))