* How to add new split method?
@ 1998-11-11 12:50 Kai.Grossjohann
1998-11-11 16:52 ` Michael Welsh Duggan
0 siblings, 1 reply; 4+ messages in thread
From: Kai.Grossjohann @ 1998-11-11 12:50 UTC (permalink / raw)
Suppose I had a function which could split some of the incoming
messages but not all of them. Thus, the behavior I want is:
If nnmail-kai-split-smartly returns a group, split the incoming
message to that group, else process nnmail-split-methods normally.
I'm also willing to use nnmail-split-fancy, of course, if that helps.
The documentation for nnmail-split-fancy tells me that it is possible
to call functions, but it is not clear whether the function is allowed
to return a don't-know value whereupon the processing of
nnmail-split-fancy continues.
Maybe I can just make the function return NIL as a don't-know value?
The documentation doesn't say, and I don't grok the source.
kai
--
Life is hard and then you die.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to add new split method?
1998-11-11 12:50 How to add new split method? Kai.Grossjohann
@ 1998-11-11 16:52 ` Michael Welsh Duggan
1998-11-11 20:00 ` Kai.Grossjohann
1998-11-13 18:49 ` Lars Magne Ingebrigtsen
0 siblings, 2 replies; 4+ messages in thread
From: Michael Welsh Duggan @ 1998-11-11 16:52 UTC (permalink / raw)
Kai.Grossjohann@CS.Uni-Dortmund.DE writes:
> Suppose I had a function which could split some of the incoming
> messages but not all of them. Thus, the behavior I want is:
>
> If nnmail-kai-split-smartly returns a group, split the incoming
> message to that group, else process nnmail-split-methods normally.
>
> I'm also willing to use nnmail-split-fancy, of course, if that helps.
>
> The documentation for nnmail-split-fancy tells me that it is possible
> to call functions, but it is not clear whether the function is allowed
> to return a don't-know value whereupon the processing of
> nnmail-split-fancy continues.
>
> Maybe I can just make the function return NIL as a don't-know value?
> The documentation doesn't say, and I don't grok the source.
Well, according to the documentation of nnmail-split-fancy, the
function should return a split. I guess in the ordinary case, that
would be a string representing the group you wanted to place it into.
But as you correctly guessed, nil is a valid split, which always
fails. This does not appear to be in the documentation, but appears
in nnmail-split-it:
;; nil split
((null split)
nil)
So, as an example, you can have a split like the following:
'(|
(: my-splitting-function)
;; If the above fails...
(: my-other-splitting-function)
;; That fails too?
(from "foobar" "mail.foobar")
;; If it gets here, it must be junk
junk)
where `my-splitting-function' and `my-other-splitting-function' return
nil if they can't determine a split.
Kudos to Lars, BTW, for creating the wonderful `nnmail-split-fancy'
foo. It has everything I could want in a splitting engine, and then
some!
--
Michael Duggan
(md5i@cs.cmu.edu)
.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1998-11-13 18:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-11 12:50 How to add new split method? Kai.Grossjohann
1998-11-11 16:52 ` Michael Welsh Duggan
1998-11-11 20:00 ` Kai.Grossjohann
1998-11-13 18:49 ` Lars Magne Ingebrigtsen
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).