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 B2C5840BFD5 for ; Sun, 26 Sep 2010 19:22:59 -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 K9yPiVSEKPvb for ; Sun, 26 Sep 2010 19:22:49 -0700 (PDT) Received: from defaultvalue.org (li12-156.members.linode.com [70.85.129.156]) by olra.theworths.org (Postfix) with ESMTP id 1464C40BDA8 for ; Sun, 26 Sep 2010 19:22:49 -0700 (PDT) Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id AA8D790D34 for ; Sun, 26 Sep 2010 21:22:48 -0500 (CDT) Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 52DB414E09D; Sun, 26 Sep 2010 21:22:48 -0500 (CDT) From: Rob Browning To: notmuch@notmuchmail.org Subject: Re: Would a more sophisticated notmuch-fcc-dirs be acceptable? References: <87k4m80xgg.fsf@raven.defaultvalue.org> Date: Sun, 26 Sep 2010 21:22:48 -0500 In-Reply-To: <87k4m80xgg.fsf@raven.defaultvalue.org> (Rob Browning's message of "Sun, 26 Sep 2010 20:47:11 -0500") Message-ID: <8739swlybr.fsf@trouble.defaultvalue.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) 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: Mon, 27 Sep 2010 02:22:59 -0000 Rob Browning writes: > I'd also like to fcc to a directory outside of message-directory At least for this part, one possiblity would be to just use the chosen directory literally (don't prepend message-directory) whenever it's an absolute path according to file-name-absolute-p. For example: diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el index 32e7d0d..3c5d6c4 100644 --- a/emacs/notmuch-maildir-fcc.el +++ b/emacs/notmuch-maildir-fcc.el @@ -87,11 +87,13 @@ ;; if we found no hit, use the first entry as default fallback (unless subdir (setq subdir (car (car notmuch-fcc-dirs))))) - ;; if there is no fcc header yet, add ours - (unless (message-fetch-field "fcc") - (message-add-header (concat "Fcc: " - (file-name-as-directory message-directory) - subdir))) + ;; if there is no fcc header yet, add ours + (unless (message-fetch-field "fcc") + (let ((path (if (file-name-absolute-p subdir) + subdir + (concat (file-name-as-directory message-directory) + subdir)))) + (message-add-header (concat "Fcc: " path)))) ;; finally test if fcc points to a valid maildir (let ((fcc-header (message-fetch-field "fcc"))) If this seems reasonable, I'd be happy to work up a formal patch. Thanks -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4