Gnus development mailing list
 help / color / mirror / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: Katsumi Yamaoka <yamaoka@jpl.org>
Cc: ding@gnus.org
Subject: Re: Problem with gnus-parameters
Date: Tue, 29 Nov 2011 09:37:34 +0100	[thread overview]
Message-ID: <878vmziasx.fsf@tsdh.uni-koblenz.de> (raw)
In-Reply-To: <b4mty5n8rgr.fsf@jpl.org> (Katsumi Yamaoka's message of "Tue, 29 Nov 2011 13:47:48 +0900")

Katsumi Yamaoka <yamaoka@jpl.org> writes:

Hi,

> Tassilo Horn wrote:
>> This suggests that the `gnus-parameters' are applied with the same
>> semantics as `gnus-posting-styles':
>
>> ,----[ (info "(gnus)Posting Styles") ]
>>| Each style will be applicable if the first element "matches", in some
>>| form or other.
>
> No, as for `gnus-parameters' the last match is applied now:
>
> 2010-09-26  Lars Magne Ingebrigtsen  <larsi@gnus.org>
>
> 	* gnus.el (gnus-group-fast-parameter): Return the last matching
> 	parameter instead of the first matching parameter.
>
> In addition, the value of any parameter for a `gnus-parameters'
> element that doesn't have that parameter is treated as nil.

Ok, I see.

> So,
>
>> (setq gnus-parameters
>>       `((,(rx "nnimap+")
>> 	 (gnus-use-scoring nil)
>> 	 (gcc-self . t))
>
>> 	;; Where to expire
>> 	(,(rx "nnimap+Uni:")
>> 	 (expiry-target . "nnimap+Uni:Trash"))
>> 	(,(rx "nnimap+Fastmail:")
>> 	 (expiry-target . "nnimap+Fastmail:INBOX.Trash"))
>> 	(,(rx "nnimap+Gmail:")
>> 	 (expiry-target . "nnimap+Gmail:[Google Mail]/Trash"))
>
>> 	;; Mailing List exceptions
>> 	(,(rx "nnimap+Uni:ml/")
>> 	 (gcc-self . "nnimap+Uni:Sent"))
>> 	(,(rx "nnimap+Fastmail:INBOX.mailinglists.")
>> 	 (gcc-self . "nnimap+Fastmail:INBOX.Sent Items")
>> 	 (gnus-use-scoring t))))
>
> for the "nnimap+Gmail:foo" group for example, there are two matching
> element; one sets gcc-self to t but the last one resets it to nil.
> Maybe the solution is to add (gcc-self . t) to every element having no
> gcc-self.

That would solve my issue, but the general question is: Is there a
reason why `gnus-parameters' are applied differently than posting
styles?

From user's perspective, the posting styles approach is extremely
convenient, because I don't need to duplicate information.  Now, to
achieve what I want, I need to duplicate information five times that
would be there implicitly with the iterative first-to-last posting style
application approach.

--8<---------------cut here---------------start------------->8---
(setq gnus-parameters
      `((,(rx "nnimap+")
	 (gnus-use-scoring nil)
	 (gcc-self . t))

	;; Where to expire
	(,(rx "nnimap+Uni:")
	 (gcc-self . t)                                  ;; DUPLICATE
	 (expiry-target . "nnimap+Uni:Trash"))
	(,(rx "nnimap+Fastmail:")
	 (gcc-self . t)                                  ;; DUPLICATE
	 (expiry-target . "nnimap+Fastmail:INBOX.Trash"))
	(,(rx "nnimap+Gmail:")
	 (gcc-self . t)                                  ;; DUPLICATE
	 (expiry-target . "nnimap+Gmail:[Google Mail]/Trash"))

	;; Mailing List exceptions
	(,(rx "nnimap+Uni:ml/")
	 (expiry-target . "nnimap+Uni:Trash")            ;; DUPLICATE
	 (gcc-self . "nnimap+Uni:Sent"))
	(,(rx "nnimap+Fastmail:INBOX.mailinglists.")
	 (expiry-target . "nnimap+Fastmail:INBOX.Trash") ;; DUPLICATE
	 (gcc-self . "nnimap+Fastmail:INBOX.Sent Items")
	 (gnus-use-scoring t))))
--8<---------------cut here---------------end--------------->8---

And even more baffling, the group local variables (like
gnus-use-scoring) actually seem to be applied exactly like posting
styles.  Above, I've disabled it for all nnimap groups except for my
mailinglist groups on my fastmail account.  That works just fine as-is
without the need of adding (gnus-use-scoring nil) to any other part.

IMO, the current implementation is pretty confusing.  And although the
docs state that there are parameters and group local variable, it
doesn't tell how that influences their application.  Well, basically it
doesn't say anything about how group parameters are applied, anyway...

Bye,
Tassilo



  reply	other threads:[~2011-11-29  8:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-28 19:54 Tassilo Horn
2011-11-29  4:47 ` Katsumi Yamaoka
2011-11-29  8:37   ` Tassilo Horn [this message]
2012-01-03 21:15     ` Lars Magne Ingebrigtsen
2012-01-04  7:33       ` Tassilo Horn
2012-01-04 20:03         ` Lars Magne Ingebrigtsen
2012-01-05 10:00           ` Tassilo Horn
2012-01-06 20:41             ` Lars Magne Ingebrigtsen
2012-01-06 20:43               ` Lars Magne Ingebrigtsen
2012-01-06 22:27                 ` Tassilo Horn
2012-01-06 22:44                   ` Lars Magne Ingebrigtsen
2012-01-06 22:52                     ` Tassilo Horn
2012-01-06 23:13                       ` Lars Magne Ingebrigtsen
2012-01-06 23:37                         ` Tassilo Horn
2012-01-07  0:36                           ` Lars Magne Ingebrigtsen
2012-01-07  8:08                             ` Tassilo Horn
2012-01-06 22:20               ` Tassilo Horn
2012-01-06 22:31                 ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878vmziasx.fsf@tsdh.uni-koblenz.de \
    --to=tassilo@member.fsf.org \
    --cc=ding@gnus.org \
    --cc=yamaoka@jpl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).