From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/1129 Path: news.gmane.org!not-for-mail From: Eric Eide Newsgroups: gmane.emacs.gnus.user Subject: Re: nnmail-split-fancy: How to Write ``X but not Y''? Date: Thu, 12 Sep 2002 10:47:05 -0600 (MDT) Organization: University of Utah School of Computing Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138667945 9939 80.91.229.2 (31 Jan 2006 00:39:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 00:39:05 +0000 (UTC) Original-X-From: nobody Tue Jan 17 17:28:40 2006 Original-Path: quimby.gnus.org!lackawana.kippona.com!out.nntp.be!propagator-SanJose!news-in-sanjose!in.nntp.be!xmission!news.cc.utah.edu!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-NNTP-Posting-Host: ioka.flux.utah.edu Original-X-Trace: coward.ks.cc.utah.edu 1031849228 28304 155.98.60.84 (12 Sep 2002 16:47:08 GMT) Original-X-Complaints-To: abuse@cc.utah.edu Original-NNTP-Posting-Date: 12 Sep 2002 16:47:08 GMT User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Cuyahoga Valley) Original-Xref: bridgekeeper.physik.uni-ulm.de gnus-emacs-gnus:1269 Original-Lines: 50 X-Gnus-Article-Number: 1269 Tue Jan 17 17:28:40 2006 Xref: news.gmane.org gmane.emacs.gnus.user:1129 Archived-At: I solved my splitting problem by writing a function, `my-nnmail-split-unless'. In my fancy nnmail split, I use it like this: ("subject" "Emacs\\|XEmacs" ;; But not XEmacs mailing list messages. (: my-nnmail-split-unless '("sender" "xemacs.*@xemacs\\.org" junk) "subject.emacs")) The idea is that if the interpretation of the first split returns a non-nil value, then the second split is ignored. Otherwise, the second split is processed. In the example above, the `junk' return value of the test split is ignored. Only the truth value of the test split is important; and `junk' is a convenient true value. (The XEmacs list messages are handled elsewhere, by other splits.) FWIW, below is the defintion of `my-nnmail-split-unless'. Maybe someone else will find this to be useful! Eric. (defun my-nnmail-split-unless (avoid-split split) "If message does not match AVOID-SPLIT, return SPLIT; else return nil. AVOID-SPLIT is a Gnus `nnmail-split-fancy'-style split. The split is interpreted, and if it returns any non-nil value, this function returns nil \(an ignored split\). Otherwise, this function returns SPLIT, which is then interpreted in the normal manner by Gnus. Note that the specific value returned from the interpretation of AVOID-SPLIT is discarded; only its truth value is important. The symbol `junk' is a useful value to return from the AVOID-SPLIT, to signal that the subsequent SPLIT should not be processed. This function is useful for weeding out messages that you don't want to go into a group. For instance, consider the following split: \(\"subject\" \"Emacs\\\\|XEmacs\" \(: my-nnmail-split-unless '(from \"bozo\" junk\) \"subject.emacs\"\)\) This split will put Emacs-subject and XEmacs-subject messages, except those from \`bozo\', into the group `subject.emacs'." (if (nnmail-split-it avoid-split) nil split)) -- ------------------------------------------------------------------------------- Eric Eide . University of Utah School of Computing http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX