unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Setting gnus-message-archive-group in message-send-hook
@ 2011-09-17 11:41 Marcin Wlodarczak
  2011-09-19  3:41 ` Tim Landscheidt
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Wlodarczak @ 2011-09-17 11:41 UTC (permalink / raw)
  To: help-gnu-emacs


Hi,

I'm trying to set gnus-message-archive-group depending on the From:
address, using the message-send-hook. Here is what I've got so
far:

(add-hook 'message-send-hook 'my-select-archive-group)
(defun my-select-archive-group ()
  (let ((from-address (mail-fetch-field "from")))
    (cond ((search "uni" from-address)
           (setq gnus-message-archive-group "nnimap+uni:Sent"))
	  ((search "gmail" from-address)
           (setq gnus-message-archive-group "nnimap+gmail:[Google Mail]/Sent Mail")))))

The problem is, however, that this only sets the Gcc line for the
*following message* not the one being sent. What am I doing wrong
here?

Best,
Marcin



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

end of thread, other threads:[~2011-09-23 22:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-17 11:41 Setting gnus-message-archive-group in message-send-hook Marcin Wlodarczak
2011-09-19  3:41 ` Tim Landscheidt
2011-09-19  8:33   ` Marcin Wlodarczak
2011-09-20 22:53     ` Tim Landscheidt
2011-09-21  9:05       ` Marcin Wlodarczak
2011-09-23 16:15         ` Tim Landscheidt
2011-09-23 22:26           ` Marcin Wlodarczak

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 read-only IMAP folder(s) and NNTP newsgroup(s).