all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marcin Wlodarczak <mwlodarczak@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Setting gnus-message-archive-group in message-send-hook
Date: Sat, 17 Sep 2011 13:41:28 +0200	[thread overview]
Message-ID: <87sjnvtmzb.fsf@debian.i-did-not-set--mail-host-address--so-tickle-me> (raw)


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



             reply	other threads:[~2011-09-17 11:41 UTC|newest]

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

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=87sjnvtmzb.fsf@debian.i-did-not-set--mail-host-address--so-tickle-me \
    --to=mwlodarczak@gmail.com \
    --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.