Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* group splitting and gnus-secondary-select-methods
@ 2017-08-10 22:47 Christoph Groth
  2017-08-11 16:22 ` Eric Abrahamsen
  2017-08-11 16:35 ` Emanuel Berg
  0 siblings, 2 replies; 5+ messages in thread
From: Christoph Groth @ 2017-08-10 22:47 UTC (permalink / raw)
  To: info-gnus-english

Hi,

I'm trying to setup group mail splitting in a setup where I 
receive mail through multiple IMAP accounts that are configured 
through gnus-secondary-select-methods.

Simply setting gnus-secondary-select-methods in ~/.gnus, like with 
plain splitting, doesn't work, since at the time when ~/.gnus is 
executed (gnus-group-split-fancy) returns an empty split.

In order to solve this problem, I have defined a function 
my-set-secondary-select-methods and add it to one or multiple 
appropriate hooks.  Is there a better alternative?

If not, what hooks should I add my function to?  It seems to work 
with

(add-hook 'gnus-read-newsrc-el-hook 
'my-set-secondary-select-methods)
(add-hook 'gnus-get-new-news-hook 
'my-set-secondary-select-methods)

Thanks for any hints,
Christoph


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

* Re: group splitting and gnus-secondary-select-methods
  2017-08-10 22:47 group splitting and gnus-secondary-select-methods Christoph Groth
@ 2017-08-11 16:22 ` Eric Abrahamsen
  2017-08-11 18:34   ` Christoph Groth
  2017-08-11 16:35 ` Emanuel Berg
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Abrahamsen @ 2017-08-11 16:22 UTC (permalink / raw)
  To: info-gnus-english

Christoph Groth <christoph@grothesque.org> writes:

> Hi,
>
> I'm trying to setup group mail splitting in a setup where I receive
> mail through multiple IMAP accounts that are configured through
> gnus-secondary-select-methods.
>
> Simply setting gnus-secondary-select-methods in ~/.gnus, like with
> plain splitting, doesn't work, since at the time when ~/.gnus is
> executed (gnus-group-split-fancy) returns an empty split.
>
> In order to solve this problem, I have defined a function
> my-set-secondary-select-methods and add it to one or multiple
> appropriate hooks.  Is there a better alternative?
>
> If not, what hooks should I add my function to?  It seems to work with
>
> (add-hook 'gnus-read-newsrc-el-hook 'my-set-secondary-select-methods)
> (add-hook 'gnus-get-new-news-hook 'my-set-secondary-select-methods)

I'm not entirely sure what's going on with your setup, here, but I'm
pretty sure it should work without having to re-set your secondary
select methods in a hook.

Can you show us a simple config, setting gnus-secondary-select-methods
and the splitting rules in ~/.gnus? The setup that isn't working for
you?

Eric



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

* Re: group splitting and gnus-secondary-select-methods
  2017-08-10 22:47 group splitting and gnus-secondary-select-methods Christoph Groth
  2017-08-11 16:22 ` Eric Abrahamsen
@ 2017-08-11 16:35 ` Emanuel Berg
  1 sibling, 0 replies; 5+ messages in thread
From: Emanuel Berg @ 2017-08-11 16:35 UTC (permalink / raw)
  To: info-gnus-english

Christoph Groth wrote:

> Hi,
>
> I'm trying to setup group mail splitting in
> a setup where I receive mail through multiple
> IMAP accounts that are configured through
> gnus-secondary-select-methods.

I don't use IMAP, but old POP, but
mail-splitting I don't see why it shouldn't be
the same.

Here is an example what you can do:

    (setq nnmail-split-methods
          '(
            ("blogomatic"    "Subject: \\[blogomatic\\]")
            ("mail.ml-ooa"   "\\(To\\|Cc\\):.*\\(emacs-w3m@namazu.org\\|\\(help-gnu-emacs\\|emacs-devel\\)@gnu.org\\|gmane-discuss@quimby.gnus.org\\|tex-live@tug.org\\|gnuplot-info@lists.sourceforge.net\\)")
            ("mail.misc"     "")
          ))

Obviously if you want to split depending on
from what account the mail originated, you'd
have to change the parameters accordingly.

(This probably didn't help, so just sayin'. :))

-- 
underground experts united
http://user.it.uu.se/~embe8573



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

* Re: group splitting and gnus-secondary-select-methods
  2017-08-11 16:22 ` Eric Abrahamsen
@ 2017-08-11 18:34   ` Christoph Groth
  2017-08-13  3:01     ` Eric Abrahamsen
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Groth @ 2017-08-11 18:34 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: info-gnus-english


[-- Attachment #1.1: Type: text/plain, Size: 1465 bytes --]

Eric, Emanuel,

Thank you for the quick replies!  Perhaps I haven't been clear: 
when I said that I'm trying to setup "group mail splitting" I 
didn't mean plain mail splitting (I have been using that one since 
the begin of the century or so), I meant what the Gnus manual 
calls "group mail splitting" (there's a section on it).  Gnus has 
functionality to generate fancy splitting rules automatically for 
groups that contain 'to-list' or 'to-address' parameters.  If you 
have defined these parameters for some groups and evaluate 
(gnus-group-split-fancy), you'll get a split that can be assigned 
to the variable nnimap-split-fancy.

So far so good, the only problem is that at the time that ~/.gnus 
gets executed, (gnus-group-split-fancy) returns an empty split 
'(&)'.  You can see this by putting
(setq my-group-split-fancy-result (gnus-group-split-fancy))
in your ~/.gnus and examining the variable.  It seems to me that 
this is because when it executes its configuration file, Gnus 
doesn't yet know what groups there are.

That's why I've been using hooks to set the variable 
gnus-secondary-select-methods.  Gnus has some functionality to 
setup hooks for group mail splitting by itself, but this doesn't 
cover multiple select methods.

The hooks that I've found (gnus-read-newsrc-el-hook and 
gnus-get-new-news-hook), but I'm not sure whether that's the best 
way to setup things.  And if it is, it should be maybe added to 
the manual.

Christoph

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]



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

* Re: group splitting and gnus-secondary-select-methods
  2017-08-11 18:34   ` Christoph Groth
@ 2017-08-13  3:01     ` Eric Abrahamsen
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Abrahamsen @ 2017-08-13  3:01 UTC (permalink / raw)
  To: info-gnus-english

Christoph Groth <christoph@grothesque.org> writes:

> Eric, Emanuel,
>
> Thank you for the quick replies!  Perhaps I haven't been clear: when I
> said that I'm trying to setup "group mail splitting" I didn't mean
> plain mail splitting (I have been using that one since the begin of
> the century or so), I meant what the Gnus manual calls "group mail
> splitting" (there's a section on it).  Gnus has functionality to
> generate fancy splitting rules automatically for groups that contain
> 'to-list' or 'to-address' parameters.  If you have defined these
> parameters for some groups and evaluate (gnus-group-split-fancy),
> you'll get a split that can be assigned to the variable
> nnimap-split-fancy.

Oh... that's something I haven't used before, sorry.

Are you using it as directed, as an element of `nnmail-split-fancy'?
Simply calling it in your gnus file isn't going to produce the correct
results, the function needs to be a part of that variable's value to do
the right thing.

If that doesn't work, try putting (gnus-group-split-setup t) in your
gnus file? That looks like it will set up the correct hooks for
updating.

Like I said, I haven't used this before, and the above suggestions just
come from a brief perusal of gnus-mlspl.el. Apologies if you've already
gone through that file and these approaches haven't worked...

Eric



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

end of thread, other threads:[~2017-08-13  3:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-10 22:47 group splitting and gnus-secondary-select-methods Christoph Groth
2017-08-11 16:22 ` Eric Abrahamsen
2017-08-11 18:34   ` Christoph Groth
2017-08-13  3:01     ` Eric Abrahamsen
2017-08-11 16:35 ` Emanuel Berg

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).