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 7CDE7431FBD
\r
6 for <notmuch@notmuchmail.org>; Sun, 9 Jun 2013 21:57:39 -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 TDntXN-XA0Mx for <notmuch@notmuchmail.org>;
\r
18 Sun, 9 Jun 2013 21:57:33 -0700 (PDT)
\r
19 Received: from mail-ea0-f181.google.com (mail-ea0-f181.google.com
\r
20 [209.85.215.181]) (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 830D7431FAE
\r
23 for <notmuch@notmuchmail.org>; Sun, 9 Jun 2013 21:57:28 -0700 (PDT)
\r
24 Received: by mail-ea0-f181.google.com with SMTP id a15so2677002eae.40
\r
25 for <notmuch@notmuchmail.org>; Sun, 09 Jun 2013 21:57:27 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
28 bh=wBG1+1pCLZMzHDVDNynoav9nTrCQGJm1HWvowPQcPRM=;
\r
29 b=MqLHFBXw/d7lt6KnuOu6CAeix1oGpHoJLJP5wjeoumD4zT4w/O3HvjvW6U8gJ+o3Dr
\r
30 DIOtnu36FpGjaqatSkBm9dJQqXISofHJlxJq/rNI4d8PT86MbtkiG8pJl88d8C62TkQn
\r
31 s47LluvNgNCiYdeOXOCDQyJI5kttG1uLlT53s448VfgBCb0Fcz0jiLuF8zc6GbC99hW8
\r
32 sP75A7kEe6s1r8fTkFC57ayNJS4DQDk29LAWuuIeJ/RhSb/skRw6y5bzK6uBhjS10lpX
\r
33 zAGOB5nLWVkm1N9yIwt/oQaQUibnm6BdVmGEVrSfZ12lW4TedOIcW2gVNuLzCXWiYIOF
\r
35 X-Received: by 10.15.23.194 with SMTP id h42mr8823594eeu.123.1370840247451;
\r
36 Sun, 09 Jun 2013 21:57: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 bk1sm20281322eeb.5.2013.06.09.21.57.26
\r
39 for <multiple recipients>
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Sun, 09 Jun 2013 21:57:27 -0700 (PDT)
\r
42 From: Mark Walters <markwalters1009@gmail.com>
\r
43 To: notmuch@notmuchmail.org,
\r
44 Austin Clements <aclements@csail.mit.edu>
\r
45 Subject: [PATCH v5 5/6] emacs: show move addition of :notmuch-part to separate
\r
47 Date: Mon, 10 Jun 2013 05:57:12 +0100
\r
48 Message-Id: <1370840233-23258-6-git-send-email-markwalters1009@gmail.com>
\r
49 X-Mailer: git-send-email 1.7.9.1
\r
50 In-Reply-To: <1370840233-23258-1-git-send-email-markwalters1009@gmail.com>
\r
51 References: <1370840233-23258-1-git-send-email-markwalters1009@gmail.com>
\r
52 X-BeenThere: notmuch@notmuchmail.org
\r
53 X-Mailman-Version: 2.1.13
\r
55 List-Id: "Use and development of the notmuch mail system."
\r
56 <notmuch.notmuchmail.org>
\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
58 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
60 List-Post: <mailto:notmuch@notmuchmail.org>
\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
63 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
64 X-List-Received-Date: Mon, 10 Jun 2013 04:57:39 -0000
\r
66 This separates out the adding of the :notmuch-part text property to a
\r
67 separate function to simplify calling from the lazy part insertion
\r
70 emacs/notmuch-show.el | 39 ++++++++++++++++++++++-----------------
\r
71 1 files changed, 22 insertions(+), 17 deletions(-)
\r
73 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
74 index 43aa88b..6ec70c9 100644
\r
75 --- a/emacs/notmuch-show.el
\r
76 +++ b/emacs/notmuch-show.el
\r
77 @@ -807,6 +807,27 @@ message at DEPTH in the current thread."
\r
78 ;; Return true if we created an overlay.
\r
81 +(defun notmuch-show-record-part-information (part beg end)
\r
82 + "Store PART as a text property from BEG to END"
\r
84 + ;; Record part information. Since we already inserted subparts,
\r
85 + ;; don't override existing :notmuch-part properties.
\r
86 + (notmuch-map-text-property beg end :notmuch-part
\r
87 + (lambda (v) (or v part)))
\r
88 + ;; Make :notmuch-part front sticky and rear non-sticky so it stays
\r
89 + ;; applied to the beginning of each line when we indent the
\r
90 + ;; message. Since we're operating on arbitrary renderer output,
\r
91 + ;; watch out for sticky specs of t, which means all properties are
\r
92 + ;; front-sticky/rear-nonsticky.
\r
93 + (notmuch-map-text-property beg end 'front-sticky
\r
94 + (lambda (v) (if (listp v)
\r
95 + (pushnew :notmuch-part v)
\r
97 + (notmuch-map-text-property beg end 'rear-nonsticky
\r
98 + (lambda (v) (if (listp v)
\r
99 + (pushnew :notmuch-part v)
\r
102 (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
\r
103 "Insert the body part PART at depth DEPTH in the current thread.
\r
105 @@ -836,23 +857,7 @@ If HIDE is non-nil then initially hide this part."
\r
108 (notmuch-show-toggle-part-invisibility button)))
\r
109 - ;; Record part information. Since we already inserted subparts,
\r
110 - ;; don't override existing :notmuch-part properties.
\r
111 - (notmuch-map-text-property beg (point) :notmuch-part
\r
112 - (lambda (v) (or v part)))
\r
113 - ;; Make :notmuch-part front sticky and rear non-sticky so it stays
\r
114 - ;; applied to the beginning of each line when we indent the
\r
115 - ;; message. Since we're operating on arbitrary renderer output,
\r
116 - ;; watch out for sticky specs of t, which means all properties are
\r
117 - ;; front-sticky/rear-nonsticky.
\r
118 - (notmuch-map-text-property beg (point) 'front-sticky
\r
119 - (lambda (v) (if (listp v)
\r
120 - (pushnew :notmuch-part v)
\r
122 - (notmuch-map-text-property beg (point) 'rear-nonsticky
\r
123 - (lambda (v) (if (listp v)
\r
124 - (pushnew :notmuch-part v)
\r
126 + (notmuch-show-record-part-information part beg (point))))
\r
128 (defun notmuch-show-insert-body (msg body depth)
\r
129 "Insert the body BODY at depth DEPTH in the current thread."
\r