From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Wlodarczak Newsgroups: gmane.emacs.help Subject: Setting gnus-message-archive-group in message-send-hook Date: Sat, 17 Sep 2011 13:41:28 +0200 Message-ID: <87sjnvtmzb.fsf@debian.i-did-not-set--mail-host-address--so-tickle-me> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1316302954 13530 80.91.229.12 (17 Sep 2011 23:42:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 17 Sep 2011 23:42:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 18 01:42:31 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R54Wk-0002S2-QS for geh-help-gnu-emacs@m.gmane.org; Sun, 18 Sep 2011 01:42:30 +0200 Original-Received: from localhost ([::1]:50482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R54Wk-0003f9-8I for geh-help-gnu-emacs@m.gmane.org; Sat, 17 Sep 2011 19:42:30 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:55030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4tGp-0008K6-SF for help-gnu-emacs@gnu.org; Sat, 17 Sep 2011 07:41:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4tGp-0006qq-0A for help-gnu-emacs@gnu.org; Sat, 17 Sep 2011 07:41:19 -0400 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:32874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4tGo-0006qk-PU for help-gnu-emacs@gnu.org; Sat, 17 Sep 2011 07:41:18 -0400 Original-Received: by bkbzs2 with SMTP id zs2so4668122bkb.0 for ; Sat, 17 Sep 2011 04:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; bh=ww9CPyjymByiETmfJVzkYjBh/PoGFzoj0rvHb6nL9uk=; b=b7P+cu8QUVJbawro3j0N/boEKhRWD7hv6uIl8rT6HjbmSFtJyss31w2MvWMdHkBID3 l33By5NflHMCjFrbsMcjdu4PZnRQMRDuTS8JL6OhOblTM0WUo1xEse/29Qb9SiNaTBon MQdxx/Giek5tnVK0GpyKTjxLPwBKXId1ArRsE= Original-Received: by 10.204.128.136 with SMTP id k8mr317186bks.9.1316259677691; Sat, 17 Sep 2011 04:41:17 -0700 (PDT) Original-Received: from localhost (blfd-d9bf037a.pool.mediaWays.net. [217.191.3.122]) by mx.google.com with ESMTPS id p8sm8716829bkk.3.2011.09.17.04.41.16 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Sep 2011 04:41:17 -0700 (PDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.41 X-Mailman-Approved-At: Sat, 17 Sep 2011 19:42:20 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82257 Archived-At: 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