Re: [feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / c7 / 52378ad329759ae5a579c49a20702c4b62027b
1 Return-Path: <dme@dme.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 74B04431FD4\r
6         for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 09:08:37 -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.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 JesNX7j21Rg5 for <notmuch@notmuchmail.org>;\r
16         Mon, 16 Jan 2012 09:08:35 -0800 (PST)\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
18         [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 05F56431FAF\r
21         for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 09:08:34 -0800 (PST)\r
22 Received: by wibhr12 with SMTP id hr12so2640234wib.26\r
23         for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 09:08:33 -0800 (PST)\r
24 Received: by 10.180.99.232 with SMTP id et8mr16323682wib.8.1326733713748;\r
25         Mon, 16 Jan 2012 09:08:33 -0800 (PST)\r
26 Received: from hotblack-desiato.hh.sledj.net\r
27         (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])\r
28         by mx.google.com with ESMTPS id fi6sm35127732wib.2.2012.01.16.09.08.32\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Mon, 16 Jan 2012 09:08:32 -0800 (PST)\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
32         id 0D658A04F3; Mon, 16 Jan 2012 17:08:31 +0000 (GMT)\r
33 From: David Edmondson <dme@dme.org>\r
34 To: notmuch@notmuchmail.org\r
35 Subject:\r
36  [PATCH 2/2] emacs: Another special case for `notmuch-show-clean-address'.\r
37 Date: Mon, 16 Jan 2012 17:08:29 +0000\r
38 Message-Id: <1326733709-25985-2-git-send-email-dme@dme.org>\r
39 X-Mailer: git-send-email 1.7.7.3\r
40 In-Reply-To: <1326733709-25985-1-git-send-email-dme@dme.org>\r
41 References: <1326732453-23377-2-git-send-email-dme@dme.org>\r
42         <1326733709-25985-1-git-send-email-dme@dme.org>\r
43 MIME-Version: 1.0\r
44 Content-Type: text/plain; charset=UTF-8\r
45 Content-Transfer-Encoding: 8bit\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 List-Id: "Use and development of the notmuch mail system."\r
50         <notmuch.notmuchmail.org>\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
54 List-Post: <mailto:notmuch@notmuchmail.org>\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
58 X-List-Received-Date: Mon, 16 Jan 2012 17:08:37 -0000\r
59 \r
60 Remove backslashes.\r
61 ---\r
62 \r
63 Including a new test case.\r
64 \r
65  emacs/notmuch-show.el |   14 +++++++++-----\r
66  emacs/notmuch-test.el |    6 ++++--\r
67  2 files changed, 13 insertions(+), 7 deletions(-)\r
68 \r
69 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
70 index 02819f3..6b9d1b8 100644\r
71 --- a/emacs/notmuch-show.el\r
72 +++ b/emacs/notmuch-show.el\r
73 @@ -248,11 +248,15 @@ unchanged ADDRESS if parsing fails."\r
74         (t\r
75         (setq p-address address)))\r
76        \r
77 -      ;; Remove outer double quotes. They might be required during\r
78 -      ;; transport, but we don't need to see them.\r
79 -      (when (and p-name\r
80 -                (string-match "^\"\\(.*\\)\"$" p-name))\r
81 -        (setq p-name (match-string 1 p-name)))\r
82 +      ;; Remove elements of the mailbox part that are not relevant for\r
83 +      ;; display, even if they are required during transport.\r
84 +      (when p-name\r
85 +       ;; Outer double quotes.\r
86 +       (when (string-match "^\"\\(.*\\)\"$" p-name)\r
87 +         (setq p-name (match-string 1 p-name)))\r
88 +\r
89 +       ;; Backslashes.\r
90 +       (setq p-name (replace-regexp-in-string "\\\\" "" p-name)))\r
91  \r
92        ;; If the address is 'foo@bar.com <foo@bar.com>' then show just\r
93        ;; 'foo@bar.com'.\r
94 diff --git a/emacs/notmuch-test.el b/emacs/notmuch-test.el\r
95 index d6cf318..0637818 100644\r
96 --- a/emacs/notmuch-test.el\r
97 +++ b/emacs/notmuch-test.el\r
98 @@ -74,11 +74,13 @@ the differences, ignoring similarities."\r
99    (let* ((input '("ДБ <db-uknot@stop.me.uk>"\r
100                   "foo (at home) <foo@bar.com>"\r
101                   "foo [at home] <foo@bar.com>"\r
102 -                 "Foo Bar"))\r
103 +                 "Foo Bar"\r
104 +                 "Fred Dibna \\[extraordinaire\\] <fred@dibna.com>"))\r
105          (expected '("ДБ <db-uknot@stop.me.uk>"\r
106                      "foo (at home) <foo@bar.com>"\r
107                      "foo [at home] <foo@bar.com>"\r
108 -                    "Foo Bar"))\r
109 +                    "Foo Bar"\r
110 +                    "Fred Dibna [extraordinaire] <fred@dibna.com>"))\r
111          (output (mapcar #'notmuch-show-clean-address input)))\r
112      (notmuch-test-compare output expected)))\r
113  \r
114 -- \r
115 1.7.7.3\r
116 \r