Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 06CD84196F3 for ; Fri, 23 Apr 2010 00:13:12 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 96MEpOHT9h4O for ; Fri, 23 Apr 2010 00:13:11 -0700 (PDT) Received: from homiemail-a20.g.dreamhost.com (caiajhbdccah.dreamhost.com [208.97.132.207]) by olra.theworths.org (Postfix) with ESMTP id 2678D4196F2 for ; Fri, 23 Apr 2010 00:13:11 -0700 (PDT) Received: from sspaeth.de (mtec-hg-docking-1-dhcp-204.ethz.ch [129.132.133.204]) (Authenticated sender: sebastian@sspaeth.de) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPA id D5B757EC065; Fri, 23 Apr 2010 00:13:08 -0700 (PDT) Received: by sspaeth.de (sSMTP sendmail emulation); Fri, 23 Apr 2010 09:13:06 +0200 From: "Sebastian Spaeth" To: Dirk Hohndel , notmuch@notmuchmail.org Subject: Re: [notmuch] Fcc, Maildir, and Emacs message-mode -- a bit of code In-Reply-To: References: <873a1zs3t5.fsf@jhu.edu> <87ochbx3er.fsf@SSpaeth.de> Date: Fri, 23 Apr 2010 09:13:06 +0200 Message-ID: <87bpdaljzx.fsf@SSpaeth.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2010 07:13:12 -0000 On 2010-04-22, Dirk Hohndel wrote: > ;; This is the list of alternatives that should be configurable as > ;; defcustom (or simply set in .emacs for now) > (setq notmuch-fcc-dirs '( > ("Dirk Hohndel " . "Maildir/Sent Items") > ("Dirk Hohndel " . "MaildirInfradead/Sent"))) > > ;This constructs a path, concatenating the content of the variable > ;"message-directory" and the second part in the alist: > (defun my-fcc-header-setup () > (let ((subdir (cdr (assoc (message-fetch-field "from") notmuch-fcc-dirs)))) > (message-add-header (concat "Fcc: " message-directory subdir)))) > (add-hook 'message-send-hook 'my-fcc-header-setup) > The disadvantage is that with the message-send-hook I don't get to see / > correct the FCC line in the message buffer - but since I trust the logic > here (and tested it quite a bit), I'm less concerned about this. Another disadvantage is that this does not provide a fallback, so if you type "dirk" rather than "Dirk" in your from, the fcc dir will be nil, so it tries to deliver just to "message-directory". The user should be able to configure a default FCC dir, I think. Sebastian