Re: Error with contrib/notmuch-pick
[notmuch-archives.git] / e0 / 060cb94ab224ab7501647fdcdc5ce48f420d92
1 Return-Path: <awg@lagos.xvx.ca>\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 66201418C24\r
6         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 14:53:56 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled\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 HFJd5NkMorxx for <notmuch@notmuchmail.org>;\r
16         Tue, 17 Jan 2012 14:53:55 -0800 (PST)\r
17 Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9])\r
18         by olra.theworths.org (Postfix) with ESMTP id C7B4F41ED9E\r
19         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 14:53:54 -0800 (PST)\r
20 Received: from lb7f8hsrpno-svcs.dcs.int.inet (HELO pd5ml1no-ssvc.prod.shaw.ca)\r
21         ([10.0.144.222])\r
22         by pd6mo1no-svcs.prod.shaw.ca with ESMTP; 17 Jan 2012 15:53:54 -0700\r
23 X-Cloudmark-SP-Filtered: true\r
24 X-Cloudmark-SP-Result: v=1.1 cv=bD0CuDYpMgGTku+nVSbZuKP/9fNjspX1F8zuwcoBWhM=\r
25         c=1 sm=1\r
26         a=6y9XPzrDipoA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17\r
27         a=7343-z1_AAAA:8 a=YxpH_PJTSDrBUMo_-hgA:9 a=QYmB6SfJbQnURuRESEUA:7\r
28         a=0c-eHkXYtrgA:10 a=qbOB_sNrcAXsvv2H:21 a=Na4kHhFGYN_6axhN:21\r
29         a=HpAAvcLHHh0Zw7uRqdWCyQ==:117\r
30 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56])\r
31         by pd5ml1no-dmz.prod.shaw.ca with ESMTP; 17 Jan 2012 15:53:54 -0700\r
32 Received: by lagos.xvx.ca (Postfix, from userid 1000)\r
33         id 8F9A58004C31; Tue, 17 Jan 2012 15:53:53 -0700 (MST)\r
34 From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>\r
35 To: notmuch@notmuchmail.org\r
36 Subject: [PATCH v2 5/5] emacs: Use message-citation-line-format in reply\r
37 Date: Tue, 17 Jan 2012 15:53:38 -0700\r
38 Message-Id: <1326840818-6821-2-git-send-email-awg+notmuch@xvx.ca>\r
39 X-Mailer: git-send-email 1.7.5.4\r
40 In-Reply-To: <1326840818-6821-1-git-send-email-awg+notmuch@xvx.ca>\r
41 References: <cuny5t6r97c.fsf@hotblack-desiato.hh.sledj.net>\r
42         <1326840818-6821-1-git-send-email-awg+notmuch@xvx.ca>\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, 17 Jan 2012 22:53:56 -0000\r
56 \r
57 Instead of using a static citation line for the first line of the\r
58 reply message, use the customizable one defined by message-mode.\r
59 This makes it easy for users to customize the reply style, and\r
60 retains consistency for users with existing message-mode\r
61 customizations.\r
62 \r
63 The test has been updated to reflect how the message will be\r
64 formatted with the default value of message-citation-line-format.\r
65 \r
66 ---\r
67  emacs/notmuch-mua.el |   19 ++++++++++++++++---\r
68  test/emacs           |    2 +-\r
69  2 files changed, 17 insertions(+), 4 deletions(-)\r
70 \r
71 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
72 index 64e160a..b58f919 100644\r
73 --- a/emacs/notmuch-mua.el\r
74 +++ b/emacs/notmuch-mua.el\r
75 @@ -135,9 +135,22 @@ list."\r
76           (forward-line -1)\r
77         (goto-char (point-max)))\r
78  \r
79 -      (insert (format "On %s, %s wrote:\n"\r
80 -                     (cdr (assq 'date original-headers))\r
81 -                     (cdr (assq 'from original-headers))))\r
82 +      (let* ((quoth message-citation-line-format)\r
83 +            (case-fold-search nil)\r
84 +            (full-from (cdr (assq 'from original-headers)))\r
85 +            (from-addr (car (mail-header-parse-address full-from)))\r
86 +            (from-name (cdr (mail-header-parse-address full-from)))\r
87 +            (first-name (car (split-string from-name)))\r
88 +            (last-name (append (cdr (split-string from-name))))\r
89 +            (time (date-to-time (cdr (assq 'date original-headers)))))\r
90 +\r
91 +       (setq quoth (replace-regexp-in-string "%f" full-from quoth t t))\r
92 +       (setq quoth (replace-regexp-in-string "%n" from-addr quoth t t))\r
93 +       (setq quoth (replace-regexp-in-string "%N" from-name quoth t t))\r
94 +       (setq quoth (replace-regexp-in-string "%F" first-name quoth t t))\r
95 +       (setq quoth (replace-regexp-in-string "%L" last-name quoth t t))\r
96 +       (setq quoth (format-time-string quoth time))\r
97 +       (insert quoth))\r
98  \r
99        (if plain-parts\r
100           (mapc (lambda (part) (notmuch-mua-insert-part-quoted part)) plain-parts)\r
101 diff --git a/test/emacs b/test/emacs\r
102 index ac47b16..3f59b23 100755\r
103 --- a/test/emacs\r
104 +++ b/test/emacs\r
105 @@ -268,7 +268,7 @@ Subject: Re: Testing message sent via SMTP\r
106  In-Reply-To: <XXX>\r
107  Fcc: $(pwd)/mail/sent\r
108  --text follows this line--\r
109 -On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
110 +On Sat, Jan 01 2000, Notmuch Test Suite wrote:\r
111  > This is a test that messages are sent via SMTP\r
112  EOF\r
113  test_expect_equal_file OUTPUT EXPECTED\r
114 -- \r
115 1.7.5.4\r
116 \r