From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/31098 Path: main.gmane.org!not-for-mail From: Dmitry Yaitskov Newsgroups: gmane.emacs.gnus.general Subject: Re: message-reply-to-function bug? Date: 19 May 2000 15:07:07 -0400 Organization: Just me at home Sender: owner-ding@hpc.uh.edu Message-ID: <87u2ful5pg.fsf@lucy.mtth1.on.wave.home.com> References: <87g0reo9qb.fsf@lucy.mtth1.on.wave.home.com> <5bvh0aczwh.fsf@giga.cs.rochester.edu> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035167545 12105 80.91.224.250 (21 Oct 2002 02:32:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:32:25 +0000 (UTC) Return-Path: Original-Received: from bart.math.uh.edu (bart.math.uh.edu [129.7.128.48]) by mailhost.sclp.com (Postfix) with ESMTP id 56295D051E for ; Fri, 19 May 2000 15:07:57 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by bart.math.uh.edu (8.9.1/8.9.1) with ESMTP id OAB12531; Fri, 19 May 2000 14:07:35 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 19 May 2000 14:07:00 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id OAA07254 for ; Fri, 19 May 2000 14:06:50 -0500 (CDT) Original-Received: from mail.rdc2.on.home.com (ha1.rdc2.on.home.com [24.9.0.15]) by mailhost.sclp.com (Postfix) with ESMTP id 89D73D051E for ; Fri, 19 May 2000 15:07:09 -0400 (EDT) Original-Received: from lucy.mtth1.on.wave.home.com ([24.65.46.137]) by mail.rdc2.on.home.com (InterMail vM.4.01.02.17 201-229-119) with SMTP id <20000519190707.BDME20554.mail.rdc2.on.home.com@lucy.mtth1.on.wave.home.com> for ; Fri, 19 May 2000 12:07:07 -0700 Original-To: Ding In-Reply-To: Shenghuo ZHU's message of "19 May 2000 11:39:42 -0400" User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.2 (Melpomene) Original-Lines: 80 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:31098 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:31098 Shenghuo ZHU wrote: > >>>>> "Dmitry" == Dmitry Yaitskov writes: > > Dmitry> Hi, > > Dmitry> Info for message-reply-to-function says that it can return > Dmitry> either a string which will be used as the To header, or a list > Dmitry> of header-value pairs. > > Info? Does Info tell message-reply-to-function? > > The docs say, "function that should return a list of headers.", which > means the return value looks like ((Reply-To . "John Doe > ") (From . "John Doe ")), instead of a > string. Here's the info entry: ------------------- cut here ------------------- File: message, Node: Reply, Next: Wide Reply, Prev: New News Message, Up: Interface Reply ===== The `message-reply' function pops up a message buffer that's a reply to the message in the current buffer. Message uses the normal methods to determine where replies are to go (*note Responses::.), but you can change the behavior to suit your needs by fiddling with the `message-reply-to-function' variable. If you want the replies to go to the `Sender' instead of the `From', you could do something like this: (setq message-reply-to-function (lambda () (cond ((equal (mail-fetch-field "from") "somebody") (mail-fetch-field "sender")) (t nil)))) This function will be called narrowed to the head of the article that is being replied to. As you can see, this function should return a string if it has an opinion as to what the To header should be. If it does not, it should just return `nil', and the normal methods for determining the To header will be used. This function can also return a list. In that case, each list element should be a cons, where the car should be the name of an header (eg. `Cc') and the cdr should be the header value (eg. `larsi@ifi.uio.no'). All these headers will be inserted into the head of the outgoing mail. ------------------- cut here ------------------- Note the phrase "As you can see, this function should return a string if it has an opinion as to what the To header should be." Where does it say anything about a list? (Perhaps my info entry is outdated... is it?) > [...] > > Dmitry> Which looks like a bug, at least in the docs. The following version > Dmitry> works though: > > Dmitry> (setq message-reply-to-function > Dmitry> (lambda () > Dmitry> (cond ((equal (mail-fetch-field "reply-to") "qq@aa.com") > Dmitry> (list (cons 'To (mail-fetch-field "from")))) > Dmitry> (t > Dmitry> nil)))) > > This function returns a list of headers. -- Cheers, -Dima.