From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/39491 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.emacs.gnus.general Subject: Re: Generating Mail-Followup-To: headers Date: Fri, 19 Oct 2001 16:16:12 -0400 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: owner-ding@hpc.uh.edu Message-ID: References: <87y9m9fs6b.fsf@squeaker.lickey.com> <87elo1exsd.fsf@squeaker.lickey.com> <87u1wvkaiv.fsf@mclinux.com> <87zo6nftt7.fsf@mclinux.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035175191 28242 80.91.224.250 (21 Oct 2002 04:39:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:39:51 +0000 (UTC) Return-Path: Original-Received: (qmail 12027 invoked from network); 19 Oct 2001 20:16:55 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 19 Oct 2001 20:16:55 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 15ug4F-00029b-00; Fri, 19 Oct 2001 15:16:31 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 19 Oct 2001 15:16:07 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id PAA15777 for ; Fri, 19 Oct 2001 15:15:55 -0500 (CDT) Original-Received: (qmail 12005 invoked by alias); 19 Oct 2001 20:16:13 -0000 Original-Received: (qmail 12000 invoked from network); 19 Oct 2001 20:16:13 -0000 Original-Received: from multivac.student.cwru.edu (HELO multivac.cwru.edu) (qmail-remote@129.22.96.25) by gnus.org with SMTP; 19 Oct 2001 20:16:13 -0000 Original-Received: (qmail 22899 invoked by uid 500); 19 Oct 2001 20:16:34 -0000 Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Mail-Copies-To: never In-Reply-To: <87zo6nftt7.fsf@mclinux.com> (Josh Huber's message of "Fri, 19 Oct 2001 13:01:08 -0400") Original-Lines: 50 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:39491 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:39491 Josh Huber wrote: > + ;; Generate the Mail-Followup-To header... > + ;; only if the header doesn't exist. > + (when (and (or message-mft-regexps message-mft-address-functions) > + (not (message-fetch-field "mail-followup-to"))) > + (let ((Mail-Followup-To (message-make-mft))) > + (message-generate-headers '((optional . Mail-Followup-To))))) That will use the symbol 'Mail-Followup-To, not its variable value. We want this: (message-generate-headers `((optional . ,Mail-Followup-To))))) Or this: (message-generate-headers (list (cons 'optional Mail-Followup-To))))) We should also check that this is a mail message, not news. > + ;; otherwise, delete the MFT header if the value is "off" > + (and (string= "off" (message-fetch-field "mail-followup-to")) > + (message-remove-header "Mail-Followup-To")) I'd use equal, not string=, or else restructure the logic so that when we reach this point, we already know that there is an MFT field. It happens that string= will interpret the value nil as the string "nil", and so this will still work as-is, but relying on that just scares me. > +(defun message-make-mft () > + "Return the Mail-Followup-To header." > + (let ((recipients (message-options-get 'message-recipients)) > + (mft-regexps (apply 'append message-mft-regexps > + (mapcar '(lambda (func) (funcall func)) > + message-mft-address-functions)))) > + (and (eval `(or ,@(mapcar '(lambda (regexp) > + (and regexp (string-match regexp recipients))) > + mft-regexps))) > + recipients))) Rather than match all regexps against the recipients, and then look for a non-nil result, we could iterate through the regexp list and stop as soon as we find a match. It'd also be better to match each regexp against each recipient address individually, using only the address itself and not the name part, instead of against the whole recipient string. > Who's going to write gnus-subscribed-addresses now? :) I volunteer to intend to do it until someone actually does it. (Hey, it worked once.) paul