* Adding new nnmail-split-fancy construct
@ 1997-10-22 8:35 Tonny Madsen
1997-10-24 23:36 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Tonny Madsen @ 1997-10-22 8:35 UTC (permalink / raw)
Hi'
I occasionally need to split messages, by searching them directly for
a regular expression. In most cases, though, it is simply to single
out all messages, where the the subject line starting with a specific
word.
This cannot be done with the current nnmail-split-fancy variable and
function. To deal with this I have added a catch-all split expression,
(/ REGEXP SPLIT), that will use SPLIT if REGEXP matches the message. I
would prefer a solution where one could specify that the header line
must *start* with a specific regexp, but this was easier to implement.
Note that the current implementation will convert the split expression
("subject" "patch" SPLIT) to the regexp
""^\\(\\(subject\\):.*\\)\\<\\(patch\\)\\>". This will match any
subject, which includes the word 'patch'. I want to word to be the
first word of the subject.
/tonny
Patch:
--- nnmail.el~ Sun Jul 20 22:34:48 1997
+++ nnmail.el Wed Oct 22 10:18:19 1997
@@ -354,6 +354,9 @@
\(& SPLIT...): Process each SPLIT expression.
+\(/ REGEXP SPLIT): If the message matches REGEXP, store the messages
+ as specified by SPLIT.
+
\(: FUNCTION optional args): Call FUNCTION with the optional args, in
the buffer containing the message headers. The return value FUNCTION
should be a split, which is then recursively processed.
@@ -1210,6 +1213,13 @@
;; Builtin : operation.
((eq (car split) ':)
(nnmail-split-it (eval (cdr split))))
+
+ ;; Builtin / operation.
+ ((eq (car split) '/)
+ (goto-char (point-max))
+ ;; Same problems as specified for the next condition.
+ (when (re-search-backward (nth 1 split) nil t)
+ (nnmail-split-it (nth 2 split))))
;; Check the cache for the regexp for this split.
;; FIX FIX FIX could avoid calling assq twice here
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Adding new nnmail-split-fancy construct
1997-10-22 8:35 Adding new nnmail-split-fancy construct Tonny Madsen
@ 1997-10-24 23:36 ` Lars Magne Ingebrigtsen
1997-10-27 8:42 ` Tonny Madsen
0 siblings, 1 reply; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-10-24 23:36 UTC (permalink / raw)
Tonny Madsen <tma@nettest.dk> writes:
> I occasionally need to split messages, by searching them directly for
> a regular expression. In most cases, though, it is simply to single
> out all messages, where the the subject line starting with a specific
> word.
>
> This cannot be done with the current nnmail-split-fancy variable and
> function. To deal with this I have added a catch-all split expression,
> (/ REGEXP SPLIT), that will use SPLIT if REGEXP matches the message.
I think you should use the `:' thing instead -- it allows you to
specify an arbitrary function to be run.
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Adding new nnmail-split-fancy construct
1997-10-24 23:36 ` Lars Magne Ingebrigtsen
@ 1997-10-27 8:42 ` Tonny Madsen
0 siblings, 0 replies; 3+ messages in thread
From: Tonny Madsen @ 1997-10-27 8:42 UTC (permalink / raw)
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Tonny Madsen <tma@nettest.dk> writes:
>
> > I occasionally need to split messages, by searching them directly for
> > a regular expression. In most cases, though, it is simply to single
> > out all messages, where the the subject line starting with a specific
> > word.
> >
> > This cannot be done with the current nnmail-split-fancy variable and
> > function. To deal with this I have added a catch-all split expression,
> > (/ REGEXP SPLIT), that will use SPLIT if REGEXP matches the message.
>
> I think you should use the `:' thing instead -- it allows you to
> specify an arbitrary function to be run.
True, but I would have prefered to keep all the different search
patterns in nnmail-split-fancy and not to make a number of
aux. functions...
Anyway, I find it currious, that I should be the first to request
this...
/tonny
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1997-10-27 8:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-22 8:35 Adding new nnmail-split-fancy construct Tonny Madsen
1997-10-24 23:36 ` Lars Magne Ingebrigtsen
1997-10-27 8:42 ` Tonny Madsen
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).