Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / c4 / 8f4e6ede10dba029186e04b464b17a78617ba1
1 Return-Path: <rlb@defaultvalue.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id B2C5840BFD5\r
6         for <notmuch@notmuchmail.org>; Sun, 26 Sep 2010 19:22:59 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id K9yPiVSEKPvb for <notmuch@notmuchmail.org>;\r
16         Sun, 26 Sep 2010 19:22:49 -0700 (PDT)\r
17 Received: from defaultvalue.org (li12-156.members.linode.com [70.85.129.156])\r
18         by olra.theworths.org (Postfix) with ESMTP id 1464C40BDA8\r
19         for <notmuch@notmuchmail.org>; Sun, 26 Sep 2010 19:22:49 -0700 (PDT)\r
20 Received: from trouble.defaultvalue.org (localhost [127.0.0.1])\r
21         (Authenticated sender: rlb@defaultvalue.org)\r
22         by defaultvalue.org (Postfix) with ESMTPSA id AA8D790D34\r
23         for <notmuch@notmuchmail.org>; Sun, 26 Sep 2010 21:22:48 -0500 (CDT)\r
24 Received: by trouble.defaultvalue.org (Postfix, from userid 1000)\r
25         id 52DB414E09D; Sun, 26 Sep 2010 21:22:48 -0500 (CDT)\r
26 From: Rob Browning <rlb@defaultvalue.org>\r
27 To: notmuch@notmuchmail.org\r
28 Subject: Re: Would a more sophisticated notmuch-fcc-dirs be acceptable?\r
29 References: <87k4m80xgg.fsf@raven.defaultvalue.org>\r
30 Date: Sun, 26 Sep 2010 21:22:48 -0500\r
31 In-Reply-To: <87k4m80xgg.fsf@raven.defaultvalue.org> (Rob Browning's message\r
32         of "Sun, 26 Sep 2010 20:47:11 -0500")\r
33 Message-ID: <8739swlybr.fsf@trouble.defaultvalue.org>\r
34 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)\r
35 MIME-Version: 1.0\r
36 Content-Type: text/plain; charset=us-ascii\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Mon, 27 Sep 2010 02:22:59 -0000\r
50 \r
51 Rob Browning <rlb@defaultvalue.org> writes:\r
52 \r
53 > I'd also like to fcc to a directory outside of message-directory\r
54 \r
55 At least for this part, one possiblity would be to just use the chosen\r
56 directory literally (don't prepend message-directory) whenever it's an\r
57 absolute path according to file-name-absolute-p.\r
58 \r
59 For example:\r
60 \r
61 diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el\r
62 index 32e7d0d..3c5d6c4 100644\r
63 --- a/emacs/notmuch-maildir-fcc.el\r
64 +++ b/emacs/notmuch-maildir-fcc.el\r
65 @@ -87,11 +87,13 @@\r
66           ;; if we found no hit, use the first entry as default fallback\r
67           (unless subdir (setq subdir (car (car notmuch-fcc-dirs)))))\r
68  \r
69 -  ;; if there is no fcc header yet, add ours\r
70 -  (unless (message-fetch-field "fcc")\r
71 -    (message-add-header (concat "Fcc: "\r
72 -                                (file-name-as-directory message-directory)\r
73 -                                subdir)))\r
74 +      ;; if there is no fcc header yet, add ours\r
75 +      (unless (message-fetch-field "fcc")\r
76 +        (let ((path (if (file-name-absolute-p subdir)\r
77 +                        subdir\r
78 +                      (concat (file-name-as-directory message-directory)\r
79 +                              subdir))))\r
80 +          (message-add-header (concat "Fcc: " path))))\r
81  \r
82    ;; finally test if fcc points to a valid maildir\r
83    (let ((fcc-header (message-fetch-field "fcc")))\r
84 \r
85 \r
86 If this seems reasonable, I'd be happy to work up a formal patch.\r
87 \r
88 Thanks\r
89 -- \r
90 Rob Browning\r
91 rlb @defaultvalue.org and @debian.org\r
92 GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4\r