* message-reply-to-function bug?
@ 2000-05-19 15:11 Dmitry Yaitskov
2000-05-19 15:39 ` Shenghuo ZHU
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Yaitskov @ 2000-05-19 15:11 UTC (permalink / raw)
Hi,
Info for message-reply-to-function says that it can return either a
string which will be used as the To header, or a list of header-value
pairs.
I tried to use From instead of Reply-to for certain addresses, like
this:
(setq message-reply-to-function
(lambda ()
(cond ((equal (mail-fetch-field "reply-to") "qq@aa.com")
(mail-fetch-field "from"))
(t
nil))))
In gnus 5.8.7, this generates an error:
Signaling: (wrong-type-argument listp ?D)
message-setup(((Subject . "Re: printing") ?J ?o ?h ?n ?\ ?D ?o ?e ?\ ?< ?d ?o ?e ?@ ?a ?a ?\. ?c ?o ?m ?> (References . "<39254725.4CB646D3@aa.com>")) #<buffer " *gnus article copy*">)
message-reply(nil nil)
gnus-summary-reply((2498) nil)
gnus-summary-reply-with-original(nil)
call-interactively(gnus-summary-reply-with-original)
Which looks like a bug, at least in the docs. The following version
works though:
(setq message-reply-to-function
(lambda ()
(cond ((equal (mail-fetch-field "reply-to") "qq@aa.com")
(list (cons 'To (mail-fetch-field "from"))))
(t
nil))))
--
Cheers,
-Dima.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: message-reply-to-function bug?
2000-05-19 15:11 message-reply-to-function bug? Dmitry Yaitskov
@ 2000-05-19 15:39 ` Shenghuo ZHU
2000-05-19 19:07 ` Dmitry Yaitskov
0 siblings, 1 reply; 4+ messages in thread
From: Shenghuo ZHU @ 2000-05-19 15:39 UTC (permalink / raw)
>>>>> "Dmitry" == Dmitry Yaitskov <dimas@home.com> 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
<doe@aa.com>") (From . "John Doe <john@bb.com>")), instead of a
string.
[...]
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.
--
Shenghuo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: message-reply-to-function bug?
2000-05-19 15:39 ` Shenghuo ZHU
@ 2000-05-19 19:07 ` Dmitry Yaitskov
2000-05-19 19:21 ` Shenghuo ZHU
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Yaitskov @ 2000-05-19 19:07 UTC (permalink / raw)
Shenghuo ZHU <zsh@cs.rochester.edu> wrote:
> >>>>> "Dmitry" == Dmitry Yaitskov <dimas@home.com> 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
> <doe@aa.com>") (From . "John Doe <john@bb.com>")), 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: message-reply-to-function bug?
2000-05-19 19:07 ` Dmitry Yaitskov
@ 2000-05-19 19:21 ` Shenghuo ZHU
0 siblings, 0 replies; 4+ messages in thread
From: Shenghuo ZHU @ 2000-05-19 19:21 UTC (permalink / raw)
>>>>> "Dmitry" == Dmitry Yaitskov <dimas@home.com> writes:
Dmitry> Note the phrase "As you can see, this function should return a string
Dmitry> if it has an opinion as to what the To header should be." Where does
Dmitry> it say anything about a list?
Dmitry> (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.
Oops, I thought it is in gnus.texi. OK, now it is fixed.
Shenghuo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-05-19 19:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-19 15:11 message-reply-to-function bug? Dmitry Yaitskov
2000-05-19 15:39 ` Shenghuo ZHU
2000-05-19 19:07 ` Dmitry Yaitskov
2000-05-19 19:21 ` Shenghuo ZHU
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).