From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 33AC5431FB6 for ; Thu, 26 Jan 2012 05:09:43 -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 WgtjOqDPAYw4 for ; Thu, 26 Jan 2012 05:09:42 -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 23367431FAE for ; Thu, 26 Jan 2012 05:09:42 -0800 (PST) Received: by wgbdt12 with SMTP id dt12so499056wgb.2 for ; Thu, 26 Jan 2012 05:09:41 -0800 (PST) Received: by 10.180.80.8 with SMTP id n8mr3392346wix.14.1327583380892; Thu, 26 Jan 2012 05:09:40 -0800 (PST) Received: from localhost ([109.131.116.159]) by mx.google.com with ESMTPS id fr8sm12394010wib.10.2012.01.26.05.09.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Jan 2012 05:09:40 -0800 (PST) From: Pieter Praet To: David Edmondson Subject: Re: [PATCH] emacs: Add `notmuch-show-stash-gmane' and `notmuch-show-stash-gmane-and-go'. In-Reply-To: References: <1327397873-20596-1-git-send-email-dme@dme.org> <1327452608-8247-1-git-send-email-pieter@praet.org> User-Agent: Notmuch/0.11+132~ga81001f (http://notmuchmail.org) Emacs/23.3.1 (x86_64-unknown-linux-gnu) Date: Thu, 26 Jan 2012 14:07:44 +0100 Message-ID: <87pqe6vcgv.fsf@praet.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Thu, 26 Jan 2012 13:09:43 -0000 On Wed, 25 Jan 2012 06:31:43 +0000, David Edmondson wrote: > 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. > > > > +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 > > > > --- > > emacs/notmuch-show.el | 40 ++++++++++++++++++++++++++++++---------- > > test/emacs | 2 +- > > 2 files changed, 31 insertions(+), 11 deletions(-) > > > > 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))) > > > > +(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=mid&q=") > > + ;; (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? > I've found the missing Message-Id search URI for 'marc.info', but as for the remaining services: if they provide search by Message-Id, they're pretty damn good at hiding it... > 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? > Definitely. Patch follows. > > + > > (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))) > > > > -(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. > > > > -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)))) > > > > -(defun notmuch-show-stash-gmane-and-go () > > - "Copy a Gmane URI for the current message to the kill-ring and visit it. > > +(defun notmuch-show-stash-mlarchive-link-and-go () > > + "Copy an ML Archive URI for the current message to the kill-ring and visit it. > > > > -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) > > -- > > 1.7.8.1 > > Peace -- Pieter