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 1881F431FD7
\r
6 for <notmuch@notmuchmail.org>; Mon, 27 May 2013 00:35:32 -0700 (PDT)
\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 0pPOMqxPcs9Z for <notmuch@notmuchmail.org>;
\r
17 Mon, 27 May 2013 00:35:23 -0700 (PDT)
\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 81915431FAE
\r
22 for <notmuch@notmuchmail.org>; Mon, 27 May 2013 00:35:23 -0700 (PDT)
\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 1Ugrxh-0007Bp-D5; Mon, 27 May 2013 08:35:22 +0100
\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.71)
\r
29 (envelope-from <m.walters@qmul.ac.uk>)
\r
30 id 1Ugrxh-0002la-26; Mon, 27 May 2013 08:35:21 +0100
\r
31 From: Mark Walters <markwalters1009@gmail.com>
\r
32 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
\r
33 Subject: Re: [PATCH 1/2] contrib: pick: add thread based utility functions
\r
34 In-Reply-To: <87fvxswgff.fsf@zancas.localnet>
\r
35 References: <1354970914-18342-1-git-send-email-markwalters1009@gmail.com>
\r
36 <1354970914-18342-2-git-send-email-markwalters1009@gmail.com>
\r
37 <87fvxswgff.fsf@zancas.localnet>
\r
38 User-Agent: Notmuch/0.14+255~gff3cc55 (http://notmuchmail.org) Emacs/23.4.1
\r
40 Date: Mon, 27 May 2013 08:35:18 +0100
\r
41 Message-ID: <878v30kh8p.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: cb557fcb22de4c19ba253139540d261a (of first 20000 bytes)
\r
47 X-SpamAssassin-Score: -0.1
\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 -0.1 points.
\r
53 Summary of the scoring:
\r
54 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
55 provider * (markwalters1009[at]gmail.com)
\r
56 * -0.1 AWL AWL: From: address is in the auto white-list
\r
57 X-QM-Scan-Virus: ClamAV says the message is clean
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\r
61 List-Id: "Use and development of the notmuch mail system."
\r
62 <notmuch.notmuchmail.org>
\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
66 List-Post: <mailto:notmuch@notmuchmail.org>
\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
70 X-List-Received-Date: Mon, 27 May 2013 07:35:32 -0000
\r
75 David Bremner <david@tethera.net> writes:
\r
77 > Mark Walters <markwalters1009@gmail.com> writes:
\r
79 >> Previously notmuch-pick had no thread based functionality. This adds a
\r
80 >> macro to iterate through all messages in a thread. To simplify this it
\r
81 >> adds a text-property marker to the first message of each thread.
\r
84 >> +(defun notmuch-pick-get-messages-ids-thread ()
\r
85 >> + "Return all id: queries of messages in the current thread."
\r
86 >> + (let ((message-ids))
\r
87 >> + (notmuch-pick-thread-mapc
\r
88 >> + (lambda () (push (notmuch-pick-get-message-id) message-ids)))
\r
91 > As a style thing, it seems more idiomatic to me to have a map macro
\r
92 > which returns a sequence, rather than faking it with mapc and push. But
\r
93 > maybe that's a typical common lisp style, I don't know.
\r
95 I think I agree: this is very closely copied from notmuch-show
\r
96 (notmuch-show-mapc and notmuch-show-get-messages-id) so it is probably
\r
97 worth staying the same.
\r
99 > More importantly, in emacs 24.3 I get an infinite loop when trying to
\r
100 > evaluate the update notmuch-pick.el.
\r
102 I think this is just stupidity on my part: it should be a defun rather
\r
103 than a defmacro. Would you be able to test that (or I can send a new
\r
104 version if you prefer)?
\r
106 Also, how are you loading notmuch-pick? In my set up the macro and
\r
107 function work interchangeably.
\r
114 > The backtrace is below. I'm not a macro expert, but seems like too much
\r
115 > is happening at compile/eval time.
\r
117 > ----------------------------------------------------------------------
\r
119 > Debugger entered--Lisp error: (quit)
\r
120 > (save-excursion (beginning-of-line) (get-text-property (point) :notmuch-message-properties))
\r
121 > notmuch-pick-get-message-properties()
\r
122 > (or props (notmuch-pick-get-message-properties))
\r
123 > (let ((props (or props (notmuch-pick-get-message-properties)))) (plist-get props prop))
\r
124 > notmuch-pick-get-prop(:first)
\r
125 > (not (notmuch-pick-get-prop :first))
\r
126 > (while (not (notmuch-pick-get-prop :first)) (forward-line -1))
\r
127 > notmuch-pick-thread-top()
\r
128 > (save-excursion (notmuch-pick-thread-top) (progn (while (progn (progn (funcall function) (forward-line)) (and (notmuch-pick-get-message-properties) (not (notmuch-pick-get-prop :first))))) nil))
\r
129 > (lambda (function) "Iterate through all messages in the current thread\n and call FUNCTION for side effects." (save-excursion (notmuch-pick-thread-top) (progn (while (progn (progn (funcall function) (forward-line)) (and (notmuch-pick-get-message-properties) (not (notmuch-pick-get-prop :first))))) nil)))((lambda nil (push (notmuch-pick-get-message-id) message-ids)))
\r
130 > macroexpand((notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) nil)
\r
131 > macroexp--expand-all((notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))))
\r
132 > macroexp--all-forms(((notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids))
\r
133 > #[1028 "\300.\300\301.\302\"\303.
\a!.
\b@A#..@#\207" [macroexp--cons macroexp--all-clauses 1 macroexp--all-forms] 10 "\n\n(fn FORM BODY BINDINGS FUN)"](((let ((message-ids)) (notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids)) ((notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids) ((message-ids)) let)
\r
134 > macroexp--expand-all((let ((message-ids)) (notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids))
\r
135 > macroexp--all-forms((lambda nil "Return all id: queries of messages in the current thread." (let ((message-ids)) (notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids)) 2)
\r
136 > macroexp--expand-all((function (lambda nil "Return all id: queries of messages in the current thread." (let ((message-ids)) (notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids))))
\r
137 > macroexp--all-forms((defalias (quote notmuch-pick-get-messages-ids-thread) (function (lambda nil "Return all id: queries of messages in the current thread." (let ((message-ids)) (notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids)))) 1)
\r
138 > #[514 "\300.\301\"\211\204.
\r
139 > macroexp--expand-all((defun notmuch-pick-get-messages-ids-thread nil "Return all id: queries of messages in the current thread." (let ((message-ids)) (notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids)))
\r
140 > macroexpand-all((defun notmuch-pick-get-messages-ids-thread nil "Return all id: queries of messages in the current thread." (let ((message-ids)) (notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids)))
\r
141 > #[0 " \nB.\303\300!)\207" [(defun notmuch-pick-get-messages-ids-thread nil "Return all id: queries of messages in the current thread." (let ((message-ids)) (notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids)) load-file-name macroexp--pending-eager-loads macroexpand-all] 2 "\n\n(fn)"]()
\r
142 > funcall(#[0 " \nB.\303\300!)\207" [(defun notmuch-pick-get-messages-ids-thread nil "Return all id: queries of messages in the current thread." (let ((message-ids)) (notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids)) load-file-name macroexp--pending-eager-loads macroexpand-all] 2 "\n\n(fn)"])
\r
143 > internal-macroexpand-for-load((defun notmuch-pick-get-messages-ids-thread nil "Return all id: queries of messages in the current thread." (let ((message-ids)) (notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids)))
\r
144 > eval-current-buffer()
\r
145 > call-interactively(eval-current-buffer record nil)
\r
146 > command-execute(eval-current-buffer record)
\r
147 > execute-extended-command(nil "eval-current-buffer")
\r
148 > call-interactively(execute-extended-command nil nil)
\r