rlk@mit-clio (08/13/85)
From: rlk@mit-clio Date: Mon, 12 Aug 85 16:57:22 edt From: rlk@mit-clio To: consultants@mit-clio, mly@prep Cc: rlk@mit-clio Subject: filters in rmail I'm trying to write a filter mechanism in rmail to do general useful things. What I want is the following: 1) Predicate -- a filter should be usable as a predicate for message selection purposes. It should take a message number as an argument as well as any other arguments it wants (perhaps by reading them from the tty). It should probably be able to ask for its own arguments. 2) Automatic filter application -- apply a filter to an entire buffer. Messages that pass (or, of course, don't pass) the filter can be passed to an action, which can do as it chooses. Again, the action should be able to prompt for additional args. Problems: 1) User interface. That isn't important to hardcore lisp hackers, but it is important to random Athena-ites. 2) How does a filter predicate know not to prompt for an argument more than once? It would be pretty worthless for it to prompt each time it was invoked, as that would defeat the automatic aspect. 3) Same problem for the action. I suppose one way would be to make a predicate or an action take three arguments plus whatever else they wanted; i. e. (defun foo-predicate (msg firstp lastp &rest foo-args...)...) This would of course require that the predicate be called on all the messages and a list of messages be saved, and these could then be given to the action. Or else for each predicate a predicate-first-hook and predicate-last-hook sort of thing could be hacked, as well as same for an action, which wouldn't be hard to program but which would be a pain for someone to write functions for. Of course, I'd also have to write a filter library sort of thing. Presumably a special form or macro deffilter would exist, which would intern filter names in an obarray for whatever purposes (completion, computation of function name, etc.) was necessary. Robert^Z