1 Return-Path: <markwalters1009@gmail.com>
\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 D4CDE431FAF
\r
6 for <notmuch@notmuchmail.org>; Sat, 4 May 2013 06:01:33 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id xtJAYDQnDQJu for <notmuch@notmuchmail.org>;
\r
18 Sat, 4 May 2013 06:01:28 -0700 (PDT)
\r
19 Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com
\r
20 [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 29B90431FB6
\r
23 for <notmuch@notmuchmail.org>; Sat, 4 May 2013 06:01:28 -0700 (PDT)
\r
24 Received: by mail-wi0-f179.google.com with SMTP id l13so1365123wie.6
\r
25 for <notmuch@notmuchmail.org>; Sat, 04 May 2013 06:01:27 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to
\r
28 :references; bh=b2dzy7QmwGFP+t+dbduyCCJCKQvVTX9zeZNIO0wy4GY=;
\r
29 b=q5PGVB2aSnPkVJVlSWvI9Y7COul9DmT7VSR2tjiu7whViE8V/BnJ6gLn2yPRvP9dKj
\r
30 +c/+62LTidvumvO7uFNL3vdnfAWP6V17yso6T3NO85dtkhpJJrrGBCvaXTCq4EMTu7pV
\r
31 3M9LbC40Pwgke+vjJ8SJI6FLdRXrB2qxcaylY6gifhXWUW+tMukiovHdFgFEq2xfoWnK
\r
32 Y9fiaLClKNDJDRYhgIEFp12Z1/79XtUBq2ErmPspIkeSH3KmgAtayxcsyVkn0ZtrjjQA
\r
33 +oFsCT0j+o/jNi46+TnVKdX9fFlTyCiLX+lW8nuBBz6IofOSLGGm+yBjtVwtJBcsMVvk
\r
35 X-Received: by 10.194.5.196 with SMTP id u4mr18216453wju.54.1367672487061;
\r
36 Sat, 04 May 2013 06:01:27 -0700 (PDT)
\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])
\r
38 by mx.google.com with ESMTPSA id x13sm3143486wib.3.2013.05.04.06.01.26
\r
39 for <multiple recipients>
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Sat, 04 May 2013 06:01:26 -0700 (PDT)
\r
42 From: Mark Walters <markwalters1009@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH 1/4] emacs:show: separate out handling of
\r
45 application/octet-stream
\r
46 Date: Sat, 4 May 2013 14:01:14 +0100
\r
47 Message-Id: <1367672478-12247-2-git-send-email-markwalters1009@gmail.com>
\r
48 X-Mailer: git-send-email 1.7.9.1
\r
49 In-Reply-To: <1367672478-12247-1-git-send-email-markwalters1009@gmail.com>
\r
50 References: <1367672478-12247-1-git-send-email-markwalters1009@gmail.com>
\r
51 X-BeenThere: notmuch@notmuchmail.org
\r
52 X-Mailman-Version: 2.1.13
\r
54 List-Id: "Use and development of the notmuch mail system."
\r
55 <notmuch.notmuchmail.org>
\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
59 List-Post: <mailto:notmuch@notmuchmail.org>
\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
63 X-List-Received-Date: Sat, 04 May 2013 13:01:34 -0000
\r
65 Currently mime parts are basically handled based on their mime-type
\r
66 with the exception of application/octet-stream parts. Deal with these
\r
67 parts at the top level (notmuch-show-insert-bodypart).
\r
69 This is needed later in the series as we need to put in a part button
\r
70 for each part (which means knowing its mime type) while deferring the
\r
71 actual insertion of the part.
\r
73 emacs/notmuch-show.el | 19 +++++++++++--------
\r
74 1 files changed, 11 insertions(+), 8 deletions(-)
\r
76 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
77 index face2a0..3b9a2ad 100644
\r
78 --- a/emacs/notmuch-show.el
\r
79 +++ b/emacs/notmuch-show.el
\r
80 @@ -796,9 +796,9 @@ message at DEPTH in the current thread."
\r
81 (defun notmuch-show-insert-part-text/x-vcalendar (msg part content-type nth depth declared-type)
\r
82 (notmuch-show-insert-part-text/calendar msg part content-type nth depth declared-type))
\r
84 -(defun notmuch-show-insert-part-application/octet-stream (msg part content-type nth depth declared-type)
\r
85 +(defun notmuch-show-get-mime-type-of-application/octet-stream (part)
\r
86 ;; If we can deduce a MIME type from the filename of the attachment,
\r
87 - ;; do so and pass it on to the handler for that type.
\r
88 + ;; we return that.
\r
89 (if (plist-get part :filename)
\r
90 (let ((extension (file-name-extension (plist-get part :filename)))
\r
92 @@ -808,7 +808,7 @@ message at DEPTH in the current thread."
\r
93 (setq mime-type (mailcap-extension-to-mime extension))
\r
95 (not (string-equal mime-type "application/octet-stream")))
\r
96 - (notmuch-show-insert-bodypart-internal msg part mime-type nth depth content-type)
\r
101 @@ -885,11 +885,14 @@ message at DEPTH in the current thread."
\r
102 "Insert the body part PART at depth DEPTH in the current thread.
\r
104 If HIDE is non-nil then initially hide this part."
\r
105 - (let ((content-type (downcase (plist-get part :content-type)))
\r
106 - (nth (plist-get part :id))
\r
109 - (notmuch-show-insert-bodypart-internal msg part content-type nth depth content-type)
\r
110 + (let* ((content-type (downcase (plist-get part :content-type)))
\r
111 + (mime-type (or (and (string= content-type "application/octet-stream")
\r
112 + (notmuch-show-get-mime-type-of-application/octet-stream part))
\r
114 + (nth (plist-get part :id))
\r
117 + (notmuch-show-insert-bodypart-internal msg part mime-type nth depth content-type)
\r
118 ;; Some of the body part handlers leave point somewhere up in the
\r
119 ;; part, so we make sure that we're down at the end.
\r
120 (goto-char (point-max))
\r