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 996E5431FD5
\r
6 for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 05:54:07 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 H2uTLPGYF7ub for <notmuch@notmuchmail.org>;
\r
16 Wed, 25 Jan 2012 05:54:07 -0800 (PST)
\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com
\r
18 [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
19 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
20 C168E431FBC for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 05:54:06 -0800
\r
22 Received: by wgbdt12 with SMTP id dt12so4815007wgb.2
\r
23 for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 05:54:05 -0800 (PST)
\r
24 Received: by 10.181.13.113 with SMTP id ex17mr17501561wid.15.1327499645523;
\r
25 Wed, 25 Jan 2012 05:54:05 -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 fr8sm1666145wib.10.2012.01.25.05.54.03
\r
29 (version=TLSv1/SSLv3 cipher=OTHER);
\r
30 Wed, 25 Jan 2012 05:54:04 -0800 (PST)
\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)
\r
32 id 047B69FF26; Wed, 25 Jan 2012 13:54:02 +0000 (GMT)
\r
33 From: David Edmondson <dme@dme.org>
\r
34 To: notmuch@notmuchmail.org
\r
36 [PATCH 3/3] emacs: Another special case for `notmuch-show-clean-address'.
\r
37 Date: Wed, 25 Jan 2012 13:54:00 +0000
\r
38 Message-Id: <1327499640-11747-4-git-send-email-dme@dme.org>
\r
39 X-Mailer: git-send-email 1.7.8.3
\r
40 In-Reply-To: <1327499640-11747-1-git-send-email-dme@dme.org>
\r
41 References: <1327491904-28416-1-git-send-email-dme@dme.org>
\r
42 <1327499640-11747-1-git-send-email-dme@dme.org>
\r
45 ALoCoQnK6bq33Rm//ifb145qvhHSLv2wmmT0+xZqwTJm7gty9uZhtv34GYbHCVZ1E4QOIExXLyu8
\r
46 Content-Type: text/plain; charset=UTF-8
\r
47 Content-Transfer-Encoding: 8bit
\r
48 X-BeenThere: notmuch@notmuchmail.org
\r
49 X-Mailman-Version: 2.1.13
\r
51 List-Id: "Use and development of the notmuch mail system."
\r
52 <notmuch.notmuchmail.org>
\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
56 List-Post: <mailto:notmuch@notmuchmail.org>
\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
59 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
60 X-List-Received-Date: Wed, 25 Jan 2012 13:54:07 -0000
\r
64 emacs/notmuch-show.el | 14 +++++++++-----
\r
65 test/emacs-address-cleaning.el | 6 ++++--
\r
66 2 files changed, 13 insertions(+), 7 deletions(-)
\r
68 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
69 index 1fd2524..c849e84 100644
\r
70 --- a/emacs/notmuch-show.el
\r
71 +++ b/emacs/notmuch-show.el
\r
72 @@ -310,11 +310,15 @@ unchanged ADDRESS if parsing fails."
\r
74 (setq p-address address)))
\r
76 - ;; Remove outer double quotes. They might be required during
\r
77 - ;; transport, but we don't need to see them.
\r
79 - (string-match "^\"\\(.*\\)\"$" p-name))
\r
80 - (setq p-name (match-string 1 p-name)))
\r
81 + ;; Remove elements of the mailbox part that are not relevant for
\r
82 + ;; display, even if they are required during transport.
\r
84 + ;; Outer double quotes.
\r
85 + (when (string-match "^\"\\(.*\\)\"$" p-name)
\r
86 + (setq p-name (match-string 1 p-name)))
\r
89 + (setq p-name (replace-regexp-in-string "\\\\" "" p-name)))
\r
91 ;; If the address is 'foo@bar.com <foo@bar.com>' then show just
\r
93 diff --git a/test/emacs-address-cleaning.el b/test/emacs-address-cleaning.el
\r
94 index 19e9e05..3b0b109 100644
\r
95 --- a/test/emacs-address-cleaning.el
\r
96 +++ b/test/emacs-address-cleaning.el
\r
98 (let* ((input '("ДБ <db-uknot@stop.me.uk>"
\r
99 "foo (at home) <foo@bar.com>"
\r
100 "foo [at home] <foo@bar.com>"
\r
103 + "Fred Dibna \\[extraordinaire\\] <fred@dibna.com>"))
\r
104 (expected '("ДБ <db-uknot@stop.me.uk>"
\r
105 "foo (at home) <foo@bar.com>"
\r
106 "foo [at home] <foo@bar.com>"
\r
109 + "Fred Dibna [extraordinaire] <fred@dibna.com>"))
\r
110 (output (mapcar #'notmuch-show-clean-address input)))
\r
111 (notmuch-test-expect-equal output expected)))
\r