From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/52176 Path: main.gmane.org!not-for-mail From: =?iso-8859-1?q?Michael_Teichgr=E4ber?= Newsgroups: gmane.emacs.gnus.general Subject: mail-sources backend specific? (was: Using different backends) Date: Sat, 03 May 2003 17:51:42 +0200 Sender: ding-owner@lists.math.uh.edu Message-ID: <87he8cav01.fsf@wmipf.in-berlin.de> References: <84u1cknes9.fsf@lucy.is.informatik.uni-duisburg.de> <87fznxzemr.fsf@wmipf.in-berlin.de> <84d6j1bhn3.fsf@lucy.is.informatik.uni-duisburg.de> <87el3hxw5b.fsf@wmipf.in-berlin.de> <84isstiewq.fsf@lucy.is.informatik.uni-duisburg.de> <87he8d752z.fsf@wmipf.in-berlin.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: main.gmane.org 1051977431 10461 80.91.224.249 (3 May 2003 15:57:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 3 May 2003 15:57:11 +0000 (UTC) Original-X-From: ding-owner+M719@lists.math.uh.edu Sat May 03 17:57:09 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19BzNt-0002iE-00 for ; Sat, 03 May 2003 17:57:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19BzOf-0006lb-00; Sat, 03 May 2003 10:57:57 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19BzOX-0006lV-00 for ding@lists.math.uh.edu; Sat, 03 May 2003 10:57:49 -0500 Original-Received: (qmail 2249 invoked by alias); 3 May 2003 15:57:49 -0000 Original-Received: (qmail 2244 invoked from network); 3 May 2003 15:57:48 -0000 Original-Received: from mail.s.netic.de (212.9.160.11) by sclp3.sclp.com with SMTP; 3 May 2003 15:57:48 -0000 Original-Received: from host-212-9-163-109.dial.netic.de ([212.9.163.109] helo=iridium.renata.de) by mail.s.netic.de with esmtp (Exim 4.10) id 19BzOT-0004wB-00 for ding@gnus.org; Sat, 03 May 2003 17:57:45 +0200 Original-Received: from micha by iridium.renata.de with local (MasqMail 0.1.16) id 19BzJx-3Gh-00 for ding@gnus.org; Sat, 03 May 2003 17:53:05 +0200 Mail-Reply-To: =?iso-8859-1?q?Michael_Teichgr=E4ber?= Original-To: ding@gnus.org X-Wo-Ist-Die-ISS: http://wmipf.in-berlin.de/sat/curpos.html X-Betriebssystem: Debian GNU/Linux X-Request-PGP: http://wmipf.in-berlin.de/mtgpg.asc X-PGP-Key: 5656 F203 8343 0A2E 8259 6102 3F0D B4F4 1182 8000 User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:52176 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:52176 --=-=-= Content-Transfer-Encoding: quoted-printable > It looks suspicious to me, that the mail-sources settings within > g-s-s-m affect the global value. If I set mail-sources to nil in the > init file, it is overwritten by the value above, so it has no > buffer-local binding. Hm. List elements after the server name (=3Ddefs) within an select-method are evaluated (for nnfolder, nnml) in nnoo.el:nnoo-change-server by these lines: (unless (cdr (assoc server (cddr bstate))) (while (setq def (pop defs)) (unless (assq (car def) bvariables) (nconc bvariables (list (cons (car def) (and (boundp (car def)) (symbol-value (car def))))))) (if (equal server "*internal-non-initialized-backend*") (set (car def) (symbol-value (cadr def))) (set (car def) (cadr def))))) 'bvariables' contain a part of 'nnoo-definition-alist' that is related to current backend. Its change will alter nnoo-definition-alist. According to this code, if I specify (setq gnus-secondary-select-methods '((nnfolder "" (mail-sources ((file :plugged t) ; get mail from system mailbox (directory :path "~/Mail/incoming-nnfolder" :suffix "" :plugged t)))) (nnml ""=20 (mail-sources ((directory :path "~/Mail/incoming-nnml" :suffix "" :plugged t)))))) and mail-sources is nil in the beginning, the first call for backend 'nnfolder' will add=20 (list (cons mail-sources nil)) to bvariables. When nnoo-change-server is then called for backend 'nnml', mail-sources has the value that was set by the nnfolder-backend before, therefore (list (cons mail-sources ((file :plugged t)(directory :path...)))) is added to the nnml-part of nnoo-definition-alist: ((nnfolder nil ((nnfolder-* . *) (mail-sources))) (nnml nil ((nnml-* . *) (mail-sources (file :plugged t) (directory :path "~/Mail/incoming-nnfolder" :suffix "" :plugged t)))) (...)) This is not what has been expected. If I understand it right, the intention of the code in nnoo-change-server (listed above) is to provide a means to add variable-value pairs to the list of server variables of a backend. Would it break the design, if mail-sources was handled as server variable too, so that -- depending on backend -- "nn*-mail-sources" could be specified? nndiary, for instance, is using nndiary-mail-sources instead of mail-sources. As an example, the following patch makes nnmail-get-new-mail use -mail-sources=20 rather than mail-sources: ------------------------------------------------------------>8---------- Index: nnmail.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/nnmail.el,v retrieving revision 6.74 diff -u -p -r6.74 nnmail.el --- nnmail.el 17 Apr 2003 19:01:45 -0000 6.74 +++ nnmail.el 3 May 2003 15:30:23 -0000 @@ -1646,7 +1646,8 @@ See the Info node `(gnus)Fancy Mail Spli (defun nnmail-get-new-mail (method exit-func temp &optional group spool-func) "Read new incoming mail." - (let* ((sources (or mail-sources + (let* ((sources (or (nnmail-get-value "%s-mail-sources" method) + mail-sources (if (listp nnmail-spool-file) nnmail-spool-file (list nnmail-spool-file)))) fetching-sources ----------8<------------------------------------------------------------ It seems to work, if I change mail-sources to nnfolder-mail-sources resp. nnml-mail-sources in my g-s-s-m definition. This would also allow the use of a global mail-sources with, for instance, a different one for backend 'nnfolder'. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA+s+WXPw209BGCgAARAhrQAJ0e9/qPTijN5tTTQs3ehKb2KINuCQCcDOt7 LUVlmCC2m4dgP3UkO8+doKM= =kEkR -----END PGP SIGNATURE----- --=-=-=--