Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* nnimap-split-fancy
@ 2010-12-17  1:10 Tommy Kelly
  0 siblings, 0 replies; 6+ messages in thread
From: Tommy Kelly @ 2010-12-17  1:10 UTC (permalink / raw)
  To: info-gnus-english

I may have to propose info "6.3.6 Fancy Mail Splitting" for the winner
of "Most Difficult To Follow Instructions 2010", but let's see. As a
start, does  the following make sense? The intent is to put emails from
domain1.com and domain2.com into, respectively, groups
emails-from-domain1 and emails-from-domain2, and to leave all others in
INBOX. 

(setq gnus-secondary-select-methods
      '(
	(nnimap "work"
		(nnimap-address "imap.gmail.com")
 	 	(nnimap-stream ssl)
		(nnimap-server-port 993)
		(nnimap-inbox "INBOX")
		(nnimap-split-methods 'nnmail-split-fancy)
		(nnmail-split-fancy 
		 ( |
		   ("from" ".*domain1\\.com" "emails-from-domain1)
		   ("from" ".*domain2\\.com" "emails-from-domain2)
		   "INBOX" "")
		  )
		)
      )

If it does make sense, well it doesn't work.

How about an example from someone who groks this stuff. What would the
fancy splitting look like to put into group "jabba-hates-luke", all
messages from jabba@thehutt.com with "Luke is annoying" in the subject? 

And then, other questions about the info:

* "This variable has the format of a split. A split is ..."

Is a "split" a well-defined lisp thing? If not, isn't that definition
nothing more than the statement: "This variable has the format of a
possibly recursive thingy"?  

* "Here are the possible split syntaxes: group ..."

This is very confusing given that "junk" and "nil" are also listed as
options later. It makes it look like group is another symbol that can be
provided as a split. But then:


* "junk  If the split is the symbol junk ..." 
and
* "nil   If the split is nil it is ignored"

What would it look like for the split to *be* the symbol junk?
And an example of a nil split would be helpful.


* "(! func split)  If the split is a list, and the first element is !,
  then split will be processed, and func will be called as a function
  with the result of split as argument..."

Now I'm not showing italics, and so in the original (with-italics) the difference
between *the* split, and its internal split (i.e. third item in the
list) is clearer. But it would be 
a helluva lot easier to read if "split" wasn't being used in two
different senses.

Also, what is "the result of split"? Is it a split? A group name? What?

Note -- I am not au fait with lisp, so maybe the above are all stupid
newb questions, but I'm kinda guessing not. 

thanks,
Tommy

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

* Re: nnimap-split-fancy
  2010-12-17 15:09   ` nnimap-split-fancy Tommy Kelly
@ 2010-12-18 19:12     ` Eric S Fraga
  0 siblings, 0 replies; 6+ messages in thread
From: Eric S Fraga @ 2010-12-18 19:12 UTC (permalink / raw)
  To: Tommy Kelly; +Cc: info-gnus-english

Tommy Kelly <tommy.kelly@verilab.com> writes:

[...]

> Yeah, me too. For example: why does the . in domain1.com require the
> "\\" when included in the fancy split approach, but no toothpicks at all
> are needed when the same string is included in the normal (non fancy)
> approach?

Well, because "." matches any character, including "."...

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1 + No Gnus v0.11

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

* Re: nnimap-split-fancy
       [not found]   ` <mailman.4.1292598585.3076.info-gnus-english@gnu.org>
@ 2010-12-17 21:18     ` Adam Sjøgren
  0 siblings, 0 replies; 6+ messages in thread
From: Adam Sjøgren @ 2010-12-17 21:18 UTC (permalink / raw)
  To: info-gnus-english

On Fri, 17 Dec 2010 09:09:13 -0600, Tommy wrote:

> Thanks Adam, but that's my bad. I omitted the closing quotes as I
> created my email message. The original .gnus was correct (font and
> indentation would have shown up that error a mile away).

Always copy/paste and change as little as possible before posting -
sometimes the devil is in the detail.

> Yeah, me too. For example: why does the . in domain1.com require the
> "\\" when included in the fancy split approach, but no toothpicks at all
> are needed when the same string is included in the normal (non fancy)
> approach?

I don't use it enough to care to remember, so I test when I need it.


  Best regards,

    Adam

-- 
 "Accept the mystery!"                                        Adam Sjøgren
                                                         asjo@koldfront.dk

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

* Re: nnimap-split-fancy
  2010-12-17  9:38 ` nnimap-split-fancy Adam Sjøgren
  2010-12-17 10:36   ` nnimap-split-fancy Richard Riley
@ 2010-12-17 15:09   ` Tommy Kelly
  2010-12-18 19:12     ` nnimap-split-fancy Eric S Fraga
       [not found]   ` <mailman.4.1292598585.3076.info-gnus-english@gnu.org>
  2 siblings, 1 reply; 6+ messages in thread
From: Tommy Kelly @ 2010-12-17 15:09 UTC (permalink / raw)
  To: info-gnus-english

asjo@koldfront.dk (Adam Sjøgren) writes:

> On Thu, 16 Dec 2010 19:10:49 -0600, Tommy wrote:
>
>> 		   ("from" ".*domain1\\.com" "emails-from-domain1)
>                                                                  ^
>                                                              Missing ".

Thanks Adam, but that's my bad. I omitted the closing quotes as I
created my email message. The original .gnus was correct (font and
indentation would have shown up that error a mile away).

But it was, as I say, my bad. Ignore me for now while I prepare a
definitive problem case.

But a question in the meantime:

> ... it helps
> pinpointing where I have forgotten some \'s or something (I am used to
> Perls regexp syntax, so remembering all the leaning toothpicks in Emacs
> regexps is sometimes a problem :-))

Yeah, me too. For example: why does the . in domain1.com require the
"\\" when included in the fancy split approach, but no toothpicks at all
are needed when the same string is included in the normal (non fancy)
approach?

At first I assumed it was because in the fancy approach the string is a regexp
while in non-fancy it's just a plain string. But that's not true is it? The
use of things like "^" and ".*"  in non-fancy shows it's a regexp too,
no?

Tommy

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

* Re: nnimap-split-fancy
  2010-12-17  9:38 ` nnimap-split-fancy Adam Sjøgren
@ 2010-12-17 10:36   ` Richard Riley
  2010-12-17 15:09   ` nnimap-split-fancy Tommy Kelly
       [not found]   ` <mailman.4.1292598585.3076.info-gnus-english@gnu.org>
  2 siblings, 0 replies; 6+ messages in thread
From: Richard Riley @ 2010-12-17 10:36 UTC (permalink / raw)
  To: info-gnus-english

asjo@koldfront.dk (Adam Sjøgren) writes:

> On Thu, 16 Dec 2010 19:10:49 -0600, Tommy wrote:
>
>> 		   ("from" ".*domain1\\.com" "emails-from-domain1)
>                                                                  ^
>                                                              Missing ".
>
>> 		   ("from" ".*domain2\\.com" "emails-from-domain2)
>                                                                  ^
>                                                               Ditto.
>
> I often find that the easiest way to debug regexp-matching in Emacs is
> to start with something extremely simple that works, and then gradually
> adding things I think should work until they don't - it helps
> pinpointing where I have forgotten some \'s or something (I am used to
> Perls regexp syntax, so remembering all the leaning toothpicks in Emacs
> regexps is sometimes a problem :-))
>
>   Best regards,
>
>     Adam

There is also the wonderful regexp-builder.

regards

r.


-- 
☘ http://www.shamrockirishbar.com, http://splash-of-open-sauce.blogspot.com/ http://www.richardriley.net

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

* Re: nnimap-split-fancy
       [not found] <mailman.5.1292548275.31723.info-gnus-english@gnu.org>
@ 2010-12-17  9:38 ` Adam Sjøgren
  2010-12-17 10:36   ` nnimap-split-fancy Richard Riley
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Adam Sjøgren @ 2010-12-17  9:38 UTC (permalink / raw)
  To: info-gnus-english

On Thu, 16 Dec 2010 19:10:49 -0600, Tommy wrote:

> 		   ("from" ".*domain1\\.com" "emails-from-domain1)
                                                                 ^
                                                             Missing ".

> 		   ("from" ".*domain2\\.com" "emails-from-domain2)
                                                                 ^
                                                              Ditto.

I often find that the easiest way to debug regexp-matching in Emacs is
to start with something extremely simple that works, and then gradually
adding things I think should work until they don't - it helps
pinpointing where I have forgotten some \'s or something (I am used to
Perls regexp syntax, so remembering all the leaning toothpicks in Emacs
regexps is sometimes a problem :-))


  Best regards,

    Adam

-- 
 "Accept the mystery!"                                        Adam Sjøgren
                                                         asjo@koldfront.dk

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

end of thread, other threads:[~2010-12-18 19:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-17  1:10 nnimap-split-fancy Tommy Kelly
     [not found] <mailman.5.1292548275.31723.info-gnus-english@gnu.org>
2010-12-17  9:38 ` nnimap-split-fancy Adam Sjøgren
2010-12-17 10:36   ` nnimap-split-fancy Richard Riley
2010-12-17 15:09   ` nnimap-split-fancy Tommy Kelly
2010-12-18 19:12     ` nnimap-split-fancy Eric S Fraga
     [not found]   ` <mailman.4.1292598585.3076.info-gnus-english@gnu.org>
2010-12-17 21:18     ` nnimap-split-fancy Adam Sjøgren

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