prj@po.cwru.edu (Paul Jarc) writes: > How about this: > (let* ((recipients '(("foo@bar" . "Name ") > ("baz@quux" . "None "))) > (plain-addrs (mapcar 'car recipients)) > (gnus-hierarchical-lists '(("baz@quux" "foo@bar"))) > sublists recip) > (while plain-addrs > (setq sublists (assoc (car plain-addrs) gnus-hierarchical-lists) > plain-addrs (cdr plain-addrs)) > (when sublists > (setq sublists (cdr sublists)) > (while sublists > (setq recip (assoc (car sublists) recipients) > sublists (cdr sublists)) > (if recip > (setq recipients (delq recip recipients))))))) > > Note that this is a different structure for gnus-hierarchical-lists. > An entry (A B C) means that A contains B and C. (No further > relationship between B and C is implied.) So if A appears in the > recipient list, then B and C will be removed from it, if present. If > B and C have sublists of their own, they should get their own > top-level entries in gnus-hierarchical-lists. In this case, > gnus-hierarchical-lists says that messages to baz@quux also go to > foo@bar, so foo@bar is removed from the recipient list. That looks fine to me. Kai, sorry for not following up to your very helpful message. I was unable to send e-mail to the ding list for a while due to server problems. I think Paul's suggestion is even better to make the user's life simple, using a list instead of a cons cell. I tried to put a patch into message.el, naming the variables accordingly and simplifying things a bit. I'm not sure if the variable should go into the message-headers or the message-sending group; also, I'm not sure if I defined the variable correctly with defcustom (I tried the '(repeat sexp) type but that didn't work). I think the functional definition, at least, is correct (because Paul wrote it :) I did a diff -u, renaming the original message.el to message-original.el because I don't have access to the CVS repository (firewall issues, don't ask) to do a diff against it. This is my first time submitting a patch, please let me know if I did anything wrong. It's also my first time writing more than 4 lines of Lisp for a single purpose. To test, define message-hierarchical-lists to be ("foo" "bar") and then have "foo" and "bar" in your recipient list. "bar" should be removed. I couldn't test - message-get-reply-headers was not invoked, according to debug-on-entry. I'm kind of puzzled by this. I must be doing something wrong. Also, the message-hierarchical-lists should probably be generalized to regular expressions for both the primary and secondary lists (message-hierarchical-lists-regexps?). I don't need this personally, but perhaps someone else will find it useful. Maybe when the string exact matching is working. Thanks Ted