Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id AC6D2431E84 for ; Tue, 24 Jan 2012 22:31:51 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9xqAbl6VU6rs for ; Tue, 24 Jan 2012 22:31:48 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 981F5431FB6 for ; Tue, 24 Jan 2012 22:31:48 -0800 (PST) Received: by wgbdt12 with SMTP id dt12so4456525wgb.2 for ; Tue, 24 Jan 2012 22:31:47 -0800 (PST) Received: by 10.180.14.72 with SMTP id n8mr25863631wic.22.1327473107355; Tue, 24 Jan 2012 22:31:47 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id eq5sm60265491wib.2.2012.01.24.22.31.45 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jan 2012 22:31:46 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id 46F129FD47; Wed, 25 Jan 2012 06:31:44 +0000 (GMT) To: Pieter Praet Subject: Re: [PATCH] emacs: Add `notmuch-show-stash-gmane' and `notmuch-show-stash-gmane-and-go'. In-Reply-To: <1327452608-8247-1-git-send-email-pieter@praet.org> References: <1327397873-20596-1-git-send-email-dme@dme.org> <1327452608-8247-1-git-send-email-pieter@praet.org> User-Agent: Notmuch/0.11+105~g08b3b0f (http://notmuchmail.org) Emacs/24.0.92.1 (x86_64-pc-linux-gnu) From: David Edmondson Date: Wed, 25 Jan 2012 06:31:43 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Gm-Message-State: ALoCoQl9RUrwfQ9uSB6Tb8G+q1NRDWUJMm0zSZMVYyK61BcQDhsuULmVzbX8W+IfStb5f/iIv1JJ Cc: Notmuch Mail X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 06:31:51 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 25 Jan 2012 01:50:08 +0100, Pieter Praet wrote: > In a perfect world, everyone would be using Notmuch and have a local > copy of every message ever sent to any ML. While we're waiting for > Atlantis to resurface, we'll need an interim solution. >=20 > +1 for the idea, but Gmane doesn't archive *all* MLs, so we should leave > the user some legroom. Since I've already made the necessary changes, > I'll just send the patch instead of wasting your time with suggestions. > Feel free to merge it into yours. This is definitely a good idea, but... > Peace >=20 > --- > emacs/notmuch-show.el | 40 ++++++++++++++++++++++++++++++---------- > test/emacs | 2 +- > 2 files changed, 31 insertions(+), 11 deletions(-) >=20 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index c4d45e7..7f209cd 100644 > --- a/emacs/notmuch-show.el > +++ b/emacs/notmuch-show.el > @@ -123,6 +123,24 @@ indentation." > (const :tag "View interactively" > notmuch-show-interactively-view-part))) >=20=20 > +(defcustom notmuch-show-stash-mlarchive-link-pref "http://mid.gmane.org/" > + "Default Mailing List Archive to use when stashing links." > + :group 'notmuch-show > + ;; TODO: find a working `Message-Id' search arg for all options. > + :type '(choice (const :tag "Gmane" > + "http://mid.gmane.org/") > + ;; (const :tag "MARC" > + ;; "http://marc.info/") > + (const :tag "Mail Archive, The" > + "http://www.mail-archive.com/search?l=3Dmid&q=3D") > + ;; (const :tag "MarkMail" > + ;; "http://markmail.org/") > + ;; (const :tag "opensubscriber" > + ;; "http://opensubscriber.com/") > + ;; (const :tag "Nabble" > + ;; "http://nabble.com/") > + (string :tag "Custom URI"))) ...do we not now how to reference messages by message-id on these other services? Your point about Gmane not having everything applies equally to any service, suggesting that perhaps the user should also have an option to choose which service to use at stash time. Thoughts? > + > (defmacro with-current-notmuch-show-message (&rest body) > "Evaluate body with current buffer set to the text of current message" > `(save-excursion > @@ -1016,8 +1034,8 @@ thread id. If a prefix is given, crypto processing= is toggled." > (define-key map "s" 'notmuch-show-stash-subject) > (define-key map "T" 'notmuch-show-stash-tags) > (define-key map "t" 'notmuch-show-stash-to) > - (define-key map "g" 'notmuch-show-stash-gmane) > - (define-key map "G" 'notmuch-show-stash-gmane-and-go) > + (define-key map "l" 'notmuch-show-stash-mlarchive-link) > + (define-key map "L" 'notmuch-show-stash-mlarchive-link-and-go) > map) > "Submap for stash commands") > (fset 'notmuch-show-stash-map notmuch-show-stash-map) > @@ -1605,20 +1623,22 @@ buffer." > (interactive) > (notmuch-common-do-stash (notmuch-show-get-to))) >=20=20 > -(defun notmuch-show-stash-gmane () > - "Copy a Gmane URI for the current message to the kill-ring. > +(defun notmuch-show-stash-mlarchive-link () > + "Copy an ML Archive URI for the current message to the kill-ring. >=20=20 > -This presumes that the message is available at Gmane." > +This presumes that the message is available at the Mailing List Archive > +configured in `notmuch-show-stash-mlarchive-link-pref'." > (interactive) > - (notmuch-common-do-stash (concat "http://mid.gmane.org/" > + (notmuch-common-do-stash (concat notmuch-show-stash-mlarchive-link-pref > (substring (notmuch-show-get-message-id) 4 -1)))) >=20=20 > -(defun notmuch-show-stash-gmane-and-go () > - "Copy a Gmane URI for the current message to the kill-ring and visit i= t. > +(defun notmuch-show-stash-mlarchive-link-and-go () > + "Copy an ML Archive URI for the current message to the kill-ring and v= isit it. >=20=20 > -This presumes that the message is available at Gmane." > +This presumes that the message is available at the Mailing List Archive > +configured in `notmuch-show-stash-mlarchive-link-pref'." > (interactive) > - (let ((uri (concat "http://mid.gmane.org/" > + (let ((uri (concat notmuch-show-stash-mlarchive-link-pref > (substring (notmuch-show-get-message-id) 4 -1)))) > (notmuch-common-do-stash uri) > (browse-url uri))) > diff --git a/test/emacs b/test/emacs > index 5f7467d..4e08726 100755 > --- a/test/emacs > +++ b/test/emacs > @@ -382,7 +382,7 @@ test_emacs '(notmuch-show "id:\"bought\"") > (notmuch-show-stash-message-id-stripped) > (notmuch-show-stash-tags) > (notmuch-show-stash-filename) > - (notmuch-show-stash-gmane) > + (notmuch-show-stash-mlarchive-link) > (switch-to-buffer > (generate-new-buffer "*test-stashing*")) > (dotimes (i 10) > --=20 > 1.7.8.1 >=20 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk8fodAACgkQaezQq/BJZRbGFgCgifUa9EZHlGu6Y0h0vZKcpjL6 FJcAnifPpAPRQpsUHz8///RYlVN5qEIp =Q42I -----END PGP SIGNATURE----- --=-=-=--