[PATCH 00/12] Add ghost messages and fix thread linking
[notmuch-archives.git] / 94 / 1b81159322ea32497c5a1488db80b690f83019
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 2D250429E32\r
6         for <notmuch@notmuchmail.org>; Fri,  2 May 2014 07:12:10 -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: 0.502\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.502 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_LOW=-0.7] 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 TXoWjV+BTdKg for <notmuch@notmuchmail.org>;\r
17         Fri,  2 May 2014 07:12:05 -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 8C5A7429E28\r
22         for <notmuch@notmuchmail.org>; Fri,  2 May 2014 07:12:05 -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 1WgEC1-0008B8-3q; Fri, 02 May 2014 15:12:03 +0100\r
27 Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1WgEC0-0004k7-IJ; Fri, 02 May 2014 15:12:00 +0100\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
33 Subject: Re: [PATCH v2] emacs: allow functions in\r
34         notmuch-show-stash-mlarchive-link-alist\r
35 In-Reply-To: <1398947711-12658-1-git-send-email-jani@nikula.org>\r
36 References: <874n1cbfyi.fsf@qmul.ac.uk>\r
37         <1398947711-12658-1-git-send-email-jani@nikula.org>\r
38 User-Agent: Notmuch/0.15.2+615~g78e3a93 (http://notmuchmail.org) Emacs/23.4.1\r
39         (x86_64-pc-linux-gnu)\r
40 Date: Fri, 02 May 2014 15:11:59 +0100\r
41 Message-ID: <87mwf09snk.fsf@qmul.ac.uk>\r
42 MIME-Version: 1.0\r
43 Content-Type: text/plain; charset=us-ascii\r
44 X-Sender-Host-Address: 87.81.223.162\r
45 X-QM-Geographic: According to ripencc,\r
46         this message was delivered by a machine in Britain (UK) (GB).\r
47 X-QM-SPAM-Info: Sender has good ham record.  :)\r
48 X-QM-Body-MD5: b19d7b63756c8108ddef355123d34352 (of first 20000 bytes)\r
49 X-SpamAssassin-Score: -0.1\r
50 X-SpamAssassin-SpamBar: /\r
51 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
52         determine if it is\r
53         spam. We require at least 5.0 points to mark a message as spam.\r
54         This message scored -0.1 points.\r
55         Summary of the scoring: \r
56         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
57         provider *      (markwalters1009[at]gmail.com)\r
58         * -0.1 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
62 Precedence: list\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: Fri, 02 May 2014 14:12:10 -0000\r
73 \r
74 \r
75 This version LGTM +1.\r
76 \r
77 Best wishes\r
78 \r
79 Mark\r
80 \r
81 On Thu, 01 May 2014, Jani Nikula <jani@nikula.org> wrote:\r
82 > Some archives may use a more complicated scheme for referring to\r
83 > messages than just concatenated url and message-id. In particular,\r
84 > patchwork requires a query to translate message-id to a patchwork\r
85 > patch id. Allow functions in notmuch-show-stash-mlarchive-link-alist\r
86 > to facilitate this.\r
87 >\r
88 > For example, one could use something like this for patchwork.\r
89 >\r
90 > (lambda (message-id)\r
91 >   (concat\r
92 >    "http://patchwork.example.com/patch/"\r
93 >    (nth 0\r
94 >       (split-string\r
95 >        (car (last (process-lines "pwclient" "search" "-n" "1"\r
96 >                                  "-m" (concat "<" message-id ">"))))))))\r
97 > ---\r
98 >  emacs/notmuch-show.el | 40 +++++++++++++++++++++++++++-------------\r
99 >  1 file changed, 27 insertions(+), 13 deletions(-)\r
100 >\r
101 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
102 > index df10d4bad93b..10fc872141dc 100644\r
103 > --- a/emacs/notmuch-show.el\r
104 > +++ b/emacs/notmuch-show.el\r
105 > @@ -180,10 +180,21 @@ each attachment handler is logged in buffers with names beginning\r
106 >      )\r
107 >    "List of Mailing List Archives to use when stashing links.\r
108 >  \r
109 > -These URIs are concatenated with the current message's\r
110 > -Message-Id in `notmuch-show-stash-mlarchive-link'."\r
111 > +This list is used for generating a Mailing List Archive reference\r
112 > +URI with the current message's Message-Id in\r
113 > +`notmuch-show-stash-mlarchive-link'.\r
114 > +\r
115 > +If the cdr of the alist element is not a function, the cdr is\r
116 > +expected to contain a URI that is concatenated with the current\r
117 > +message's Message-Id to create a ML archive reference URI.\r
118 > +\r
119 > +If the cdr is a function, the function is called with the\r
120 > +Message-Id as the argument, and the function is expected to\r
121 > +return the ML archive reference URI."\r
122 >    :type '(alist :key-type (string :tag "Name")\r
123 > -             :value-type (string :tag "URL"))\r
124 > +             :value-type (choice\r
125 > +                          (string :tag "URL")\r
126 > +                          (function :tag "Function returning the URL")))\r
127 >    :group 'notmuch-show)\r
128 >  \r
129 >  (defcustom notmuch-show-stash-mlarchive-link-default "Gmane"\r
130 > @@ -2055,16 +2066,19 @@ This presumes that the message is available at the selected Mailing List Archive\r
131 >  If optional argument MLA is non-nil, use the provided key instead of prompting\r
132 >  the user (see `notmuch-show-stash-mlarchive-link-alist')."\r
133 >    (interactive)\r
134 > -  (notmuch-common-do-stash\r
135 > -   (concat (cdr (assoc\r
136 > -              (or mla\r
137 > -                  (let ((completion-ignore-case t))\r
138 > -                    (completing-read\r
139 > -                     "Mailing List Archive: "\r
140 > -                     notmuch-show-stash-mlarchive-link-alist\r
141 > -                     nil t nil nil notmuch-show-stash-mlarchive-link-default)))\r
142 > -              notmuch-show-stash-mlarchive-link-alist))\r
143 > -        (notmuch-show-get-message-id t))))\r
144 > +  (let ((url (cdr (assoc\r
145 > +                (or mla\r
146 > +                    (let ((completion-ignore-case t))\r
147 > +                      (completing-read\r
148 > +                       "Mailing List Archive: "\r
149 > +                       notmuch-show-stash-mlarchive-link-alist\r
150 > +                       nil t nil nil\r
151 > +                       notmuch-show-stash-mlarchive-link-default)))\r
152 > +                notmuch-show-stash-mlarchive-link-alist))))\r
153 > +    (notmuch-common-do-stash\r
154 > +     (if (functionp url)\r
155 > +      (funcall url (notmuch-show-get-message-id t))\r
156 > +       (concat url (notmuch-show-get-message-id t))))))\r
157 >  \r
158 >  (defun notmuch-show-stash-mlarchive-link-and-go (&optional mla)\r
159 >    "Copy an ML Archive URI for the current message to the kill-ring and visit it.\r
160 > -- \r
161 > 1.9.2\r