Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 37 / 9c8178e9c93f5ab96824ea1a98e971eefb6158
1 Return-Path: <jrollins@finestructure.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 4B634431FB6\r
6         for <notmuch@notmuchmail.org>; Mon,  7 May 2012 00:02:16 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id YnXVyNZhixXR for <notmuch@notmuchmail.org>;\r
16         Mon,  7 May 2012 00:02:15 -0700 (PDT)\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
18         [131.215.239.19])\r
19         by olra.theworths.org (Postfix) with ESMTP id 4B354431FAE\r
20         for <notmuch@notmuchmail.org>; Mon,  7 May 2012 00:02:15 -0700 (PDT)\r
21 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
22         by earth-doxen-postvirus (Postfix) with ESMTP id CBA6F66E0103\r
23         for <notmuch@notmuchmail.org>; Mon,  7 May 2012 00:02:12 -0700 (PDT)\r
24 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
25 Received: from finestructure.net (66-189-196-221.dhcp.yakm.wa.charter.com\r
26         [66.189.196.221]) (Authenticated sender: jrollins)\r
27         by earth-doxen-submit (Postfix) with ESMTP id E067566E00D8\r
28         for <notmuch@notmuchmail.org>; Mon,  7 May 2012 00:02:10 -0700 (PDT)\r
29 Received: by finestructure.net (Postfix, from userid 1000)\r
30         id ED5EE54F; Mon,  7 May 2012 00:02:09 -0700 (PDT)\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 To: Notmuch Mail <notmuch@notmuchmail.org>\r
33 Subject: [PATCH] emacs: add pipe attachment command\r
34 Date: Mon,  7 May 2012 00:02:09 -0700\r
35 Message-Id: <1336374129-10225-1-git-send-email-jrollins@finestructure.net>\r
36 X-Mailer: git-send-email 1.7.10\r
37 In-Reply-To: <1336221076-3671-1-git-send-email-markwalters1009@gmail.com>\r
38 References: <1336221076-3671-1-git-send-email-markwalters1009@gmail.com>\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Mon, 07 May 2012 07:02:16 -0000\r
52 \r
53 From: Mark Walters <markwalters1009@gmail.com>\r
54 \r
55 Allow the user to pipe the attachment somewhere. Bound to '|' on the\r
56 attachment button.\r
57 \r
58 Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>\r
59 ---\r
60 Nice missing feature.  Tested and reviewed.  It just needed to be\r
61 rebased against the current master.\r
62 \r
63  emacs/notmuch-show.el |   10 ++++++++++\r
64  1 file changed, 10 insertions(+)\r
65 \r
66 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
67 index d318430..26bff8f 100644\r
68 --- a/emacs/notmuch-show.el\r
69 +++ b/emacs/notmuch-show.el\r
70 @@ -453,6 +453,7 @@ message at DEPTH in the current thread."\r
71      (define-key map "s" 'notmuch-show-part-button-save)\r
72      (define-key map "v" 'notmuch-show-part-button-view)\r
73      (define-key map "o" 'notmuch-show-part-button-interactively-view)\r
74 +    (define-key map "|" 'notmuch-show-part-button-pipe)\r
75      map)\r
76    "Submap for button commands")\r
77  (fset 'notmuch-show-part-button-map notmuch-show-part-button-map)\r
78 @@ -524,6 +525,11 @@ message at DEPTH in the current thread."\r
79      (let ((handle (mm-make-handle (current-buffer) (list content-type))))\r
80        (mm-interactively-view-part handle))))\r
81  \r
82 +(defun notmuch-show-pipe-part (message-id nth &optional filename content-type)\r
83 +  (notmuch-with-temp-part-buffer message-id nth\r
84 +    (let ((handle (mm-make-handle (current-buffer) (list content-type))))\r
85 +      (mm-pipe-part handle))))\r
86 +\r
87  (defun notmuch-show-multipart/*-to-list (part)\r
88    (mapcar (lambda (inner-part) (plist-get inner-part :content-type))\r
89           (plist-get part :content)))\r
90 @@ -1874,6 +1880,10 @@ the user (see `notmuch-show-stash-mlarchive-link-alist')."\r
91    (interactive)\r
92    (notmuch-show-part-button-internal button #'notmuch-show-interactively-view-part))\r
93  \r
94 +(defun notmuch-show-part-button-pipe (&optional button)\r
95 +  (interactive)\r
96 +  (notmuch-show-part-button-internal button #'notmuch-show-pipe-part))\r
97 +\r
98  (defun notmuch-show-part-button-internal (button handler)\r
99    (let ((button (or button (button-at (point)))))\r
100      (if button\r
101 -- \r
102 1.7.10\r
103 \r