1 Return-Path: <m.walters@qmul.ac.uk>
\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 AA519431FAF
\r
6 for <notmuch@notmuchmail.org>; Sat, 28 Jul 2012 05:19:16 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5
\r
12 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,
\r
13 NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id p98WDH-+n2+U for <notmuch@notmuchmail.org>;
\r
17 Sat, 28 Jul 2012 05:19:16 -0700 (PDT)
\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 0E0B1431FAE
\r
22 for <notmuch@notmuchmail.org>; Sat, 28 Jul 2012 05:19:16 -0700 (PDT)
\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])
\r
24 by mail2.qmul.ac.uk with esmtp (Exim 4.71)
\r
25 (envelope-from <m.walters@qmul.ac.uk>)
\r
26 id 1Sv5zG-00041H-JJ; Sat, 28 Jul 2012 13:19:14 +0100
\r
27 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]
\r
29 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)
\r
30 (envelope-from <m.walters@qmul.ac.uk>)
\r
31 id 1Sv5zG-0005gU-9C; Sat, 28 Jul 2012 13:19:14 +0100
\r
32 From: Mark Walters <markwalters1009@gmail.com>
\r
33 To: notmuch@notmuchmail.org
\r
34 Subject: [PATCH] emacs: Split the function notmuch-show-clean-address
\r
35 User-Agent: Notmuch/0.13.2+93~gf33b188 (http://notmuchmail.org) Emacs/23.4.1
\r
36 (x86_64-pc-linux-gnu)
\r
37 Date: Sat, 28 Jul 2012 13:19:14 +0100
\r
38 Message-ID: <87ehnw84e5.fsf@qmul.ac.uk>
\r
40 Content-Type: text/plain; charset=us-ascii
\r
41 X-Sender-Host-Address: 94.192.233.223
\r
42 X-QM-SPAM-Info: Sender has good ham record. :)
\r
43 X-QM-Body-MD5: c4b2f5ab97d6c89f18043d923b99556f (of first 20000 bytes)
\r
44 X-SpamAssassin-Score: -1.8
\r
45 X-SpamAssassin-SpamBar: -
\r
46 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
48 spam. We require at least 5.0 points to mark a message as spam.
\r
49 This message scored -1.8 points.
\r
50 Summary of the scoring:
\r
51 * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,
\r
53 * [138.37.6.40 listed in list.dnswl.org]
\r
54 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
55 provider * (markwalters1009[at]gmail.com)
\r
56 * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay
\r
58 * 0.5 AWL AWL: From: address is in the auto white-list
\r
59 X-QM-Scan-Virus: ClamAV says the message is clean
\r
60 X-BeenThere: notmuch@notmuchmail.org
\r
61 X-Mailman-Version: 2.1.13
\r
63 List-Id: "Use and development of the notmuch mail system."
\r
64 <notmuch.notmuchmail.org>
\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
68 List-Post: <mailto:notmuch@notmuchmail.org>
\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
72 X-List-Received-Date: Sat, 28 Jul 2012 12:19:16 -0000
\r
75 This function is also used by pick so split it out. Since, pick and show
\r
76 want a slightly different combination of name and email make the
\r
77 separated function return them as a pair, and let show or pick extract
\r
78 the combination they want from that.
\r
81 This change allows the removal of about 50 lines of duplicated code from
\r
82 notmuch-pick. Later, we may want to move the split out function to lib.
\r
84 emacs/notmuch-show.el | 19 ++++++++++++++-----
\r
85 1 files changed, 14 insertions(+), 5 deletions(-)
\r
87 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
88 index 6335d45..0d8569d 100644
\r
89 --- a/emacs/notmuch-show.el
\r
90 +++ b/emacs/notmuch-show.el
\r
91 @@ -354,6 +354,19 @@ operation on the contents of the current buffer."
\r
92 (defun notmuch-show-clean-address (address)
\r
93 "Try to clean a single email ADDRESS for display. Return
\r
94 unchanged ADDRESS if parsing fails."
\r
95 + (let* ((clean-address (notmuch-clean-address address))
\r
96 + (p-address (car clean-address))
\r
97 + (p-name (car (cdr clean-address))))
\r
98 + ;; If no name, return just the address.
\r
101 + ;; Otherwise format the name and address together.
\r
102 + (concat p-name " <" p-address ">"))))
\r
104 +(defun notmuch-clean-address (address)
\r
105 + "Try to clean a single email ADDRESS for display.
\r
106 +Return (AUTHOR_EMAIL AUTHOR_NAME). Return (ADDRESS nil) if
\r
108 (condition-case nil
\r
109 (let (p-name p-address)
\r
110 ;; It would be convenient to use `mail-header-parse-address',
\r
111 @@ -401,11 +414,7 @@ unchanged ADDRESS if parsing fails."
\r
112 (when (string= p-name p-address)
\r
115 - ;; If no name results, return just the address.
\r
118 - ;; Otherwise format the name and address together.
\r
119 - (concat p-name " <" p-address ">")))
\r
120 + (list p-address p-name))
\r
123 (defun notmuch-show-insert-headerline (headers date tags depth)
\r