Gnus development mailing list
 help / color / mirror / Atom feed
* [FEATURE] one more syntax for nnmail-split-fancy
@ 1999-02-25 10:45 Didier Verna
  0 siblings, 0 replies; only message in thread
From: Didier Verna @ 1999-02-25 10:45 UTC (permalink / raw)



        Recently, I fell on a bogus mailing list that sometime was called
the-list, and sometime The-List. Since I fold mailing lists automatically
following a set of frequent headers (like X-Mailing-List), I'd have liked to
downcase the result of the split. More generally, I realized that there's no
mean to post-process the /result/ of a split[1]. So I propose a new syntax for
nnmail-split-fancy: `(! FUNC SPLIT)'

FUNC is a symbol. SPLIT is evaluated (with `nnmail-split-it') and the result
is passed to FUNC, which should return a new split. So now, I've this in my
`nnmail-split-fancy' variable:

 ,----
| (setq nnmail-split-fancy
|       '(! gnus-postprocess-split
|           (|
|            ... ... )))
`-----

gnus-postprocess-split return the same split, appart from the fact that all
strings are downcase'd. And now I'm happy. I'm sooooo happy :-)


1999-02-25  Didier Verna  <verna@inf.enst.fr>

	* nnmail.el (nnmail-split-it): new syntax: `(! FUNC SPLIT)'. FUNC
	is called with the result of SPLIT and should return a new split.

        * gnus.texi: update the doc.


--- lisp/nnmail.el.orig	Thu Feb 25 11:09:40 1999
+++ lisp/nnmail.el	Thu Feb 25 11:27:55 1999
@@ -1099,6 +1099,10 @@
      ((eq (car split) ':)
       (nnmail-split-it (save-excursion (eval (cdr split)))))
 
+     ;; Builtin ! operation.
+     ((eq (car split) '!)
+      (funcall (cadr split) (nnmail-split-it (caddr split))))
+
      ;; Check the cache for the regexp for this split.
      ((setq cached-pair (assq split nnmail-split-cache))
       (goto-char (point-max))


--- texi/gnus.texi.orig	Thu Feb 25 12:01:12 1999
+++ texi/gnus.texi	Thu Feb 25 12:39:24 1999
@@ -10354,6 +10354,11 @@
 element is @code{:}, then the second element will be called as a
 function with @var{args} given as arguments.  The function should return
 a SPLIT.
+
+@item
+@var{(! FUNC SPLIT)}: If the split is a list, and the first element
+is @code{!}, then SPLIT will be processed, and FUNC will be called as a
+function with the result of SPLIT as argument. FUNC should return a split.
 
 @item
 @code{nil}: If the split is @code{nil}, it is ignored.


Footnotes: 
[1]  Well, if there's one, show me that I'm stupid.

-- 
    /     /   _   _       Didier Verna        http://www.inf.enst.fr/~verna/
 - / / - / / /_/ /      E.N.S.T. INF C201.1      mailto:verna@inf.enst.fr
/_/ / /_/ / /__ /        46 rue Barrault        Tel.   (33) 01 45 81 73 46
                      75634 Paris  cedex 13     Fax.   (33) 01 45 81 31 19


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-02-25 10:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-25 10:45 [FEATURE] one more syntax for nnmail-split-fancy Didier Verna

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