1 Return-Path: <jrollins@finestructure.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 5F155431FD7
\r
6 for <notmuch@notmuchmail.org>; Sat, 14 Jul 2012 12:31:52 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.29 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3, T_MIME_NO_TEXT=0.01] 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 j5dQuSuBn-OL for <notmuch@notmuchmail.org>;
\r
16 Sat, 14 Jul 2012 12:31:52 -0700 (PDT)
\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu
\r
19 by olra.theworths.org (Postfix) with ESMTP id E924C431FBC
\r
20 for <notmuch@notmuchmail.org>; Sat, 14 Jul 2012 12:31:51 -0700 (PDT)
\r
21 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])
\r
22 by earth-doxen-postvirus (Postfix) with ESMTP id 9AF1566E00D3;
\r
23 Sat, 14 Jul 2012 12:31:51 -0700 (PDT)
\r
24 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new
\r
25 Received: from finestructure.net (unknown [76.89.192.57])
\r
26 (Authenticated sender: jrollins)
\r
27 by earth-doxen-submit (Postfix) with ESMTP id C0E4966E00AE;
\r
28 Sat, 14 Jul 2012 12:31:48 -0700 (PDT)
\r
29 Received: by finestructure.net (Postfix, from userid 1000)
\r
30 id 5CFFD73E; Sat, 14 Jul 2012 12:31:48 -0700 (PDT)
\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>
\r
32 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
\r
33 Subject: Re: [PATCH v2 4/7] emacs: Use result text properties for search
\r
35 In-Reply-To: <1342237406-32507-5-git-send-email-amdragon@mit.edu>
\r
36 References: <1342140319-19859-1-git-send-email-amdragon@mit.edu>
\r
37 <1342237406-32507-1-git-send-email-amdragon@mit.edu>
\r
38 <1342237406-32507-5-git-send-email-amdragon@mit.edu>
\r
39 User-Agent: Notmuch/0.13.2+82~gd0a8b58 (http://notmuchmail.org) Emacs/23.4.1
\r
40 (x86_64-pc-linux-gnu)
\r
41 Date: Sat, 14 Jul 2012 12:31:45 -0700
\r
42 Message-ID: <87d33yf8bi.fsf@servo.finestructure.net>
\r
44 Content-Type: multipart/signed; boundary="=-=-=";
\r
45 micalg=pgp-sha256; protocol="application/pgp-signature"
\r
46 X-BeenThere: notmuch@notmuchmail.org
\r
47 X-Mailman-Version: 2.1.13
\r
49 List-Id: "Use and development of the notmuch mail system."
\r
50 <notmuch.notmuchmail.org>
\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
54 List-Post: <mailto:notmuch@notmuchmail.org>
\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
58 X-List-Received-Date: Sat, 14 Jul 2012 19:31:52 -0000
\r
61 Content-Transfer-Encoding: quoted-printable
\r
63 On Fri, Jul 13 2012, Austin Clements <amdragon@MIT.EDU> wrote:
\r
64 > Coincidentally, this also essentially enables multi-line search result
\r
65 > formats; the only remaining non-multi-line-capable functions are
\r
66 > notmuch-search-{next,previous}-thread, which are only used
\r
69 So I tried to experiment with multi-line search results with this patch
\r
70 series, but it didn't work. I tried adding a '\n' in one of the
\r
71 formatter fields, but I got a series of errors for each result insertion
\r
72 in the buffer. What's the way to get multi-line to work?
\r
74 > +(defmacro notmuch-search-do-results (beg end pos-sym &rest body)
\r
75 > + "Invoke BODY for each result between BEG and END.
\r
77 > +POS-SYM will be bound to the point at the beginning of the
\r
79 > + (declare (indent 3))
\r
80 > + (let ((end-sym (make-symbol "end"))
\r
81 > + (first-sym (make-symbol "first")))
\r
82 > + `(let ((,pos-sym (notmuch-search-result-beginning ,beg))
\r
83 > + ;; End must be a marker in case body changes the text
\r
84 > + (,end-sym (copy-marker ,end))
\r
85 > + ;; Make sure we examine one result, even if (=3D beg end)
\r
87 > + ;; We have to be careful if the region extends beyond the
\r
88 > + ;; results. In this case, pos could be null or there could be
\r
89 > + ;; no result at pos.
\r
90 > + (while (and ,pos-sym (or (< ,pos-sym ,end-sym) ,first-sym))
\r
91 > + (when (notmuch-search-get-result ,pos-sym)
\r
93 > + (setq ,pos-sym (notmuch-search-result-end ,pos-sym)
\r
94 > + ,first-sym nil)))))
\r
96 Austin, can you explain why you use a defmacro here? I'm honestly have
\r
97 a hard time parsing what's going on here. I understand in principle how
\r
98 elisp macros work, but I don't see why it's needed here.
\r
100 I'm also trying to understand what the commas are doing
\r
101 (e.g. ",pos-sym"). Are they doing some sort of escaping?=20=20
\r
103 Some sophisticated elisp here!
\r
108 Content-Type: application/pgp-signature
\r
110 -----BEGIN PGP SIGNATURE-----
\r
111 Version: GnuPG v1.4.12 (GNU/Linux)
\r
113 iQIcBAEBCAAGBQJQAckiAAoJEO00zqvie6q8npUP/0BHgS9V1uRn9POipVtZM6CQ
\r
114 eR4Y3QTJf7gn1JGcvAnrWtbVrobWu3sW3eKdsZaNdxQ+BWZPhuoSihjDSOAgK157
\r
115 Mr7dj9s5Qj7FctvS4TNKWhcpr6L7NECngKQnulPIqK51tyVKqgueeBko0+x/xC5o
\r
116 JKtDWEeONdBpvEV7FlPR9kDvpIv6CFLlllTrRokmsFS2t11ueOP3iSyAD7vxtRUG
\r
117 WSs0uBtr0v2CXcKtJW1FT/KcW3r4k6/AOM0Zp10AUfQVkz+yt8+AqdY1eD/Py06o
\r
118 tyUdmtmuMqWhUxuw4dQEUKMJvxzmoj8uq9Y+a60FQJKD3VyhZgkJs3WDylMokUjE
\r
119 CbhdBehaEa5fFqFhI9pWixQ8EeSVYgVAID2XVuITUeWYQ/KZlEArQgksqyMOx8BM
\r
120 lzmyT8kvJ9qD78D131v9HFe98stzoqz88q67xTGww+1ySd2vyI8DoaIIMS74PlR8
\r
121 bn6+FE2C0PDuvhJYqdmf+vVV0HaPENc+KI+hzsBm+KcVEcUqjouiSXCM3ocVmgPJ
\r
122 zhvGOE7Uw9W8vb+eG+by+NMkZ1vyto3tKzZTlYDdUWGfE1OlU6ch1V6SXLiCciLZ
\r
123 se4QDQy2xw+ZVUHVShxsvDl5npRnMImxTDli+9A7eELfyy2Ae9arcFo9DxBjM1pJ
\r
124 2QsFRFnNIs3y0FIcPG5M
\r
126 -----END PGP SIGNATURE-----
\r