Gnus development mailing list
 help / color / mirror / Atom feed
* message-reply-to-function and custom headers
@ 1999-02-03  2:32 Sami Khoury
  1999-02-03 15:03 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Sami Khoury @ 1999-02-03  2:32 UTC (permalink / raw)


I added to my gnus setup a custom header field which contains a message
classification (i.e. confidential, for internal use only, private...)
when I reply to a mail message, I would like the new buffer to be
initialized with the same classification header as the original
message.

I did set it as follow using message-reply-to-function
(setq message-reply-to-function
      (lambda ()
	(let ((class (or (message-fetch-field "classification") "Unclassified")))
	  (list (cons 'classification class)))))

but when I use this function, the "to" field in my message doesn't get
filled. I looked at the source and it seems that if
message-reply-to-function returns anything but nil, the block in charge of
filling the "to" part of the message is skipped (line 3442 of message.el)

I also tried to use message-header-setup-hook but that doesn't seem to
work since the hook gets run in message-setup and by then, the headers
of the original message are not available anymore.

Any idea how I can fill a custom header field without having to
worry about the rest of the message headers ?

I am using pgnus 0.73, emacs 20.3.
Any help or suggestions will be appreciated

Sami Khoury
sgkhour@omnisig.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: message-reply-to-function and custom headers
  1999-02-03  2:32 message-reply-to-function and custom headers Sami Khoury
@ 1999-02-03 15:03 ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-02-03 15:03 UTC (permalink / raw)


"Sami Khoury" <skhoury@omnisig.com> writes:

> but when I use this function, the "to" field in my message doesn't get
> filled. I looked at the source and it seems that if
> message-reply-to-function returns anything but nil, the block in charge of
> filling the "to" part of the message is skipped (line 3442 of message.el)

Yes.  Your function will have to return the To part as well.

> Any idea how I can fill a custom header field without having to
> worry about the rest of the message headers ?

The trick is to go to the `message-reply-buffer', which contains the
message that's being replied to, before snarfing any headers.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-02-03 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-03  2:32 message-reply-to-function and custom headers Sami Khoury
1999-02-03 15:03 ` Lars Magne Ingebrigtsen

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).