Re: notmuch and "mute" -- useful to anyone?
[notmuch-archives.git] / 89 / 13841be1ec72b736c8b5a29b6403205d067fa8
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 1F28D429E39\r
6         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 03:45:12 -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 vhNLEiLUwypD for <notmuch@notmuchmail.org>;\r
16         Wed, 25 Jan 2012 03:45:10 -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  45B5C431FD2    for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 03:45:10 -0800\r
21  (PST)\r
22 Received: by wgbdt12 with SMTP id dt12so4688858wgb.2\r
23         for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 03:45:09 -0800 (PST)\r
24 Received: by 10.180.80.68 with SMTP id p4mr6655723wix.21.1327491908913;\r
25         Wed, 25 Jan 2012 03:45:08 -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 l12sm135154wiw.0.2012.01.25.03.45.06\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Wed, 25 Jan 2012 03:45:07 -0800 (PST)\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
32         id AD1629FEEC; Wed, 25 Jan 2012 11:45:05 +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: Wed, 25 Jan 2012 11:45:04 +0000\r
38 Message-Id: <1327491904-28416-3-git-send-email-dme@dme.org>\r
39 X-Mailer: git-send-email 1.7.8.3\r
40 In-Reply-To: <1327491904-28416-1-git-send-email-dme@dme.org>\r
41 References: <1327491904-28416-1-git-send-email-dme@dme.org>\r
42 MIME-Version: 1.0\r
43 X-Gm-Message-State:\r
44  ALoCoQldaFci90rqxTc9cAHIH9N0LlzgD675rvZlBYC9GXa/AxEDBxKKFyhGXUA9o5ObMLXKVWbn\r
45 Content-Type: text/plain; charset=UTF-8\r
46 Content-Transfer-Encoding: 8bit\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Wed, 25 Jan 2012 11:45:12 -0000\r
60 \r
61 Remove backslashes.\r
62 ---\r
63  emacs/notmuch-show.el          |   14 +++++++++-----\r
64  test/emacs-address-cleaning.el |    6 ++++--\r
65  2 files changed, 13 insertions(+), 7 deletions(-)\r
66 \r
67 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
68 index 1fd2524..c849e84 100644\r
69 --- a/emacs/notmuch-show.el\r
70 +++ b/emacs/notmuch-show.el\r
71 @@ -310,11 +310,15 @@ unchanged ADDRESS if parsing fails."\r
72         (t\r
73         (setq p-address address)))\r
74  \r
75 -      ;; Remove outer double quotes. They might be required during\r
76 -      ;; transport, but we don't need to see them.\r
77 -      (when (and p-name\r
78 -                (string-match "^\"\\(.*\\)\"$" p-name))\r
79 -       (setq p-name (match-string 1 p-name)))\r
80 +      ;; Remove elements of the mailbox part that are not relevant for\r
81 +      ;; display, even if they are required during transport.\r
82 +      (when p-name\r
83 +       ;; Outer double quotes.\r
84 +       (when (string-match "^\"\\(.*\\)\"$" p-name)\r
85 +         (setq p-name (match-string 1 p-name)))\r
86 +\r
87 +       ;; Backslashes.\r
88 +       (setq p-name (replace-regexp-in-string "\\\\" "" p-name)))\r
89  \r
90        ;; If the address is 'foo@bar.com <foo@bar.com>' then show just\r
91        ;; 'foo@bar.com'.\r
92 diff --git a/test/emacs-address-cleaning.el b/test/emacs-address-cleaning.el\r
93 index 19e9e05..3b0b109 100644\r
94 --- a/test/emacs-address-cleaning.el\r
95 +++ b/test/emacs-address-cleaning.el\r
96 @@ -20,10 +20,12 @@\r
97    (let* ((input '("ДБ <db-uknot@stop.me.uk>"\r
98                   "foo (at home) <foo@bar.com>"\r
99                   "foo [at home] <foo@bar.com>"\r
100 -                 "Foo Bar"))\r
101 +                 "Foo Bar"\r
102 +                 "Fred Dibna \\[extraordinaire\\] <fred@dibna.com>"))\r
103          (expected '("ДБ <db-uknot@stop.me.uk>"\r
104                      "foo (at home) <foo@bar.com>"\r
105                      "foo [at home] <foo@bar.com>"\r
106 -                    "Foo Bar"))\r
107 +                    "Foo Bar"\r
108 +                    "Fred Dibna [extraordinaire] <fred@dibna.com>"))\r
109          (output (mapcar #'notmuch-show-clean-address input)))\r
110      (notmuch-test-expect-equal output expected)))\r
111 -- \r
112 1.7.8.3\r
113 \r