[PATCH v2 02/11] contrib: pick: Link in notmuch-show-pipe-message
authorMark Walters <markwalters1009@gmail.com>
Sun, 18 Aug 2013 12:14:30 +0000 (13:14 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:24 +0000 (09:56 -0800)
9a/32fa60aab62082a1030653914752771dcff623 [new file with mode: 0644]

diff --git a/9a/32fa60aab62082a1030653914752771dcff623 b/9a/32fa60aab62082a1030653914752771dcff623
new file mode 100644 (file)
index 0000000..86514de
--- /dev/null
@@ -0,0 +1,126 @@
+Return-Path: <markwalters1009@gmail.com>\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 907E5431FDB\r
+       for <notmuch@notmuchmail.org>; Sun, 18 Aug 2013 05:14:56 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       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 XYsMAz3I8O+K for <notmuch@notmuchmail.org>;\r
+       Sun, 18 Aug 2013 05:14:52 -0700 (PDT)\r
+Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com\r
+ [74.125.82.47])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 8F5BD431FD2   for <notmuch@notmuchmail.org>; Sun, 18 Aug 2013 05:14:48 -0700\r
+ (PDT)\r
+Received: by mail-wg0-f47.google.com with SMTP id j13so2649067wgh.2\r
+       for <notmuch@notmuchmail.org>; Sun, 18 Aug 2013 05:14:47 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+       bh=BPSCCiYgr5Y5KY76ki/xB+8QNp6X2uXe6tdA1F0/v+4=;\r
+       b=XWxEbpoEghmNefyyfVAEq7/vU9pbqJ1RUX4fjh4vhfP9OE7dwft3ZK3FFpQvAa0z4P\r
+       DH0epl4siypzSeN8gloLdJ9ignYml4dc9M4HHEbYasMPEbxMza6FhSURUnkAEh7BjbTH\r
+       IIzKw5WOkeTJ5pYJDAqns9ORdkXzwBQizWxqgI0+e0/vEIxbLzCjspGDLpCZAsPYmABm\r
+       Bxn9iDO867OYLic+DEMHL/DcW+FW3C33HhILCheXcREnXOC/Vq3woaJGAnAFqwYJn6pR\r
+       aBFfRqpm7gGAUzoEPt7YIh41xSU7PC6gXixWVrVBKf3421B4qO0RYKl8tKTeS969m+Kw\r
+       5HBg==\r
+X-Received: by 10.180.89.101 with SMTP id bn5mr4532011wib.39.1376828087510;\r
+       Sun, 18 Aug 2013 05:14:47 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPSA id v9sm9277608wiw.8.1969.12.31.16.00.00\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Sun, 18 Aug 2013 05:14:47 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 02/11] contrib: pick: Link in notmuch-show-pipe-message\r
+Date: Sun, 18 Aug 2013 13:14:30 +0100\r
+Message-Id: <1376828079-21455-3-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1376828079-21455-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1376828079-21455-1-git-send-email-markwalters1009@gmail.com>\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: Sun, 18 Aug 2013 12:14:56 -0000\r
+\r
+Since we can now use show functions directly in pick we can drop pick-pipe-message.\r
+---\r
+ contrib/notmuch-pick/notmuch-pick.el |   31 ++-----------------------------\r
+ 1 files changed, 2 insertions(+), 29 deletions(-)\r
+\r
+diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
+index 04e37ee..22ade72 100644\r
+--- a/contrib/notmuch-pick/notmuch-pick.el\r
++++ b/contrib/notmuch-pick/notmuch-pick.el\r
+@@ -190,6 +190,8 @@ if the user has loaded a different buffer in that window.")\r
+ (defvar notmuch-pick-mode-map\r
+   (let ((map (make-sparse-keymap)))\r
+     (define-key map [mouse-1] 'notmuch-pick-show-message)\r
++    ;; these use notmuch-show functions directly\r
++    (define-key map "|" 'notmuch-show-pipe-message)\r
+     (define-key map "q" 'notmuch-pick-quit)\r
+     (define-key map "x" 'notmuch-pick-quit)\r
+     (define-key map "?" 'notmuch-help)\r
+@@ -205,7 +207,6 @@ if the user has loaded a different buffer in that window.")\r
+     (define-key map "p" 'notmuch-pick-prev-matching-message)\r
+     (define-key map "N" 'notmuch-pick-next-message)\r
+     (define-key map "P" 'notmuch-pick-prev-message)\r
+-    (define-key map "|" 'notmuch-pick-pipe-message)\r
+     (define-key map "-" 'notmuch-pick-remove-tag)\r
+     (define-key map "+" 'notmuch-pick-add-tag)\r
+     (define-key map " " 'notmuch-pick-scroll-or-next)\r
+@@ -586,34 +587,6 @@ message will be \"unarchived\", i.e. the tag changes in\r
+   (notmuch-pick-close-message-window)\r
+   (notmuch-mua-new-reply (notmuch-pick-get-message-id) prompt-for-sender nil))\r
\r
+-;; Shamelessly stolen from notmuch-show.el: maybe should be unified.\r
+-(defun notmuch-pick-pipe-message (command)\r
+-  "Pipe the contents of the current message to the given command.\r
+-\r
+-The given command will be executed with the raw contents of the\r
+-current email message as stdin. Anything printed by the command\r
+-to stdout or stderr will appear in the *notmuch-pipe* buffer.\r
+-\r
+-When invoked with a prefix argument, the command will receive all\r
+-open messages in the current thread (formatted as an mbox) rather\r
+-than only the current message."\r
+-  (interactive "sPipe message to command: ")\r
+-  (let ((shell-command\r
+-       (concat notmuch-command " show --format=raw "\r
+-               (shell-quote-argument (notmuch-pick-get-message-id)) " | " command))\r
+-       (buf (get-buffer-create (concat "*notmuch-pipe*"))))\r
+-    (with-current-buffer buf\r
+-      (setq buffer-read-only nil)\r
+-      (erase-buffer)\r
+-      (let ((exit-code (call-process-shell-command shell-command nil buf)))\r
+-      (goto-char (point-max))\r
+-      (set-buffer-modified-p nil)\r
+-      (setq buffer-read-only t)\r
+-      (unless (zerop exit-code)\r
+-        (switch-to-buffer-other-window buf)\r
+-        (message (format "Command '%s' exited abnormally with code %d"\r
+-                         shell-command exit-code)))))))\r
+-\r
+ (defun notmuch-pick-clean-address (address)\r
+   "Try to clean a single email ADDRESS for display. Return\r
+ AUTHOR_NAME if present, otherwise return AUTHOR_EMAIL. Return\r
+-- \r
+1.7.9.1\r
+\r