Re: [PATCH] emacs: Add `notmuch-show-stash-gmane' and `notmuch-show-stash-gmane-and...
authorPieter Praet <pieter@praet.org>
Wed, 25 Jan 2012 00:50:08 +0000 (01:50 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:43:11 +0000 (09:43 -0800)
02/0e386461db94568a7f142668f1cdd49bda8609 [new file with mode: 0644]

diff --git a/02/0e386461db94568a7f142668f1cdd49bda8609 b/02/0e386461db94568a7f142668f1cdd49bda8609
new file mode 100644 (file)
index 0000000..1898c06
--- /dev/null
@@ -0,0 +1,159 @@
+Return-Path: <pieter@praet.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 E94D9431E84\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:52:09 -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 R4WgfgeNQEH4 for <notmuch@notmuchmail.org>;\r
+       Tue, 24 Jan 2012 16:52:09 -0800 (PST)\r
+Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id DC5A1431FB6\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:52:08 -0800 (PST)\r
+Received: by werb10 with SMTP id b10so3983088wer.26\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:52:07 -0800 (PST)\r
+MIME-Version: 1.0\r
+Received: by 10.216.135.194 with SMTP id u44mr8073921wei.40.1327452727746;\r
+       Tue, 24 Jan 2012 16:52:07 -0800 (PST)\r
+Received: from localhost ([109.131.95.182])\r
+       by mx.google.com with ESMTPS id fv6sm57923216wib.8.2012.01.24.16.52.06\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Tue, 24 Jan 2012 16:52:07 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: David Edmondson <dme@dme.org>\r
+Subject: Re: [PATCH] emacs: Add `notmuch-show-stash-gmane' and\r
+       `notmuch-show-stash-gmane-and-go'.\r
+Date: Wed, 25 Jan 2012 01:50:08 +0100\r
+Message-Id: <1327452608-8247-1-git-send-email-pieter@praet.org>\r
+X-Mailer: git-send-email 1.7.8.1\r
+In-Reply-To: <1327397873-20596-1-git-send-email-dme@dme.org>\r
+References: <1327397873-20596-1-git-send-email-dme@dme.org>\r
+X-Gm-Message-State:\r
+ ALoCoQnJ/YFGZKHwi8SR7QQgK8F/TRTSw+ySUmERuGmMLcc2RGT+z49czwE1c/au6m4A/UJbzg3r\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 00:52:10 -0000\r
+\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
+\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
+Peace\r
+\r
+---\r
+ emacs/notmuch-show.el |   40 ++++++++++++++++++++++++++++++----------\r
+ test/emacs            |    2 +-\r
+ 2 files changed, 31 insertions(+), 11 deletions(-)\r
+\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
\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=mid&q=")\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
+ (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 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
\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
\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
\r
+-(defun notmuch-show-stash-gmane-and-go ()\r
+-  "Copy a Gmane URI for the current message to the kill-ring and visit it.\r
++(defun notmuch-show-stash-mlarchive-link-and-go ()\r
++  "Copy an ML Archive URI for the current message to the kill-ring and visit it.\r
\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
+-- \r
+1.7.8.1\r
+\r