help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting gnus-message-archive-group in message-send-hook


From: Tim Landscheidt
Subject: Re: Setting gnus-message-archive-group in message-send-hook
Date: Mon, 19 Sep 2011 03:41:52 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Marcin Wlodarczak <mwlodarczak@gmail.com> wrote:

> 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?

Either change the Gcc: header in your hook, or - probably
preferable - see if the fine manual for
gnus-message-archive-group can be applied in your case:

| If you want to save your mail in one group and the news articles you
| write in another group, you could say something like:

|  (setq gnus-message-archive-group
|       '((if (message-news-p)
|             "misc-news"
|           "misc-mail")))

Tim




reply via email to

[Prev in Thread] Current Thread [Next in Thread]