1 Return-Path: <m.walters@qmul.ac.uk>
\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 C167F431FB6
\r
6 for <notmuch@notmuchmail.org>; Fri, 7 Dec 2012 00:10:02 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5
\r
12 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,
\r
13 NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id kLJ1mCMr7VnQ for <notmuch@notmuchmail.org>;
\r
17 Fri, 7 Dec 2012 00:10:02 -0800 (PST)
\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 294E6431FAE
\r
22 for <notmuch@notmuchmail.org>; Fri, 7 Dec 2012 00:10:02 -0800 (PST)
\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])
\r
24 by mail2.qmul.ac.uk with esmtp (Exim 4.71)
\r
25 (envelope-from <m.walters@qmul.ac.uk>)
\r
26 id 1Tgt0S-0007zr-SZ; Fri, 07 Dec 2012 08:10:01 +0000
\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)
\r
28 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)
\r
29 (envelope-from <m.walters@qmul.ac.uk>)
\r
30 id 1Tgt0S-0001Ax-Jm; Fri, 07 Dec 2012 08:10:00 +0000
\r
31 From: Mark Walters <markwalters1009@gmail.com>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: Re: [PATCH] emacs: show: make show-get-message-prop usable from pick
\r
34 In-Reply-To: <87ip8kszde.fsf@qmul.ac.uk>
\r
35 References: <1354483744-27541-1-git-send-email-markwalters1009@gmail.com>
\r
36 <1354486881-32456-1-git-send-email-markwalters1009@gmail.com>
\r
37 <87ip8kszde.fsf@qmul.ac.uk>
\r
38 User-Agent: Notmuch/0.14+81~g9730584 (http://notmuchmail.org) Emacs/23.4.1
\r
40 Date: Fri, 07 Dec 2012 08:09:59 +0000
\r
41 Message-ID: <87pq2m5lm0.fsf@qmul.ac.uk>
\r
43 Content-Type: text/plain; charset=us-ascii
\r
44 X-Sender-Host-Address: 93.97.24.31
\r
45 X-QM-SPAM-Info: Sender has good ham record. :)
\r
46 X-QM-Body-MD5: 135fd6ac426c3bcf669834b6fd99a5e3 (of first 20000 bytes)
\r
47 X-SpamAssassin-Score: -1.7
\r
48 X-SpamAssassin-SpamBar: -
\r
49 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
51 spam. We require at least 5.0 points to mark a message as spam.
\r
52 This message scored -1.7 points.
\r
53 Summary of the scoring:
\r
54 * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,
\r
56 * [138.37.6.40 listed in list.dnswl.org]
\r
57 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
58 provider * (markwalters1009[at]gmail.com)
\r
59 * 0.6 AWL AWL: From: address is in the auto white-list
\r
60 X-QM-Scan-Virus: ClamAV says the message is clean
\r
61 X-BeenThere: notmuch@notmuchmail.org
\r
62 X-Mailman-Version: 2.1.13
\r
64 List-Id: "Use and development of the notmuch mail system."
\r
65 <notmuch.notmuchmail.org>
\r
66 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
69 List-Post: <mailto:notmuch@notmuchmail.org>
\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
71 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
72 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
73 X-List-Received-Date: Fri, 07 Dec 2012 08:10:02 -0000
\r
76 Just in case anyone is thinking about this: there is a much better
\r
77 solution. I just redefine notmuch-show-get-prop in notmuch-pick and I
\r
78 can achieve exactly the same. Hence forget this patch/thread
\r
86 Mark Walters <markwalters1009@gmail.com> writes:
\r
90 > On Sun, 02 Dec 2012, Mark Walters <markwalters1009@gmail.com> wrote:
\r
91 >> Make notmuch-show-get-prop choose the get-message-properties routine
\r
92 >> based on the major mode. This make it usable from notmuch-pick and
\r
93 >> thus a large number of functions are usable directly from
\r
94 >> notmuch-show.el and do not need to be reimplemented in pick.
\r
97 >> Ok so the previous version was me being stupid. I was wanting to avoid
\r
98 >> errors caused by notmuch-pick-get-message-properties not existing but
\r
99 >> the obvious solution is just to define it in a trivial fashion as
\r
102 > and to continue the stupidity the first hunk is no longer needed: it's
\r
103 > just the second hunk now.
\r
108 >> Anyway would this be acceptable?
\r
115 >> emacs/notmuch-show.el | 10 +++++++++-
\r
116 >> 1 files changed, 9 insertions(+), 1 deletions(-)
\r
118 >> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
119 >> index 4d6c014..b7f64e3 100644
\r
120 >> --- a/emacs/notmuch-show.el
\r
121 >> +++ b/emacs/notmuch-show.el
\r
122 >> @@ -1378,6 +1378,10 @@ Some useful entries are:
\r
123 >> (notmuch-show-move-to-message-top)
\r
124 >> (get-text-property (point) :notmuch-message-properties)))
\r
126 >> +(defun notmuch-show-mode-get-message-properties ()
\r
127 >> + "Wrapper for notmuch-show-get-message-properties"
\r
128 >> + (notmuch-show-get-message-properties))
\r
130 >> (defun notmuch-show-set-prop (prop val &optional props)
\r
131 >> (let ((inhibit-read-only t)
\r
132 >> (props (or props
\r
133 >> @@ -1385,9 +1389,13 @@ Some useful entries are:
\r
134 >> (plist-put props prop val)
\r
135 >> (notmuch-show-set-message-properties props)))
\r
137 >> +(defun notmuch-pick-get-message-properties ())
\r
139 >> (defun notmuch-show-get-prop (prop &optional props)
\r
140 >> (let ((props (or props
\r
141 >> - (notmuch-show-get-message-properties))))
\r
142 >> + (if (eq major-mode 'notmuch-show-mode)
\r
143 >> + (notmuch-show-get-message-properties)
\r
144 >> + (notmuch-pick-get-message-properties)))))
\r
145 >> (plist-get props prop)))
\r
147 >> (defun notmuch-show-get-message-id (&optional bare)
\r