Re: [PATCH v2 14/20] nmbug-status: Encode output using the user's locale
[notmuch-archives.git] / a3 / fd493b88dcb299a7d1f4975d8ee4f66f4f83ed
1 Return-Path: <prvs=jrosenthal=72618203d@jhu.edu>\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 1B8404196F2\r
6         for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 17:29:31 -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: -4.2\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] 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 KnPoNCZ-08Kc for <notmuch@notmuchmail.org>;\r
16         Mon, 26 Apr 2010 17:29:30 -0700 (PDT)\r
17 Received: from ipex4.johnshopkins.edu (ipex4.johnshopkins.edu\r
18         [128.220.161.141])\r
19         by olra.theworths.org (Postfix) with ESMTP id E67C64196F0\r
20         for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 17:29:29 -0700 (PDT)\r
21 X-IronPort-AV: E=Sophos;i="4.52,276,1270440000"; d="scan'208";a="359669145"\r
22 Received: from c-69-255-36-229.hsd1.md.comcast.net (HELO lucky)\r
23         ([69.255.36.229])\r
24         by ipex4.johnshopkins.edu with ESMTP/TLS/AES256-SHA;\r
25         26 Apr 2010 20:29:28 -0400\r
26 Received: from jkr by lucky with local (Exim 4.69)\r
27         (envelope-from <jrosenthal@jhu.edu>)\r
28         id 1O6Yg3-0007sj-Ja; Mon, 26 Apr 2010 20:29:27 -0400\r
29 From: Jesse Rosenthal <jrosenthal@jhu.edu>\r
30 To: Sebastian Spaeth <Sebastian@SSpaeth.de>,\r
31         Notmuch developer list <notmuch@notmuchmail.org>\r
32 Subject: [PATCH] emacs: fcc should fail at the right time if it doesn't point\r
33         to a maildir\r
34 In-Reply-To: <1272270198-28357-4-git-send-email-Sebastian@SSpaeth.de>\r
35 References: <m3bpd8tpjk.fsf@x200.gr8dns.org>\r
36         <1272270198-28357-4-git-send-email-Sebastian@SSpaeth.de>\r
37 User-Agent: Notmuch/0.2-151-gec6d78a (http://notmuchmail.org) Emacs/23.1.1\r
38         (i486-pc-linux-gnu)\r
39 Date: Mon, 26 Apr 2010 20:29:27 -0400\r
40 Message-ID: <87mxwpd9g8.fsf@jhu.edu>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain; charset=us-ascii\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Tue, 27 Apr 2010 00:29:31 -0000\r
56 \r
57 Throw an error after the maildir is generated but before the message\r
58 is sent. This change allows the user to edit the maildir if it fails,\r
59 so that it will point to a correct place.\r
60 \r
61 Note that this changes the previous behavior which always overwrote\r
62 the existing Fcc line. Now, an Fcc line is only auto-generated if\r
63 there isn't one already there.\r
64 \r
65 The ideal change would be to prompt to create a maildir. This should\r
66 enable a place for doing that in a future patch.\r
67 ---\r
68  emacs/notmuch-maildir-fcc.el |    7 +++++--\r
69  1 files changed, 5 insertions(+), 2 deletions(-)\r
70 \r
71 diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el\r
72 index 64f60bc..34b1915 100644\r
73 --- a/emacs/notmuch-maildir-fcc.el\r
74 +++ b/emacs/notmuch-maildir-fcc.el\r
75 @@ -70,8 +70,11 @@\r
76     (let ((subdir\r
77            (cdr (assoc-string (message-fetch-field "from") notmuch-fcc-dirs t))))\r
78       (if (eq subdir nil) (setq subdir (car (car notmuch-fcc-dirs))))\r
79 -     (message-remove-header "Fcc")\r
80 -     (message-add-header (concat "Fcc: " message-directory subdir)))))\r
81 +     (unless (message-fetch-field "fcc")\r
82 +       (message-add-header (concat "Fcc: " message-directory subdir)))\r
83 +     (unless (notmuch-maildir-fcc-dir-is-maildir-p \r
84 +             (message-fetch-field "fcc"))\r
85 +       (error (format "%s is not a maildir." (message-fetch-field "fcc")))))))\r
86  \r
87  (defun notmuch-maildir-fcc-host-fixer (hostname)\r
88    (replace-regexp-in-string "/\\|:"\r
89 -- \r
90 1.6.3.3\r
91 \r