Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 5c / 34ae3ab3690f561cf17bce7ce61cade5982368
1 Return-Path: <cworth@cworth.org>\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 7279B431FC2;\r
6         Tue,  5 Jan 2010 11:59:36 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id P8dSZRvGJFHo; Tue,  5 Jan 2010 11:59:36 -0800 (PST)\r
11 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
12         by olra.theworths.org (Postfix) with ESMTP id DE5D9431FBD;\r
13         Tue,  5 Jan 2010 11:59:35 -0800 (PST)\r
14 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
15         id 0A9472540F8; Tue,  5 Jan 2010 11:39:20 -0800 (PST)\r
16 From: Carl Worth <cworth@cworth.org>\r
17 To: Ruben Pollan <meskio@sindominio.net>\r
18 In-Reply-To: <20100105153332.GE9339@blackspot>\r
19 References: <20091126202347.GA16654@blackspot>\r
20         <1260364206-344-1-git-send-email-meskio@sindominio.net>\r
21         <20091209132446.GC23878@blackspot>\r
22         <877hsv6hbo.fsf@yoom.home.cworth.org>\r
23         <87r5qnol78.fsf@yoom.home.cworth.org>\r
24         <87pr67ofz2.fsf@yoom.home.cworth.org>\r
25         <20100105153332.GE9339@blackspot>\r
26 Date: Tue, 05 Jan 2010 11:39:14 -0800\r
27 Message-ID: <87637gnxy5.fsf@yoom.home.cworth.org>\r
28 MIME-Version: 1.0\r
29 Content-Type: multipart/signed; boundary="=-=-=";\r
30         micalg=pgp-sha1; protocol="application/pgp-signature"\r
31 Cc: notmuch@notmuchmail.org\r
32 Subject: Re: [notmuch] [PATCH] Added regress option to tags iterator\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.13\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Tue, 05 Jan 2010 19:59:36 -0000\r
46 \r
47 --=-=-=\r
48 Content-Transfer-Encoding: quoted-printable\r
49 \r
50 On Tue, 5 Jan 2010 16:33:32 +0100, Ruben Pollan <meskio@sindominio.net> wro=\r
51 te:\r
52 > Not sure if I understand that. Let's see if I understand well. move_to_fi=\r
53 rst\r
54 > (or move_to_last) will put the iterator in the first (or last) valid item.\r
55 > move_to_next (and move_to_previous) will be able to reach an invalid item\r
56 > outside the list. Is it like that?\r
57 \r
58 Yes, that's the idea.\r
59 \r
60 > In some implementations of iterators (like C++ STD) you can reach invalid=\r
61  items\r
62 > only in one side of the list, at the end, but not at the beginning. Some =\r
63 people\r
64 > get use to this idea, but should not be a big deal to do it different.\r
65 \r
66 Yes, I've seen interfaces like that. They don't make sense to me since\r
67 then one direction or the other is much harder to iterate, (the\r
68 interface won't afford an easy for-loop-based iteration for example).\r
69 \r
70 > So you are thinking in a function has_current showing if the current item=\r
71  is\r
72 > valid. Am I right?\r
73 \r
74 Right. So example code using this would be:\r
75 \r
76         for (notmuch_messages_to_first (messages);\r
77              notmuch_messages_has_current (messages);\r
78              notmuch_messages_to_next (messages))\r
79         {\r
80                 notmuch_message_t *message;\r
81 \r
82                 message =3D notmuch_messages_get_current (messages);\r
83 \r
84                 ...\r
85         }\r
86 \r
87 And for iterating in the opposite direction it's very similar:\r
88 \r
89         for (notmuch_messages_to_last (messages);\r
90              notmuch_messages_has_current (messages);\r
91              notmuch_messages_to_previous (messages))\r
92         {\r
93                 notmuch_message_t *message;\r
94 \r
95                 message =3D notmuch_messages_get_current (messages);\r
96 \r
97                 ...\r
98         }\r
99 \r
100 Note that if you couldn't get the iterator to point to an invalid item\r
101 before the first, then this second loop would have to look very\r
102 different.\r
103 \r
104 > I think that's a good option. The names of the functions are still clear =\r
105 like\r
106 > that, and the original names are too long.\r
107 >=20\r
108 > PS: Sorry for the late reply, Christmas is a busy time.\r
109 \r
110 Thanks for the feedback. And no worries about the late reply---I've been\r
111 quite busy myself.\r
112 \r
113 =2DCarl\r
114 \r
115 --=-=-=\r
116 Content-Type: application/pgp-signature\r
117 \r
118 -----BEGIN PGP SIGNATURE-----\r
119 Version: GnuPG v1.4.10 (GNU/Linux)\r
120 \r
121 iD8DBQFLQ5Vi6JDdNq8qSWgRAv+qAKCTx4G8cCg2MxzoHiokXzlTuFLyfgCfUjEo\r
122 Z1RKLLAE4Wzl0XZm6VgFu40=\r
123 =EMEo\r
124 -----END PGP SIGNATURE-----\r
125 --=-=-=--\r