From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/69793 Path: news.gmane.org!not-for-mail From: asjo@koldfront.dk (Adam =?iso-8859-1?Q?Sj=F8gren?=) Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Avoid opening secondary select methods as foreign servers Date: Wed, 07 Jul 2010 01:57:11 +0200 Organization: koldfront - analysis & revolution, Copenhagen, Denmark Message-ID: <8739vwupt4.fsf_-_@topper.koldfront.dk> References: <87fwzwfi5l.fsf@topper.koldfront.dk> <87bpakfhtg.fsf@topper.koldfront.dk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1278460671 20010 80.91.229.12 (6 Jul 2010 23:57:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 6 Jul 2010 23:57:51 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M18183@lists.math.uh.edu Wed Jul 07 01:57:49 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 1OWI1L-0005eh-Ki for ding-account@gmane.org; Wed, 07 Jul 2010 01:57:47 +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 1OWI10-0004Li-Mc; Tue, 06 Jul 2010 18:57:26 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1OWI0z-0004LW-8G for ding@lists.math.uh.edu; Tue, 06 Jul 2010 18:57:25 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1OWI0x-0002M3-BM for ding@lists.math.uh.edu; Tue, 06 Jul 2010 18:57:25 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1OWI0w-0000fD-00 for ; Wed, 07 Jul 2010 01:57:22 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OWI0v-0005UK-LP for ding@gnus.org; Wed, 07 Jul 2010 01:57:21 +0200 Original-Received: from rain.gmane.org ([80.91.229.7]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Jul 2010 01:57:21 +0200 Original-Received: from asjo by rain.gmane.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Jul 2010 01:57:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 73 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: rain.gmane.org X-Face: )qY&CseJ?.:=8F#^~GcSA?F=9eu'{KAFfL1C3/A&:nE?PW\i65"ba0NS)97,Q(^@xk}n4Ou rPuR#V8I(J_@~H($[ym:`K_+]*kjvW>xH5jbgLBVFGXY:(#4P>zVBklLbdL&XxL\M)%T}3S/IS9lMJ ^St'=VZBR Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:69793 Archived-At: This is probably the wrong way to fix the problem - which is that Gnus opens servers defined in secondary-select-methods twice, once with all the configuration given and once as a foreign server with none of the configuration given. The easy way to see the symptom is to go to the *Server* buffer where servers will be listed twice, or to check the value of the gnus-opened-servers variable, which holds the same server twice. This patch changes gnus-secondary-select-method-p to only look at the first two elements in the list (nntp and "news.server.org"), because the incoming argument never has the entire list. gnus-check-server is then changed to call gnus-secondary-select-method-p and if the server in question is in secondary-select-methods, the configuration from there is used. --- lisp/gnus-int.el | 3 +++ lisp/gnus.el | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/gnus-int.el b/lisp/gnus-int.el index a079591..94fb6c7 100644 --- a/lisp/gnus-int.el +++ b/lisp/gnus-int.el @@ -169,6 +169,9 @@ If it is down, start it up (again)." ;; Transform virtual server names into select methods. (when (stringp method) (setq method (gnus-server-to-method method))) + ;; Get configuration if the server is a secondary-select-method. + (when (gnus-secondary-method-p method) + (setq method (car (gnus-secondary-method-p method)))) (if (gnus-server-opened method) ;; The stream is already opened. t diff --git a/lisp/gnus.el b/lisp/gnus.el index 281b9ab..c3a442a 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -3830,9 +3830,9 @@ You should probably use `gnus-find-method-for-group' instead." (let ((methods gnus-secondary-select-methods) (gmethod (inline (gnus-server-get-method nil method)))) (while (and methods - (not (gnus-method-equal - (inline (gnus-server-get-method nil (car methods))) - gmethod))) + (not (and + (equal (caar methods) (car gmethod)) + (equal (cadar methods) (cadr gmethod))))) (setq methods (cdr methods))) methods)) -- 1.7.1 I am sure there are better solutions. It is quite confusing to me how sometimes servers are referred to as "nntp+news.server.org", sometimes as (nttp "news.server.org") and sometimes as (nntp "news.server.org" (var 1) (var 2) ...). Finding the correct place to fix the translation/comparison of these is far from obvious to me. Best regards, Adam -- "My internal clock is on Tokyo time." Adam Sjøgren asjo@koldfront.dk