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