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 4B634431FB6 for ; Mon, 7 May 2012 00:02:16 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 YnXVyNZhixXR for ; Mon, 7 May 2012 00:02:15 -0700 (PDT) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id 4B354431FAE for ; Mon, 7 May 2012 00:02:15 -0700 (PDT) Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1]) by earth-doxen-postvirus (Postfix) with ESMTP id CBA6F66E0103 for ; Mon, 7 May 2012 00:02:12 -0700 (PDT) X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new Received: from finestructure.net (66-189-196-221.dhcp.yakm.wa.charter.com [66.189.196.221]) (Authenticated sender: jrollins) by earth-doxen-submit (Postfix) with ESMTP id E067566E00D8 for ; Mon, 7 May 2012 00:02:10 -0700 (PDT) Received: by finestructure.net (Postfix, from userid 1000) id ED5EE54F; Mon, 7 May 2012 00:02:09 -0700 (PDT) From: Jameson Graef Rollins To: Notmuch Mail Subject: [PATCH] emacs: add pipe attachment command Date: Mon, 7 May 2012 00:02:09 -0700 Message-Id: <1336374129-10225-1-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1336221076-3671-1-git-send-email-markwalters1009@gmail.com> References: <1336221076-3671-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: Mon, 07 May 2012 07:02:16 -0000 From: Mark Walters Allow the user to pipe the attachment somewhere. Bound to '|' on the attachment button. Signed-off-by: Jameson Graef Rollins --- Nice missing feature. Tested and reviewed. It just needed to be rebased against the current master. emacs/notmuch-show.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index d318430..26bff8f 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -453,6 +453,7 @@ message at DEPTH in the current thread." (define-key map "s" 'notmuch-show-part-button-save) (define-key map "v" 'notmuch-show-part-button-view) (define-key map "o" 'notmuch-show-part-button-interactively-view) + (define-key map "|" 'notmuch-show-part-button-pipe) map) "Submap for button commands") (fset 'notmuch-show-part-button-map notmuch-show-part-button-map) @@ -524,6 +525,11 @@ message at DEPTH in the current thread." (let ((handle (mm-make-handle (current-buffer) (list content-type)))) (mm-interactively-view-part handle)))) +(defun notmuch-show-pipe-part (message-id nth &optional filename content-type) + (notmuch-with-temp-part-buffer message-id nth + (let ((handle (mm-make-handle (current-buffer) (list content-type)))) + (mm-pipe-part handle)))) + (defun notmuch-show-multipart/*-to-list (part) (mapcar (lambda (inner-part) (plist-get inner-part :content-type)) (plist-get part :content))) @@ -1874,6 +1880,10 @@ the user (see `notmuch-show-stash-mlarchive-link-alist')." (interactive) (notmuch-show-part-button-internal button #'notmuch-show-interactively-view-part)) +(defun notmuch-show-part-button-pipe (&optional button) + (interactive) + (notmuch-show-part-button-internal button #'notmuch-show-pipe-part)) + (defun notmuch-show-part-button-internal (button handler) (let ((button (or button (button-at (point))))) (if button -- 1.7.10