Re: BUG: bad notmuch shared library install_name on Mac OS X
[notmuch-archives.git] / a8 / 262f52aaa31ad4b07ec33cae38b654fc071157
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 9D96A431FBF\r
6         for <notmuch@notmuchmail.org>; Tue, 31 Jul 2012 09:25:59 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.098\r
10 X-Spam-Level: \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 IETcrRbkjLoz for <notmuch@notmuchmail.org>;\r
17         Tue, 31 Jul 2012 09:25:58 -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 322B7431FBD\r
22         for <notmuch@notmuchmail.org>; Tue, 31 Jul 2012 09:25:58 -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 1SwFGZ-0005kp-V1; Tue, 31 Jul 2012 17:25:54 +0100\r
27 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]\r
28         helo=localhost)\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 1SwFGZ-0002kp-Gy; Tue, 31 Jul 2012 17:25:51 +0100\r
32 From: Mark Walters <markwalters1009@gmail.com>\r
33 To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
34 Subject: Re: [PATCH] emacs: Split the function notmuch-show-clean-address\r
35 In-Reply-To: <m2mx2gl6d1.fsf@guru.guru-group.fi>\r
36 References: <87ehnw84e5.fsf@qmul.ac.uk> <m2mx2gl6d1.fsf@guru.guru-group.fi>\r
37 User-Agent: Notmuch/0.13.2+96~g634443c (http://notmuchmail.org) Emacs/23.4.1\r
38         (x86_64-pc-linux-gnu)\r
39 Date: Tue, 31 Jul 2012 17:25:51 +0100\r
40 Message-ID: <87boivzyls.fsf@qmul.ac.uk>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain; charset=us-ascii\r
43 X-Sender-Host-Address: 94.192.233.223\r
44 X-QM-SPAM-Info: Sender has good ham record.  :)\r
45 X-QM-Body-MD5: 960cb66c68eaa6edf5544b3d5f0877d3 (of first 20000 bytes)\r
46 X-SpamAssassin-Score: -1.8\r
47 X-SpamAssassin-SpamBar: -\r
48 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
49         determine if it is\r
50         spam. We require at least 5.0 points to mark a message as spam.\r
51         This message scored -1.8 points.\r
52         Summary of the scoring: \r
53         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
54         *      medium trust\r
55         *      [138.37.6.40 listed in list.dnswl.org]\r
56         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
57         provider *      (markwalters1009[at]gmail.com)\r
58         * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
59         *      domain\r
60         *  0.5 AWL AWL: From: address is in the auto white-list\r
61 X-QM-Scan-Virus: ClamAV says the message is clean\r
62 X-BeenThere: notmuch@notmuchmail.org\r
63 X-Mailman-Version: 2.1.13\r
64 Precedence: list\r
65 List-Id: "Use and development of the notmuch mail system."\r
66         <notmuch.notmuchmail.org>\r
67 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
69 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
70 List-Post: <mailto:notmuch@notmuchmail.org>\r
71 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
72 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
73         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
74 X-List-Received-Date: Tue, 31 Jul 2012 16:25:59 -0000\r
75 \r
76 On Tue, 31 Jul 2012, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
77 > On Sat, Jul 28 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
78 >\r
79 >> This function is also used by pick so split it out. Since, pick and show\r
80 >> want a slightly different combination of name and email make the\r
81 >> separated function return them as a pair, and let show or pick extract\r
82 >> the combination they want from that.\r
83 >> ---\r
84 \r
85 Many thanks for the review all these look clear improvements: I will\r
86 post a new version as a reply to this email.\r
87 \r
88 > Put notmuch-clean-address before notmuch-show-clean-address so that\r
89 > byte compilation don't complain about missing function.\r
90 \r
91 Fixed: I am curious though because I did not get any complaints from\r
92 make. Are there some debug or similar things I should be setting?\r
93 \r
94 > (or move it to another file --- maybe later if it is sensible thing to do)\r
95 \r
96 I was vaguely thinking of moving it to lib after the split.\r
97 \r
98 > You could return the name-address pair as cons cell instead of list (?).\r
99 \r
100 This is a clear improvement.\r
101 \r
102 \r
103 Thanks again\r
104 \r
105 Mark\r
106 \r
107 > (If you continue to use list you can replace (car (cdr ...)) with (cadr ...))\r
108 >\r
109 > Anyway, LGTM.\r
110 >\r
111 > Tomi\r
112 >\r
113 >>\r
114 >> This change allows the removal of about 50 lines of duplicated code from\r
115 >> notmuch-pick. Later, we may want to move the split out function to lib.\r
116 >>\r
117 >>  emacs/notmuch-show.el |   19 ++++++++++++++-----\r
118 >>  1 files changed, 14 insertions(+), 5 deletions(-)\r
119 >>\r
120 >> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
121 >> index 6335d45..0d8569d 100644\r
122 >> --- a/emacs/notmuch-show.el\r
123 >> +++ b/emacs/notmuch-show.el\r
124 >> @@ -354,6 +354,19 @@ operation on the contents of the current buffer."\r
125 >>  (defun notmuch-show-clean-address (address)\r
126 >>    "Try to clean a single email ADDRESS for display.  Return\r
127 >>  unchanged ADDRESS if parsing fails."\r
128 >> +  (let* ((clean-address (notmuch-clean-address address))\r
129 >> +     (p-address (car clean-address))\r
130 >> +     (p-name (car (cdr clean-address))))\r
131 >> +    ;; If no name, return just the address.\r
132 >> +    (if (not p-name)\r
133 >> +    p-address\r
134 >> +      ;; Otherwise format the name and address together.\r
135 >> +      (concat p-name " <" p-address ">"))))\r
136 >> +\r
137 >> +(defun notmuch-clean-address (address)\r
138 >> +  "Try to clean a single email ADDRESS for display.\r
139 >> +Return (AUTHOR_EMAIL AUTHOR_NAME). Return (ADDRESS nil) if\r
140 >> +parsing fails."\r
141 >>    (condition-case nil\r
142 >>      (let (p-name p-address)\r
143 >>        ;; It would be convenient to use `mail-header-parse-address',\r
144 >> @@ -401,11 +414,7 @@ unchanged ADDRESS if parsing fails."\r
145 >>        (when (string= p-name p-address)\r
146 >>      (setq p-name nil))\r
147 >>  \r
148 >> -      ;; If no name results, return just the address.\r
149 >> -      (if (not p-name)\r
150 >> -      p-address\r
151 >> -    ;; Otherwise format the name and address together.\r
152 >> -    (concat p-name " <" p-address ">")))\r
153 >> +      (list p-address p-name))\r
154 >>      (error address)))\r
155 >>  \r
156 >>  (defun notmuch-show-insert-headerline (headers date tags depth)\r
157 >> -- \r
158 >> 1.7.9.1\r
159 >>\r
160 >> _______________________________________________\r
161 >> notmuch mailing list\r
162 >> notmuch@notmuchmail.org\r
163 >> http://notmuchmail.org/mailman/listinfo/notmuch\r