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 0FA73431FB6
\r
6 for <notmuch@notmuchmail.org>; Thu, 26 Jan 2012 05:15:32 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.677 tagged_above=-999 required=5
\r
12 tests=[HS_INDEX_PARAM=0.023, RCVD_IN_DNSWL_LOW=-0.7]
\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 zXjSQkMJJ519 for <notmuch@notmuchmail.org>;
\r
17 Thu, 26 Jan 2012 05:15:31 -0800 (PST)
\r
18 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com
\r
19 [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 0A0EB431FAE
\r
22 for <notmuch@notmuchmail.org>; Thu, 26 Jan 2012 05:15:30 -0800 (PST)
\r
23 Received: by wibhi8 with SMTP id hi8so411116wib.26
\r
24 for <notmuch@notmuchmail.org>; Thu, 26 Jan 2012 05:15:29 -0800 (PST)
\r
25 Received: by 10.180.88.169 with SMTP id bh9mr4022597wib.20.1327583729871;
\r
26 Thu, 26 Jan 2012 05:15:29 -0800 (PST)
\r
27 Received: from localhost ([109.131.116.159])
\r
28 by mx.google.com with ESMTPS id bu13sm12486538wib.6.2012.01.26.05.15.29
\r
29 (version=TLSv1/SSLv3 cipher=OTHER);
\r
30 Thu, 26 Jan 2012 05:15:29 -0800 (PST)
\r
31 From: Pieter Praet <pieter@praet.org>
\r
32 To: David Edmondson <dme@dme.org>
\r
33 Subject: [RFC] Re: [PATCH] emacs: Add `notmuch-show-stash-gmane' and
\r
34 `notmuch-show-stash-gmane-and-go'.
\r
35 Date: Thu, 26 Jan 2012 14:13:30 +0100
\r
36 Message-Id: <1327583610-30085-1-git-send-email-pieter@praet.org>
\r
37 X-Mailer: git-send-email 1.7.8.1
\r
38 In-Reply-To: <87pqe6vcgv.fsf@praet.org>
\r
39 References: <87pqe6vcgv.fsf@praet.org>
\r
40 Cc: Notmuch Mail <notmuch@notmuchmail.org>
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Thu, 26 Jan 2012 13:15:32 -0000
\r
57 Depends on id:"1327397873-20596-1-git-send-email-dme@dme.org"
\r
59 emacs/notmuch-show.el | 55 ++++++++++++++++++++++++++++++++++--------------
\r
61 2 files changed, 40 insertions(+), 17 deletions(-)
\r
63 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
64 index c4d45e7..0acc4cf 100644
\r
65 --- a/emacs/notmuch-show.el
\r
66 +++ b/emacs/notmuch-show.el
\r
67 @@ -123,6 +123,20 @@ indentation."
\r
68 (const :tag "View interactively"
\r
69 notmuch-show-interactively-view-part)))
\r
71 +(defcustom notmuch-show-stash-mlarchive-link-alist
\r
72 + '(("Gmane" . "http://mid.gmane.org/")
\r
73 + ("MARC" . "http://marc.info/?i=")
\r
74 + ("Mail Archive, The" . "http://www.mail-archive.com/search?l=mid&q=")
\r
75 + ;; FIXME: can these services be searched by `Message-Id' ?
\r
76 + ;; ("MarkMail" . "http://markmail.org/")
\r
77 + ;; ("Nabble" . "http://nabble.com/")
\r
78 + ;; ("opensubscriber" . "http://opensubscriber.com/")
\r
80 + "Default Mailing List Archive to use when stashing links."
\r
81 + :type '(alist :key-type (string :tag "Name")
\r
82 + :value-type (string :tag "URL"))
\r
83 + :group 'notmuch-show)
\r
85 (defmacro with-current-notmuch-show-message (&rest body)
\r
86 "Evaluate body with current buffer set to the text of current message"
\r
88 @@ -1016,8 +1030,8 @@ thread id. If a prefix is given, crypto processing is toggled."
\r
89 (define-key map "s" 'notmuch-show-stash-subject)
\r
90 (define-key map "T" 'notmuch-show-stash-tags)
\r
91 (define-key map "t" 'notmuch-show-stash-to)
\r
92 - (define-key map "g" 'notmuch-show-stash-gmane)
\r
93 - (define-key map "G" 'notmuch-show-stash-gmane-and-go)
\r
94 + (define-key map "l" 'notmuch-show-stash-mlarchive-link)
\r
95 + (define-key map "L" 'notmuch-show-stash-mlarchive-link-and-go)
\r
97 "Submap for stash commands")
\r
98 (fset 'notmuch-show-stash-map notmuch-show-stash-map)
\r
99 @@ -1605,23 +1619,32 @@ buffer."
\r
101 (notmuch-common-do-stash (notmuch-show-get-to)))
\r
103 -(defun notmuch-show-stash-gmane ()
\r
104 - "Copy a Gmane URI for the current message to the kill-ring.
\r
105 +(defun notmuch-show-stash-mlarchive-link ()
\r
106 + "Copy an ML Archive URI for the current message to the kill-ring.
\r
108 -This presumes that the message is available at Gmane."
\r
110 - (notmuch-common-do-stash (concat "http://mid.gmane.org/"
\r
111 - (substring (notmuch-show-get-message-id) 4 -1))))
\r
112 +This presumes that the message is available at the selected Mailing List Archive.
\r
114 -(defun notmuch-show-stash-gmane-and-go ()
\r
115 - "Copy a Gmane URI for the current message to the kill-ring and visit it.
\r
117 -This presumes that the message is available at Gmane."
\r
118 +Also see `notmuch-show-stash-mlarchive-link-alist'."
\r
120 + (notmuch-common-do-stash
\r
121 + (concat (cdr (assoc
\r
122 + (let ((completion-ignore-case t))
\r
125 + notmuch-show-stash-mlarchive-link-alist
\r
126 + nil t nil nil "Gmane"))
\r
127 + notmuch-show-stash-mlarchive-link-alist))
\r
128 + (substring (notmuch-show-get-message-id) 4 -1))))
\r
130 +(defun notmuch-show-stash-mlarchive-link-and-go ()
\r
131 + "Copy an ML Archive URI for the current message to the kill-ring and visit it.
\r
133 +This presumes that the message is available at the selected Mailing List Archive.
\r
135 +Also see `notmuch-show-stash-mlarchive-link-alist'."
\r
137 - (let ((uri (concat "http://mid.gmane.org/"
\r
138 - (substring (notmuch-show-get-message-id) 4 -1))))
\r
139 - (notmuch-common-do-stash uri)
\r
140 - (browse-url uri)))
\r
141 + (notmuch-show-stash-mlarchive-link)
\r
142 + (browse-url (current-kill 0 t)))
\r
144 ;; Commands typically bound to buttons.
\r
146 diff --git a/test/emacs b/test/emacs
\r
147 index 5f7467d..4e08726 100755
\r
150 @@ -382,7 +382,7 @@ test_emacs '(notmuch-show "id:\"bought\"")
\r
151 (notmuch-show-stash-message-id-stripped)
\r
152 (notmuch-show-stash-tags)
\r
153 (notmuch-show-stash-filename)
\r
154 - (notmuch-show-stash-gmane)
\r
155 + (notmuch-show-stash-mlarchive-link)
\r
157 (generate-new-buffer "*test-stashing*"))
\r