1 Return-Path: <david@tethera.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 B21E0431FBC
\r
6 for <notmuch@notmuchmail.org>; Sun, 12 May 2013 05:06:59 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 dVVtz3OaBkTL for <notmuch@notmuchmail.org>;
\r
16 Sun, 12 May 2013 05:06:53 -0700 (PDT)
\r
17 Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])
\r
18 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 5A3A1431FAF
\r
21 for <notmuch@notmuchmail.org>; Sun, 12 May 2013 05:06:53 -0700 (PDT)
\r
22 Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])
\r
23 by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id r4CC6pYY001308;
\r
24 Sun, 12 May 2013 09:06:51 -0300
\r
25 Received: from fctnnbsc30w-156034082078.dhcp-dynamic.fibreop.nb.bellaliant.net
\r
26 ([156.34.82.78] helo=zancas.localnet)
\r
27 by tesseract.cs.unb.ca with esmtpsa
\r
28 (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80)
\r
29 (envelope-from <david@tethera.net>)
\r
30 id 1UbV3C-0003Sk-JK; Sun, 12 May 2013 09:06:51 -0300
\r
31 Received: from bremner by zancas.localnet with local (Exim 4.80)
\r
32 (envelope-from <david@tethera.net>)
\r
33 id 1UbV37-00064F-0l; Sun, 12 May 2013 09:06:45 -0300
\r
34 From: David Bremner <david@tethera.net>
\r
35 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
\r
36 Subject: Re: [PATCH 1/2] contrib: pick: add thread based utility functions
\r
37 In-Reply-To: <1354970914-18342-2-git-send-email-markwalters1009@gmail.com>
\r
38 References: <1354970914-18342-1-git-send-email-markwalters1009@gmail.com>
\r
39 <1354970914-18342-2-git-send-email-markwalters1009@gmail.com>
\r
40 User-Agent: Notmuch/0.15.2+84~g12d5e4e (http://notmuchmail.org) Emacs/24.3.1
\r
41 (x86_64-pc-linux-gnu)
\r
42 Date: Sun, 12 May 2013 09:06:44 -0300
\r
43 Message-ID: <87fvxswgff.fsf@zancas.localnet>
\r
45 Content-Type: text/plain
\r
46 Content-Transfer-Encoding: 8bit
\r
48 X-BeenThere: notmuch@notmuchmail.org
\r
49 X-Mailman-Version: 2.1.13
\r
51 List-Id: "Use and development of the notmuch mail system."
\r
52 <notmuch.notmuchmail.org>
\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
56 List-Post: <mailto:notmuch@notmuchmail.org>
\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
59 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
60 X-List-Received-Date: Sun, 12 May 2013 12:06:59 -0000
\r
62 Mark Walters <markwalters1009@gmail.com> writes:
\r
64 > Previously notmuch-pick had no thread based functionality. This adds a
\r
65 > macro to iterate through all messages in a thread. To simplify this it
\r
66 > adds a text-property marker to the first message of each thread.
\r
69 > +(defun notmuch-pick-get-messages-ids-thread ()
\r
70 > + "Return all id: queries of messages in the current thread."
\r
71 > + (let ((message-ids))
\r
72 > + (notmuch-pick-thread-mapc
\r
73 > + (lambda () (push (notmuch-pick-get-message-id) message-ids)))
\r
76 As a style thing, it seems more idiomatic to me to have a map macro
\r
77 which returns a sequence, rather than faking it with mapc and push. But
\r
78 maybe that's a typical common lisp style, I don't know.
\r
80 More importantly, in emacs 24.3 I get an infinite loop when trying to
\r
81 evaluate the update notmuch-pick.el.
\r
83 The backtrace is below. I'm not a macro expert, but seems like too much
\r
84 is happening at compile/eval time.
\r
86 ----------------------------------------------------------------------
\r
88 Debugger entered--Lisp error: (quit)
\r
89 (save-excursion (beginning-of-line) (get-text-property (point) :notmuch-message-properties))
\r
90 notmuch-pick-get-message-properties()
\r
91 (or props (notmuch-pick-get-message-properties))
\r
92 (let ((props (or props (notmuch-pick-get-message-properties)))) (plist-get props prop))
\r
93 notmuch-pick-get-prop(:first)
\r
94 (not (notmuch-pick-get-prop :first))
\r
95 (while (not (notmuch-pick-get-prop :first)) (forward-line -1))
\r
96 notmuch-pick-thread-top()
\r
97 (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
98 (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
99 macroexpand((notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) nil)
\r
100 macroexp--expand-all((notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))))
\r
101 macroexp--all-forms(((notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids))
\r
102 #[1028 "\300.\300\301.\302\"\303.
\a!.
\b@A#.
\ 6@#\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
103 macroexp--expand-all((let ((message-ids)) (notmuch-pick-thread-mapc (lambda nil (push (notmuch-pick-get-message-id) message-ids))) message-ids))
\r
104 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
105 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
106 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
107 #[514 "\300.\301\"\211\204.
\r
108 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
109 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
110 #[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
111 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
112 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
113 eval-current-buffer()
\r
114 call-interactively(eval-current-buffer record nil)
\r
115 command-execute(eval-current-buffer record)
\r
116 execute-extended-command(nil "eval-current-buffer")
\r
117 call-interactively(execute-extended-command nil nil)
\r