Reply all - issue
[notmuch-archives.git] / d5 / 137e6a72a91bef8c3f782130b95d57ec70b1f5
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 37DCC431FC0\r
6         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 09:47:08 -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 r4clZH3eDkUq for <notmuch@notmuchmail.org>;\r
16         Thu, 19 Jan 2012 09:47:07 -0800 (PST)\r
17 Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10])\r
18         by olra.theworths.org (Postfix) with ESMTP id F3944431FB6\r
19         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 09:47:06 -0800 (PST)\r
20 Received: from pd3ml2so-ssvc.prod.shaw.ca ([10.0.141.138])\r
21         by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 19 Jan 2012 10:47:05 -0700\r
22 X-Cloudmark-SP-Filtered: true\r
23 X-Cloudmark-SP-Result: v=1.1 cv=w8ylZ/s5/CpB4NtJ57cq/Y3wf+h+jIFeVVN4WVEh/uc=\r
24         c=1 sm=1\r
25         a=w3EecL4DZPQA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17\r
26         a=7343-z1_AAAA:8 a=GpjT01FCzd4eTrbtcU8A:9 a=trVQTHzpZ64-_igdUdIA:7\r
27         a=0c-eHkXYtrgA:10 a=KKgeSdN3-Q_mOek0:21 a=cSmX5j7mfm3cSTxy:21\r
28         a=HpAAvcLHHh0Zw7uRqdWCyQ==:117\r
29 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56])\r
30         by pd3ml2so-dmz.prod.shaw.ca with ESMTP; 19 Jan 2012 10:47:05 -0700\r
31 Received: by lagos.xvx.ca (Postfix, from userid 1000)\r
32         id 4302F8003320; Thu, 19 Jan 2012 10:47:05 -0700 (MST)\r
33 From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>\r
34 To: notmuch@notmuchmail.org\r
35 Subject: [PATCH v3 5/5] emacs: Use message-citation-line-format in reply\r
36 Date: Thu, 19 Jan 2012 10:46:57 -0700\r
37 Message-Id: <1326995217-27423-6-git-send-email-awg+notmuch@xvx.ca>\r
38 X-Mailer: git-send-email 1.7.5.4\r
39 In-Reply-To: <1326995217-27423-1-git-send-email-awg+notmuch@xvx.ca>\r
40 References: <1326995217-27423-1-git-send-email-awg+notmuch@xvx.ca>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Thu, 19 Jan 2012 17:47:08 -0000\r
54 \r
55 Instead of using a static citation line for the first line of the\r
56 reply message, use the customizable one defined by message-mode.\r
57 This makes it easy for users to customize the reply style, and\r
58 retains consistency for users with existing message-mode\r
59 customizations.\r
60 ---\r
61  emacs/notmuch-mua.el |   19 ++++++++++++++++---\r
62  test/emacs           |    2 +-\r
63  2 files changed, 17 insertions(+), 4 deletions(-)\r
64 \r
65 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
66 index 5ae0ccf..e485d93 100644\r
67 --- a/emacs/notmuch-mua.el\r
68 +++ b/emacs/notmuch-mua.el\r
69 @@ -134,9 +134,22 @@ list."\r
70           (forward-line -1)\r
71         (goto-char (point-max)))\r
72  \r
73 -      (insert (format "On %s, %s wrote:\n"\r
74 -                     (cdr (assq 'date original-headers))\r
75 -                     (cdr (assq 'from original-headers))))\r
76 +      (let* ((quoth message-citation-line-format)\r
77 +            (case-fold-search nil)\r
78 +            (full-from (cdr (assq 'from original-headers)))\r
79 +            (from-addr (car (mail-header-parse-address full-from)))\r
80 +            (from-name (cdr (mail-header-parse-address full-from)))\r
81 +            (first-name (car (split-string from-name)))\r
82 +            (last-name (append (cdr (split-string from-name))))\r
83 +            (time (date-to-time (cdr (assq 'date original-headers)))))\r
84 +\r
85 +       (setq quoth (replace-regexp-in-string "%f" full-from quoth t t))\r
86 +       (setq quoth (replace-regexp-in-string "%n" from-addr quoth t t))\r
87 +       (setq quoth (replace-regexp-in-string "%N" from-name quoth t t))\r
88 +       (setq quoth (replace-regexp-in-string "%F" first-name quoth t t))\r
89 +       (setq quoth (replace-regexp-in-string "%L" last-name quoth t t))\r
90 +       (setq quoth (format-time-string quoth time))\r
91 +       (insert quoth))\r
92  \r
93        (if plain-parts\r
94           (mapc (lambda (part) (notmuch-mua-insert-part-quoted part)) plain-parts)\r
95 diff --git a/test/emacs b/test/emacs\r
96 index ac47b16..3f59b23 100755\r
97 --- a/test/emacs\r
98 +++ b/test/emacs\r
99 @@ -268,7 +268,7 @@ Subject: Re: Testing message sent via SMTP\r
100  In-Reply-To: <XXX>\r
101  Fcc: $(pwd)/mail/sent\r
102  --text follows this line--\r
103 -On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
104 +On Sat, Jan 01 2000, Notmuch Test Suite wrote:\r
105  > This is a test that messages are sent via SMTP\r
106  EOF\r
107  test_expect_equal_file OUTPUT EXPECTED\r
108 -- \r
109 1.7.5.4\r
110 \r