all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim Landscheidt <tim@tim-landscheidt.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Setting gnus-message-archive-group in message-send-hook
Date: Mon, 19 Sep 2011 03:41:52 +0000	[thread overview]
Message-ID: <m362kpp5a7.fsf@passepartout.tim-landscheidt.de> (raw)
In-Reply-To: 87sjnvtmzb.fsf@debian.i-did-not-set--mail-host-address--so-tickle-me

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	other threads:[~2011-09-19  3:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-17 11:41 Setting gnus-message-archive-group in message-send-hook Marcin Wlodarczak
2011-09-19  3:41 ` Tim Landscheidt [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m362kpp5a7.fsf@passepartout.tim-landscheidt.de \
    --to=tim@tim-landscheidt.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.