Re: [PATCH] emacs: Add `notmuch-show-stash-gmane' and `notmuch-show-stash-gmane-and...
authorDavid Edmondson <dme@dme.org>
Wed, 25 Jan 2012 06:31:43 +0000 (06:31 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:43:12 +0000 (09:43 -0800)
f5/e464e769abd8096fd48277110629827e3a80a6 [new file with mode: 0644]

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