unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Edmondson <dme@dme.org>
To: Pieter Praet <pieter@praet.org>
Cc: Notmuch Mail <notmuch@notmuchmail.org>
Subject: Re: [PATCH] emacs: Add `notmuch-show-stash-gmane' and `notmuch-show-stash-gmane-and-go'.
Date: Wed, 25 Jan 2012 06:31:43 +0000	[thread overview]
Message-ID: <cunliownvhs.fsf@hotblack-desiato.hh.sledj.net> (raw)
In-Reply-To: <1327452608-8247-1-git-send-email-pieter@praet.org>

[-- Attachment #1: Type: text/plain, Size: 4815 bytes --]

On Wed, 25 Jan 2012 01:50:08 +0100, Pieter Praet <pieter@praet.org> 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?

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)))
>  
> -(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
> 

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2012-01-25  6:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-24  9:37 [PATCH] emacs: Add `notmuch-show-stash-gmane' and `notmuch-show-stash-gmane-and-go' David Edmondson
2012-01-25  0:50 ` Pieter Praet
2012-01-25  6:31   ` David Edmondson [this message]
2012-01-25 10:18     ` Tomi Ollila
2012-01-25 10:41       ` David Edmondson
2012-01-25 13:00         ` Tomi Ollila
2012-01-26 13:05           ` Pieter Praet
2012-01-26 13:07     ` Pieter Praet
2012-01-26 13:13       ` [RFC] " Pieter Praet
2012-01-26 14:40         ` David Edmondson
2012-01-27  8:42           ` Pieter Praet
2012-01-27  8:44             ` [PATCH v4?] emacs: add `notmuch-show-stash-mlarchive-link{,-and-go}' Pieter Praet
2012-01-27  9:18               ` [PATCH v4?] emacs: add `notmuch-show-stash-mlarchive-link{, -and-go}' David Edmondson
2012-01-30  7:18                 ` Pieter Praet
2012-01-27 16:36             ` [RFC] Re: [PATCH] emacs: Add `notmuch-show-stash-gmane' and `notmuch-show-stash-gmane-and-go' Dmitry Kurochkin
2012-01-30  7:19               ` Pieter Praet
2012-01-30  7:12 ` [PATCH v2 1/2] emacs: `notmuch-show-get-message-id': optionally return Message-Id sans prefix Pieter Praet
2012-01-30  8:29   ` David Edmondson
2012-01-30  7:12 ` [PATCH v2 2/2] emacs: add `notmuch-show-stash-mlarchive-link{, -and-go}' Pieter Praet
2012-01-30  8:30   ` David Edmondson
2012-02-19 20:50 ` [PATCH] emacs: Add `notmuch-show-stash-gmane' and `notmuch-show-stash-gmane-and-go' Pieter Praet
2012-02-19 20:50   ` [PATCH v6 1/3] emacs: `notmuch-show-get-message-id': optionally return Message-Id sans prefix Pieter Praet
2012-02-25 14:40     ` David Bremner
2012-02-28 18:40       ` Pieter Praet
2012-02-29 12:19         ` David Bremner
2012-03-01 17:12           ` Pieter Praet
2012-02-19 20:50   ` [PATCH v6 2/3] test: emacs: expand subtest "Stashing in notmuch-show" wrt stashing Mailing List Archive URIs Pieter Praet
2012-02-19 20:50   ` [PATCH v6 3/3] emacs: add `notmuch-show-stash-mlarchive-link{, -and-go}' Pieter Praet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cunliownvhs.fsf@hotblack-desiato.hh.sledj.net \
    --to=dme@dme.org \
    --cc=notmuch@notmuchmail.org \
    --cc=pieter@praet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).