Re: [PATCH 00/11] Improve charset and cid: handling
[notmuch-archives.git] / 02 / 0e386461db94568a7f142668f1cdd49bda8609
1 Return-Path: <pieter@praet.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 E94D9431E84\r
6         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:52:09 -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 R4WgfgeNQEH4 for <notmuch@notmuchmail.org>;\r
16         Tue, 24 Jan 2012 16:52:09 -0800 (PST)\r
17 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
18         [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id DC5A1431FB6\r
21         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:52:08 -0800 (PST)\r
22 Received: by werb10 with SMTP id b10so3983088wer.26\r
23         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:52:07 -0800 (PST)\r
24 MIME-Version: 1.0\r
25 Received: by 10.216.135.194 with SMTP id u44mr8073921wei.40.1327452727746;\r
26         Tue, 24 Jan 2012 16:52:07 -0800 (PST)\r
27 Received: from localhost ([109.131.95.182])\r
28         by mx.google.com with ESMTPS id fv6sm57923216wib.8.2012.01.24.16.52.06\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Tue, 24 Jan 2012 16:52:07 -0800 (PST)\r
31 From: Pieter Praet <pieter@praet.org>\r
32 To: David Edmondson <dme@dme.org>\r
33 Subject: Re: [PATCH] emacs: Add `notmuch-show-stash-gmane' and\r
34         `notmuch-show-stash-gmane-and-go'.\r
35 Date: Wed, 25 Jan 2012 01:50:08 +0100\r
36 Message-Id: <1327452608-8247-1-git-send-email-pieter@praet.org>\r
37 X-Mailer: git-send-email 1.7.8.1\r
38 In-Reply-To: <1327397873-20596-1-git-send-email-dme@dme.org>\r
39 References: <1327397873-20596-1-git-send-email-dme@dme.org>\r
40 X-Gm-Message-State:\r
41  ALoCoQnJ/YFGZKHwi8SR7QQgK8F/TRTSw+ySUmERuGmMLcc2RGT+z49czwE1c/au6m4A/UJbzg3r\r
42 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Wed, 25 Jan 2012 00:52:10 -0000\r
56 \r
57 In a perfect world, everyone would be using Notmuch and have a local\r
58 copy of every message ever sent to any ML.  While we're waiting for\r
59 Atlantis to resurface, we'll need an interim solution.\r
60 \r
61 +1 for the idea, but Gmane doesn't archive *all* MLs, so we should leave\r
62 the user some legroom.  Since I've already made the necessary changes,\r
63 I'll just send the patch instead of wasting your time with suggestions.\r
64 Feel free to merge it into yours.\r
65 \r
66 Peace\r
67 \r
68 ---\r
69  emacs/notmuch-show.el |   40 ++++++++++++++++++++++++++++++----------\r
70  test/emacs            |    2 +-\r
71  2 files changed, 31 insertions(+), 11 deletions(-)\r
72 \r
73 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
74 index c4d45e7..7f209cd 100644\r
75 --- a/emacs/notmuch-show.el\r
76 +++ b/emacs/notmuch-show.el\r
77 @@ -123,6 +123,24 @@ indentation."\r
78                  (const :tag "View interactively"\r
79                         notmuch-show-interactively-view-part)))\r
80  \r
81 +(defcustom notmuch-show-stash-mlarchive-link-pref "http://mid.gmane.org/"\r
82 +  "Default Mailing List Archive to use when stashing links."\r
83 +  :group 'notmuch-show\r
84 +  ;; TODO: find a working `Message-Id' search arg for all options.\r
85 +  :type '(choice (const :tag "Gmane"\r
86 +                       "http://mid.gmane.org/")\r
87 +                ;; (const :tag "MARC"\r
88 +                ;;     "http://marc.info/")\r
89 +                (const :tag "Mail Archive, The"\r
90 +                       "http://www.mail-archive.com/search?l=mid&q=")\r
91 +                ;; (const :tag "MarkMail"\r
92 +                ;;     "http://markmail.org/")\r
93 +                ;; (const :tag "opensubscriber"\r
94 +                ;;     "http://opensubscriber.com/")\r
95 +                ;; (const :tag "Nabble"\r
96 +                ;;     "http://nabble.com/")\r
97 +                (string :tag "Custom URI")))\r
98 +\r
99  (defmacro with-current-notmuch-show-message (&rest body)\r
100    "Evaluate body with current buffer set to the text of current message"\r
101    `(save-excursion\r
102 @@ -1016,8 +1034,8 @@ thread id.  If a prefix is given, crypto processing is toggled."\r
103      (define-key map "s" 'notmuch-show-stash-subject)\r
104      (define-key map "T" 'notmuch-show-stash-tags)\r
105      (define-key map "t" 'notmuch-show-stash-to)\r
106 -    (define-key map "g" 'notmuch-show-stash-gmane)\r
107 -    (define-key map "G" 'notmuch-show-stash-gmane-and-go)\r
108 +    (define-key map "l" 'notmuch-show-stash-mlarchive-link)\r
109 +    (define-key map "L" 'notmuch-show-stash-mlarchive-link-and-go)\r
110      map)\r
111    "Submap for stash commands")\r
112  (fset 'notmuch-show-stash-map notmuch-show-stash-map)\r
113 @@ -1605,20 +1623,22 @@ buffer."\r
114    (interactive)\r
115    (notmuch-common-do-stash (notmuch-show-get-to)))\r
116  \r
117 -(defun notmuch-show-stash-gmane ()\r
118 -  "Copy a Gmane URI for the current message to the kill-ring.\r
119 +(defun notmuch-show-stash-mlarchive-link ()\r
120 +  "Copy an ML Archive URI for the current message to the kill-ring.\r
121  \r
122 -This presumes that the message is available at Gmane."\r
123 +This presumes that the message is available at the Mailing List Archive\r
124 +configured in `notmuch-show-stash-mlarchive-link-pref'."\r
125    (interactive)\r
126 -  (notmuch-common-do-stash (concat "http://mid.gmane.org/"\r
127 +  (notmuch-common-do-stash (concat notmuch-show-stash-mlarchive-link-pref\r
128                                    (substring (notmuch-show-get-message-id) 4 -1))))\r
129  \r
130 -(defun notmuch-show-stash-gmane-and-go ()\r
131 -  "Copy a Gmane URI for the current message to the kill-ring and visit it.\r
132 +(defun notmuch-show-stash-mlarchive-link-and-go ()\r
133 +  "Copy an ML Archive URI for the current message to the kill-ring and visit it.\r
134  \r
135 -This presumes that the message is available at Gmane."\r
136 +This presumes that the message is available at the Mailing List Archive\r
137 +configured in `notmuch-show-stash-mlarchive-link-pref'."\r
138    (interactive)\r
139 -  (let ((uri (concat "http://mid.gmane.org/"\r
140 +  (let ((uri (concat notmuch-show-stash-mlarchive-link-pref\r
141                      (substring (notmuch-show-get-message-id) 4 -1))))\r
142      (notmuch-common-do-stash uri)\r
143      (browse-url uri)))\r
144 diff --git a/test/emacs b/test/emacs\r
145 index 5f7467d..4e08726 100755\r
146 --- a/test/emacs\r
147 +++ b/test/emacs\r
148 @@ -382,7 +382,7 @@ test_emacs '(notmuch-show "id:\"bought\"")\r
149         (notmuch-show-stash-message-id-stripped)\r
150         (notmuch-show-stash-tags)\r
151         (notmuch-show-stash-filename)\r
152 -       (notmuch-show-stash-gmane)\r
153 +       (notmuch-show-stash-mlarchive-link)\r
154         (switch-to-buffer\r
155           (generate-new-buffer "*test-stashing*"))\r
156         (dotimes (i 10)\r
157 -- \r
158 1.7.8.1\r
159 \r