community/pipermail-archives/sup-devel/2011-01.txt (185336B) - raw
1 From sascha-ml-reply-to-2011-1@silbe.org Sat Jan 8 05:35:59 2011
2 From: sascha-ml-reply-to-2011-1@silbe.org (Sascha Silbe)
3 Date: Sat, 08 Jan 2011 11:35:59 +0100
4 Subject: [sup-devel] ongoing SPAM attack on the bug tracker
5 Message-ID: <1294482582-sup-1310@xo15-sascha.sascha.silbe.org>
6
7 The bug tracker keeps getting spammed for more than a few days now.
8 Maybe "anonymous" contributions should be deactivated, at least until
9 better anti-SPAM measures are in place?
10
11 Sascha
12
13 --
14 http://sascha.silbe.org/
15 http://www.infra-silbe.de/
16 -------------- next part --------------
17 A non-text attachment was scrubbed...
18 Name: signature.asc
19 Type: application/pgp-signature
20 Size: 490 bytes
21 Desc: not available
22 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110108/a850801d/attachment.bin>
23
24 From wmorgan-sup@masanjin.net Mon Jan 10 00:28:09 2011
25 From: wmorgan-sup@masanjin.net (William Morgan)
26 Date: Mon, 10 Jan 2011 00:28:09 -0500
27 Subject: [sup-devel] ongoing SPAM attack on the bug tracker
28 In-Reply-To: <1294482582-sup-1310@xo15-sascha.sascha.silbe.org>
29 References: <1294482582-sup-1310@xo15-sascha.sascha.silbe.org>
30 Message-ID: <1294636135-sup-6653@masanjin.net>
31
32 Reformatted excerpts from Sascha Silbe's message of 2011-01-08:
33 > The bug tracker keeps getting spammed for more than a few days now.
34 > Maybe "anonymous" contributions should be deactivated, at least until
35 > better anti-SPAM measures are in place?
36
37 I've shut down the bug tracker (temporarily?), since the amount of
38 traffic from spambots, although mostly rejected, was destroying the
39 server. I'll give it a few days and see if they come back when I turn it
40 on.
41 --
42 William <wmorgan-sup at masanjin.net>
43
44 From steve.goldman@gmail.com Mon Jan 10 15:11:35 2011
45 From: steve.goldman@gmail.com (Steve)
46 Date: Mon, 10 Jan 2011 15:11:35 -0500
47 Subject: [sup-devel] Bug report: temp file commit breaks my emacs hook
48 Message-ID: <AANLkTi=ZtdvYyBgKTMzj_DzwQP0xjRmWWzuEouZwW8Bs@mail.gmail.com>
49
50 Hi all,
51
52 This commit has broken part of the interaction between sup and my emacs.
53
54 commit 60573298a2258c101a85b3de8121f73d7aec2d51
55 Author: Michael Hamann <michael at content-space.de>
56 Date: Fri Oct 8 10:03:36 2010 -0400
57
58 Fix monkey-patching of Tempfile
59
60
61 Did you change the name of the temp file that gets passed to emacs?
62 My emacs hook looks like this.
63
64 (add-to-list 'auto-mode-alist
65 '("sup\\.\\(compose\\|forward\\|reply\\|resume\\)-mode$" . mail-mode))
66
67 Thoughts?
68
69 Thanks.
70
71 From michael@content-space.de Mon Jan 10 15:48:05 2011
72 From: michael@content-space.de (Michael Hamann)
73 Date: Mon, 10 Jan 2011 21:48:05 +0100
74 Subject: [sup-devel] Bug report: temp file commit breaks my emacs hook
75 In-Reply-To: <AANLkTi=ZtdvYyBgKTMzj_DzwQP0xjRmWWzuEouZwW8Bs@mail.gmail.com>
76 References: <AANLkTi=ZtdvYyBgKTMzj_DzwQP0xjRmWWzuEouZwW8Bs@mail.gmail.com>
77 Message-ID: <1294691658-sup-2474@mithink>
78
79 Hi,
80
81 Excerpts from Steve's message of 2011-01-10 21:11:35 +0100:
82 > This commit has broken part of the interaction between sup and my emacs.
83 >
84 > commit 60573298a2258c101a85b3de8121f73d7aec2d51
85 > Author: Michael Hamann <michael at content-space.de>
86 > Date: Fri Oct 8 10:03:36 2010 -0400
87 >
88 > Fix monkey-patching of Tempfile
89 >
90 >
91 > Did you change the name of the temp file that gets passed to emacs?
92
93 Yes. Now sup can and must use the syntax for Tempfile creation that is
94 available in Ruby version 1.8.7 and newer. It allows to set both a
95 prefix and a suffix. I didn't care about the filename because I had the
96 experience that with the old filename my Vim didn't recognize the
97 content as email and without the extension it recognizes it which gives
98 me nice syntax highlighting even without configuring anything.
99
100 > My emacs hook looks like this.
101 >
102 > (add-to-list 'auto-mode-alist
103 > '("sup\\.\\(compose\\|forward\\|reply\\|resume\\)-mode$" . mail-mode))
104
105 The string you are looking for is now at the beginning of the filename
106 so you could change your hook to match the beginning of the filename
107 instead of the end.
108
109 The following simple change will change the end of the filenames to
110 .EXTENSION, so if you think it makes sense to add an extension again I
111 could provide a proper patch.
112
113 diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
114 index 86aef4b..052421d 100644
115 --- a/lib/sup/modes/edit-message-mode.rb
116 +++ b/lib/sup/modes/edit-message-mode.rb
117 @@ -162,7 +162,7 @@ EOS
118 def edit_subject; edit_field "Subject" end
119
120 def edit_message
121 - @file = Tempfile.new "sup.#{self.class.name.gsub(/.*::/, '').camel_to_hyphy}"
122 + @file = Tempfile.new ["sup.#{self.class.name.gsub(/.*::/, '').camel_to_hyphy}", ".EXTENSION"]
123 @file.puts format_headers(@header - NON_EDITABLE_HEADERS).first
124 @file.puts
125 @file.puts @body.join("\n")
126
127
128 Regards,
129 Michael Hamann
130
131 From steve.goldman@gmail.com Mon Jan 10 16:09:10 2011
132 From: steve.goldman@gmail.com (Steve)
133 Date: Mon, 10 Jan 2011 16:09:10 -0500
134 Subject: [sup-devel] Bug report: temp file commit breaks my emacs hook
135 In-Reply-To: <1294691658-sup-2474@mithink>
136 References: <AANLkTi=ZtdvYyBgKTMzj_DzwQP0xjRmWWzuEouZwW8Bs@mail.gmail.com>
137 <1294691658-sup-2474@mithink>
138 Message-ID: <AANLkTikWwbXcGx-9ZyKhyTOJ2a9JOd9CscPnSzphTAVV@mail.gmail.com>
139
140 On Mon, Jan 10, 2011 at 3:48 PM, Michael Hamann
141 <michael at content-space.de> wrote:
142 > Hi,
143 >
144 > Excerpts from Steve's message of 2011-01-10 21:11:35 +0100:
145 >> This commit has broken part of the interaction between sup and my emacs.
146 >>
147 >> commit 60573298a2258c101a85b3de8121f73d7aec2d51
148 >> Author: Michael Hamann <michael at content-space.de>
149 >> Date: ? Fri Oct 8 10:03:36 2010 -0400
150 >>
151 >> ? ? Fix monkey-patching of Tempfile
152 >>
153 >>
154 >> Did you change the name of the temp file that gets passed to emacs?
155 >
156 > Yes. Now sup can and must use the syntax for Tempfile creation that is
157 > available in Ruby version 1.8.7 and newer. It allows to set both a
158 > prefix and a suffix. I didn't care about the filename because I had the
159 > experience that with the old filename my Vim didn't recognize the
160 > content as email and without the extension it recognizes it which gives
161 > me nice syntax highlighting even without configuring anything.
162 >
163 >> My emacs hook looks like this.
164 >>
165 >> (add-to-list 'auto-mode-alist
166 >> '("sup\\.\\(compose\\|forward\\|reply\\|resume\\)-mode$" . mail-mode))
167 >
168 > The string you are looking for is now at the beginning of the filename
169 > so you could change your hook to match the beginning of the filename
170 > instead of the end.
171
172 Makes sense. I have corrected my emacs pattern. No need to patch.
173
174 Thanks!
175
176 From sascha-pgp@silbe.org Tue Jan 11 10:21:53 2011
177 From: sascha-pgp@silbe.org (Sascha Silbe)
178 Date: Tue, 11 Jan 2011 16:21:53 +0100
179 Subject: [sup-devel] [PATCH] use gpg2 (GnuPG 2.x) instead of gpg (GnuPG 1.x)
180 Message-ID: <1294759313-653-1-git-send-email-sascha-pgp@silbe.org>
181
182 Since 1.9.14 GnuPG can automatically start gpg-agent if it's not already
183 running (using a well-known socket location). When using GnuPG 1.x gpg-agent
184 needs to already be running at the time sup is started because the socket
185 location is random and passed via environment variables.
186
187 Autostarting gpg-agent is particularly convenient when using sup via ssh
188 as gpg-agent would need to be started manually otherwise (for local X
189 sessions OTOH it's often started automatically by distro scripts).
190
191 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
192 ---
193 lib/sup/crypto.rb | 2 +-
194 1 files changed, 1 insertions(+), 1 deletions(-)
195
196 If there's anyone who would like to stick to GnuPG 1.x (the only advantage
197 is the smaller size of the binary), we might need to make this configurable
198 (or overridable via the gpg-args hook).
199
200 diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
201 index 537745d..916f04c 100644
202 --- a/lib/sup/crypto.rb
203 +++ b/lib/sup/crypto.rb
204 @@ -25,7 +25,7 @@ EOS
205 def initialize
206 @mutex = Mutex.new
207
208 - bin = `which gpg`.chomp
209 + bin = `which gpg2`.chomp
210 @cmd = case bin
211 when /\S/
212 debug "crypto: detected gpg binary in #{bin}"
213 --
214 1.7.2.3
215
216
217 From bwalton@artsci.utoronto.ca Tue Jan 11 10:34:41 2011
218 From: bwalton@artsci.utoronto.ca (Ben Walton)
219 Date: Tue, 11 Jan 2011 10:34:41 -0500
220 Subject: [sup-devel] [PATCH] use gpg2 (GnuPG 2.x) instead of gpg (GnuPG
221 1.x)
222 In-Reply-To: <1294759313-653-1-git-send-email-sascha-pgp@silbe.org>
223 References: <1294759313-653-1-git-send-email-sascha-pgp@silbe.org>
224 Message-ID: <1294760045-sup-6325@pinkfloyd.chass.utoronto.ca>
225
226 Excerpts from Sascha Silbe's message of Tue Jan 11 10:21:53 -0500 2011:
227
228 Hi Sascha,
229
230 > Since 1.9.14 GnuPG can automatically start gpg-agent if it's not
231 > already running (using a well-known socket location). When using
232 > GnuPG 1.x gpg-agent needs to already be running at the time sup is
233 > started because the socket location is random and passed via
234 > environment variables.
235
236 I like the intent of this patch, but at the very least, it should
237 determine if gpg2 is available and then fall back to gpg if it's not.
238
239 Thanks
240 -Ben
241 --
242 Ben Walton
243 Systems Programmer - CHASS
244 University of Toronto
245 C:416.407.5610 | W:416.978.4302
246
247
248 From sascha-ml-reply-to-2011-1@silbe.org Tue Jan 11 13:30:25 2011
249 From: sascha-ml-reply-to-2011-1@silbe.org (Sascha Silbe)
250 Date: Tue, 11 Jan 2011 19:30:25 +0100
251 Subject: [sup-devel] [PATCH] use gpg2 (GnuPG 2.x) instead of gpg (GnuPG
252 1.x)
253 In-Reply-To: <1294760149-sup-8106@alvh.no-ip.org>
254 References: <1294759313-653-1-git-send-email-sascha-pgp@silbe.org>
255 <1294760149-sup-8106@alvh.no-ip.org>
256 Message-ID: <1294770556-sup-2230@xo15-sascha.sascha.silbe.org>
257
258 Excerpts from Alvaro Herrera's message of Tue Jan 11 16:45:09 +0100 2011:
259
260 > I think it should fall back to using `which gpg` in case gpg2 is not
261 > available.
262
263 Good point. Will post a new version.
264
265 Sascha
266
267 --
268 http://sascha.silbe.org/
269 http://www.infra-silbe.de/
270 -------------- next part --------------
271 A non-text attachment was scrubbed...
272 Name: signature.asc
273 Type: application/pgp-signature
274 Size: 494 bytes
275 Desc: not available
276 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110111/8c534d9b/attachment.bin>
277
278 From sascha-pgp@silbe.org Tue Jan 11 13:59:43 2011
279 From: sascha-pgp@silbe.org (Sascha Silbe)
280 Date: Tue, 11 Jan 2011 19:59:43 +0100
281 Subject: [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over gpg (GnuPG 1.x)
282 In-Reply-To: <1294759313-653-1-git-send-email-sascha-pgp@silbe.org>
283 References: <1294759313-653-1-git-send-email-sascha-pgp@silbe.org>
284 Message-ID: <1294772383-1585-1-git-send-email-sascha-pgp@silbe.org>
285
286 Since 1.9.14 GnuPG can automatically start gpg-agent if it's not already
287 running (using a well-known socket location). When using GnuPG 1.x gpg-agent
288 needs to already be running at the time sup is started because the socket
289 location is random and passed via environment variables.
290
291 Autostarting gpg-agent is particularly convenient when using sup via ssh
292 as gpg-agent would need to be started manually (for local X sessions OTOH
293 it's often started automatically by distro scripts).
294
295 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
296 ---
297 lib/sup/crypto.rb | 7 ++++---
298 1 files changed, 4 insertions(+), 3 deletions(-)
299
300 v1->v2:
301 fallback to gpg if gpg2 is not available
302
303 diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
304 index 537745d..16ebaf9 100644
305 --- a/lib/sup/crypto.rb
306 +++ b/lib/sup/crypto.rb
307 @@ -25,9 +25,10 @@ EOS
308 def initialize
309 @mutex = Mutex.new
310
311 - bin = `which gpg`.chomp
312 - @cmd = case bin
313 - when /\S/
314 + @cmd = if (bin = `which gpg2`.chomp) =~ /\S/
315 + debug "crypto: detected gpg binary in #{bin}"
316 + "#{bin} --quiet --batch --no-verbose --logger-fd 1 --use-agent"
317 + elsif (bin = `which gpg`.chomp) =~ /\S/
318 debug "crypto: detected gpg binary in #{bin}"
319 "#{bin} --quiet --batch --no-verbose --logger-fd 1 --use-agent"
320 else
321 --
322 1.7.2.3
323
324
325 From gaudenz@soziologie.ch Tue Jan 11 15:20:12 2011
326 From: gaudenz@soziologie.ch (Gaudenz Steinlin)
327 Date: Tue, 11 Jan 2011 21:20:12 +0100
328 Subject: [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over gpg (GnuPG
329 1.x)
330 In-Reply-To: <1294772383-1585-1-git-send-email-sascha-pgp@silbe.org>
331 References: <1294759313-653-1-git-send-email-sascha-pgp@silbe.org>
332 <1294772383-1585-1-git-send-email-sascha-pgp@silbe.org>
333 Message-ID: <1294776647-sup-7357@meteor.durcheinandertal.local>
334
335 Excerpts from Sascha Silbe's message of Die Jan 11 19:59:43 +0100 2011:
336 > Since 1.9.14 GnuPG can automatically start gpg-agent if it's not already
337 > running (using a well-known socket location). When using GnuPG 1.x gpg-agent
338 > needs to already be running at the time sup is started because the socket
339 > location is random and passed via environment variables.
340 >
341 > Autostarting gpg-agent is particularly convenient when using sup via ssh
342 > as gpg-agent would need to be started manually (for local X sessions OTOH
343 > it's often started automatically by distro scripts).
344
345 AFAICS this change is not compatible with the rework of the GPG
346 handling done in the gpgme branch. I was under the impression (from
347 previous discussion on this list) that this branch is going to be
348 merged soon (at least into next).
349
350 Gaudenz
351
352 >
353 > Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
354 > ---
355 > lib/sup/crypto.rb | 7 ++++---
356 > 1 files changed, 4 insertions(+), 3 deletions(-)
357 >
358 > v1->v2:
359 > fallback to gpg if gpg2 is not available
360 >
361 > diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
362 > index 537745d..16ebaf9 100644
363 > --- a/lib/sup/crypto.rb
364 > +++ b/lib/sup/crypto.rb
365 > @@ -25,9 +25,10 @@ EOS
366 > def initialize
367 > @mutex = Mutex.new
368 >
369 > - bin = `which gpg`.chomp
370 > - @cmd = case bin
371 > - when /\S/
372 > + @cmd = if (bin = `which gpg2`.chomp) =~ /\S/
373 > + debug "crypto: detected gpg binary in #{bin}"
374 > + "#{bin} --quiet --batch --no-verbose --logger-fd 1 --use-agent"
375 > + elsif (bin = `which gpg`.chomp) =~ /\S/
376 > debug "crypto: detected gpg binary in #{bin}"
377 > "#{bin} --quiet --batch --no-verbose --logger-fd 1 --use-agent"
378 > else
379 --
380 Ever tried. Ever failed. No matter.
381 Try again. Fail again. Fail better.
382 ~ Samuel Beckett ~
383 -------------- next part --------------
384 A non-text attachment was scrubbed...
385 Name: signature.asc
386 Type: application/pgp-signature
387 Size: 482 bytes
388 Desc: not available
389 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110111/da0227ec/attachment.bin>
390
391 From alvherre@alvh.no-ip.org Tue Jan 11 10:45:09 2011
392 From: alvherre@alvh.no-ip.org (Alvaro Herrera)
393 Date: Tue, 11 Jan 2011 12:45:09 -0300
394 Subject: [sup-devel] [PATCH] use gpg2 (GnuPG 2.x) instead of gpg (GnuPG
395 1.x)
396 In-Reply-To: <1294759313-653-1-git-send-email-sascha-pgp@silbe.org>
397 References: <1294759313-653-1-git-send-email-sascha-pgp@silbe.org>
398 Message-ID: <1294760149-sup-8106@alvh.no-ip.org>
399
400 Excerpts from Sascha Silbe's message of mar ene 11 12:21:53 -0300 2011:
401 > Since 1.9.14 GnuPG can automatically start gpg-agent if it's not already
402 > running (using a well-known socket location). When using GnuPG 1.x gpg-agent
403 > needs to already be running at the time sup is started because the socket
404 > location is random and passed via environment variables.
405 >
406 > Autostarting gpg-agent is particularly convenient when using sup via ssh
407 > as gpg-agent would need to be started manually otherwise (for local X
408 > sessions OTOH it's often started automatically by distro scripts).
409
410 I think it should fall back to using `which gpg` in case gpg2 is not
411 available.
412
413 --
414 ?lvaro Herrera <alvherre at alvh.no-ip.org>
415
416 From rlane@club.cc.cmu.edu Sat Jan 15 02:07:28 2011
417 From: rlane@club.cc.cmu.edu (Rich Lane)
418 Date: Sat, 15 Jan 2011 02:07:28 -0500
419 Subject: [sup-devel] Sup 0.12 released
420 Message-ID: <1295068347-sup-3453@zyrg.net>
421
422 I'm pleased to announce the release of Sup 0.12.
423
424 Sup is a console-based email client for people with a lot of email.
425 It supports tagging, very fast full-text search, automatic contact-
426 list management, and more. If you're the type of person who treats
427 email as an extension of your long-term memory, Sup is for you.
428
429 Get it: gem install sup
430 Learn it: http://sup.rubyforge.org
431 Love it: sup-talk at rubyforge.org
432
433 Release notes:
434
435 Deprecated remote sources have been removed.
436
437 Maildir support has been improved to gracefully handle messages that
438 move or disappear. The "out of sync" errors should no longer occur.
439
440 Inline GPG is now supported.
441
442 Changelog for 0.12:
443
444 * Remove deprecated IMAP, IMAPS, and mbox+ssh sources
445 * Inline GPG support
446 * Robust maildir support
447 * sup-dump compatibility between Sup versions
448 * New hook: sendmail
449 * Better Ruby 1.9/UTF8 support
450 * As always, many bugfixes and tweaks.
451
452 From rlane@club.cc.cmu.edu Mon Jan 17 01:20:08 2011
453 From: rlane@club.cc.cmu.edu (Rich Lane)
454 Date: Mon, 17 Jan 2011 01:20:08 -0500
455 Subject: [sup-devel] [PATCH] fix handling of multiple label: terms in
456 search
457 In-Reply-To: <1285769762-15823-1-git-send-email-sascha-pgp@silbe.org>
458 References: <1285769762-15823-1-git-send-email-sascha-pgp@silbe.org>
459 Message-ID: <1295245113-sup-5823@zyrg.net>
460
461 Excerpts from Sascha Silbe's message of Wed Sep 29 10:16:02 -0400 2010:
462 > By default Xapian will join query terms with the same prefix with OR instead
463 > of AND, so searching for multiple labels doesn't return the expected results.
464 > By making use of a parameter to add_boolean_prefix (added in Xapian 1.2) we
465 > can tell Xapian to use OR only for the search terms that are guaranteed to be
466 > unique.
467
468 Merged to master. This means we require Xapian 1.2.1 now. The
469 xapian-full gem has been updated to 1.2.3.
470
471 From sascha-pgp@silbe.org Tue Jan 18 12:58:00 2011
472 From: sascha-pgp@silbe.org (Sascha Silbe)
473 Date: Tue, 18 Jan 2011 18:58:00 +0100
474 Subject: [sup-devel] [PATCH] fix EOL spaces
475 Message-ID: <1295373480-1093-1-git-send-email-sascha-pgp@silbe.org>
476
477 Trailing spaces can make dealing with patches a pain for some developers.
478
479 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
480 ---
481 My editor is configured to automatically strip EOL spaces as that's the
482 policy for some other projects I'm contributing to. As the sup code base
483 contains a large number of EOL spaces, I need to filter out whitespace-
484 only changes prior to commit, making contributing to sup somewhat of a
485 pain.
486 This patch has been created by forcing a save of all the files in the
487 editor, so manual checking should only be required for files where the
488 EOL spaces might be intentional (e.g. literal copies of messages).
489 The test suite seems to be out of order, so I didn't check it for
490 regressions.
491
492 History.txt | 2 +-
493 bin/sup-add | 4 +-
494 bin/sup-config | 4 +-
495 bin/sup-sync-back | 2 +-
496 doc/Hooks.txt | 2 +-
497 lib/sup.rb | 6 ++--
498 lib/sup/colormap.rb | 4 +-
499 lib/sup/crypto.rb | 28 ++++++++++----------
500 lib/sup/draft.rb | 2 +-
501 lib/sup/horizontal-selector.rb | 2 +-
502 lib/sup/label.rb | 2 +-
503 lib/sup/message-chunks.rb | 2 +-
504 lib/sup/message.rb | 2 +-
505 lib/sup/modes/compose-mode.rb | 2 +-
506 lib/sup/modes/contact-list-mode.rb | 4 +-
507 lib/sup/modes/edit-message-mode.rb | 18 ++++++------
508 lib/sup/modes/file-browser-mode.rb | 4 +-
509 lib/sup/modes/forward-mode.rb | 8 +++---
510 lib/sup/modes/line-cursor-mode.rb | 2 +-
511 lib/sup/modes/reply-mode.rb | 2 +-
512 lib/sup/modes/resume-mode.rb | 2 +-
513 lib/sup/modes/scroll-mode.rb | 2 +-
514 lib/sup/modes/text-mode.rb | 2 +-
515 lib/sup/modes/thread-index-mode.rb | 26 +++++++++---------
516 lib/sup/modes/thread-view-mode.rb | 18 ++++++------
517 lib/sup/person.rb | 2 +-
518 lib/sup/poll.rb | 2 +-
519 lib/sup/rfc2047.rb | 2 +-
520 lib/sup/textfield.rb | 2 +-
521 lib/sup/thread.rb | 2 +-
522 lib/sup/util.rb | 8 +++---
523 test/dummy_source.rb | 8 +++---
524 test/test_header_parsing.rb | 2 +-
525 test/test_message.rb | 50 ++++++++++++++++++------------------
526 34 files changed, 115 insertions(+), 115 deletions(-)
527
528 diff --git a/History.txt b/History.txt
529 index 8df12ff..34ed6e4 100644
530 --- a/History.txt
531 +++ b/History.txt
532 @@ -199,7 +199,7 @@
533 * doc/UserGuide.txt
534
535 == 0.0.4 / 2007-01-03
536 -
537 +
538 * Bugfixes, primarily for threaded networking.
539
540 == 0.0.3 / 2007-01-02
541 diff --git a/bin/sup-add b/bin/sup-add
542 index b5705e4..c77720f 100755
543 --- a/bin/sup-add
544 +++ b/bin/sup-add
545 @@ -94,7 +94,7 @@ begin
546
547 parsed_uri = URI(uri)
548
549 - source =
550 + source =
551 case parsed_uri.scheme
552 when "maildir"
553 Redwood::Maildir.new uri, !$opts[:unusual], $opts[:archive], nil, labels
554 @@ -103,7 +103,7 @@ begin
555 when nil
556 Trollop::die "Sources must be specified with an URI"
557 else
558 - Trollop::die "Unknown source type #{parsed_uri.scheme.inspect}"
559 + Trollop::die "Unknown source type #{parsed_uri.scheme.inspect}"
560 end
561 say "Adding #{source}..."
562 Redwood::SourceManager.add_source source
563 diff --git a/bin/sup-config b/bin/sup-config
564 index 39947c2..132fd77 100755
565 --- a/bin/sup-config
566 +++ b/bin/sup-config
567 @@ -103,7 +103,7 @@ def add_source
568 system cmd
569 if $?.success?
570 say "Great! Added!"
571 - break
572 + break
573 else
574 say "Rats, that failed. You may have to do it manually."
575 if axe_yes("Try again?") then next else return end
576 @@ -210,7 +210,7 @@ if axe_yes "Run sup-sync to import all messages now?"
577 system cmd
578 if $?.success?
579 say "Great! It worked!"
580 - break
581 + break
582 else
583 say "Rats, that failed. You may have to do it manually."
584 if axe_yes("Try again?") then next else break end
585 diff --git a/bin/sup-sync-back b/bin/sup-sync-back
586 index c339f37..5d84cba 100755
587 --- a/bin/sup-sync-back
588 +++ b/bin/sup-sync-back
589 @@ -71,7 +71,7 @@ index.lock_interactively or exit
590
591 deleted_fp, spam_fp = nil
592 unless opts[:dry_run]
593 - deleted_fp = File.open(opts[:move_deleted], "a") if opts[:move_deleted]
594 + deleted_fp = File.open(opts[:move_deleted], "a") if opts[:move_deleted]
595 spam_fp = File.open(opts[:move_spam], "a") if opts[:move_spam]
596 end
597
598 diff --git a/doc/Hooks.txt b/doc/Hooks.txt
599 index df5726e..21b1e5e 100644
600 --- a/doc/Hooks.txt
601 +++ b/doc/Hooks.txt
602 @@ -71,4 +71,4 @@ after-poll:
603 ## kills the background task after the first poll
604 @bgtask_pid = get 'bgtask_pid'
605 Process.kill("TERM", @bgtask_pid) unless @bgtask_pid == nil
606 - set 'bgtask_pid' nil
607 \ No newline at end of file
608 + set 'bgtask_pid' nil
609 diff --git a/lib/sup.rb b/lib/sup.rb
610 index 2319dee..edd23c8 100644
611 --- a/lib/sup.rb
612 +++ b/lib/sup.rb
613 @@ -197,8 +197,8 @@ Until this is corrected, messages from these sources cannot be viewed,
614 and new messages will not be detected. Luckily, this is easy to correct!
615
616 #{desynced_sources.map do |s|
617 - "Source: " + s.to_s +
618 - "\n Error: " + s.error.message.wrap(70).join("\n ") +
619 + "Source: " + s.to_s +
620 + "\n Error: " + s.error.message.wrap(70).join("\n ") +
621 "\n Fix: sup-sync --changed #{s.to_s}"
622 end}
623 EOM
624 @@ -248,7 +248,7 @@ EOS
625 require 'socket'
626 name = Etc.getpwnam(ENV["USER"]).gecos.split(/,/).first rescue nil
627 name ||= ENV["USER"]
628 - email = ENV["USER"] + "@" +
629 + email = ENV["USER"] + "@" +
630 begin
631 Socket.gethostbyname(Socket.gethostname).first
632 rescue SocketError
633 diff --git a/lib/sup/colormap.rb b/lib/sup/colormap.rb
634 index a3c4309..e91835d 100644
635 --- a/lib/sup/colormap.rb
636 +++ b/lib/sup/colormap.rb
637 @@ -65,7 +65,7 @@ class Colormap
638 :modified_buffer => { :fg => "yellow", :bg => "default", :attrs => ["bold"] },
639 :date => { :fg => "white", :bg => "default"},
640 }
641 -
642 +
643 def initialize
644 raise "only one instance can be created" if @@instance
645 @@instance = self
646 @@ -115,7 +115,7 @@ class Colormap
647 Curses::COLOR_BLACK
648 end
649
650 - hbg =
651 + hbg =
652 case bg
653 when Curses::COLOR_CYAN
654 Curses::COLOR_YELLOW
655 diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
656 index e532261..f8e16c5 100644
657 --- a/lib/sup/crypto.rb
658 +++ b/lib/sup/crypto.rb
659 @@ -31,7 +31,7 @@ EOS
660 HookManager.register "sig-output", <<EOS
661 Runs when the signature output is being generated, allowing you to
662 add extra information to your signatures if you want.
663 -
664 +
665 Variables:
666 signature: the signature object (class is GPGME::Signature)
667 from_key: the key that generated the signature (class is GPGME::Key)
668 @@ -58,7 +58,7 @@ EOS
669
670 gpg_opts = {:protocol => GPGME::PROTOCOL_OpenPGP, :armor => true, :textmode => true}
671 gpg_opts.merge(gen_sign_user_opts(from))
672 - gpg_opts = HookManager.run("gpg-options",
673 + gpg_opts = HookManager.run("gpg-options",
674 {:operation => "sign", :options => gpg_opts}) || gpg_opts
675
676 begin
677 @@ -82,10 +82,10 @@ EOS
678
679 gpg_opts = {:protocol => GPGME::PROTOCOL_OpenPGP, :armor => true, :textmode => true}
680 if sign
681 - gpg_opts.merge(gen_sign_user_opts(from))
682 + gpg_opts.merge(gen_sign_user_opts(from))
683 gpg_opts.merge({:sign => true})
684 end
685 - gpg_opts = HookManager.run("gpg-options",
686 + gpg_opts = HookManager.run("gpg-options",
687 {:operation => "encrypt", :options => gpg_opts}) || gpg_opts
688 recipients = to + [from]
689
690 @@ -132,7 +132,7 @@ EOS
691
692 err_code = GPGME::gpgme_err_code(signature.status)
693 if err_code == GPGME::GPG_ERR_BAD_SIGNATURE
694 - valid = false
695 + valid = false
696 elsif err_code != GPGME::GPG_ERR_NO_ERROR
697 valid = false
698 unknown = true
699 @@ -158,9 +158,9 @@ EOS
700 return unknown_status(cant_find_gpgme) unless @gpgme_present
701
702 gpg_opts = {:protocol => GPGME::PROTOCOL_OpenPGP}
703 - gpg_opts = HookManager.run("gpg-options",
704 + gpg_opts = HookManager.run("gpg-options",
705 {:operation => "verify", :options => gpg_opts}) || gpg_opts
706 - ctx = GPGME::Ctx.new(gpg_opts)
707 + ctx = GPGME::Ctx.new(gpg_opts)
708 sig_data = GPGME::Data.from_str signature.decode
709 if detached
710 signed_text_data = GPGME::Data.from_str(format_payload(payload))
711 @@ -172,7 +172,7 @@ EOS
712 begin
713 ctx.verify(sig_data, signed_text_data, plain_data)
714 rescue GPGME::Error => exc
715 - return unknown_status exc.message
716 + return unknown_status exc.message
717 end
718 self.verified_ok? ctx.verify_result
719 end
720 @@ -182,9 +182,9 @@ EOS
721 return unknown_status(cant_find_gpgme) unless @gpgme_present
722
723 gpg_opts = {:protocol => GPGME::PROTOCOL_OpenPGP}
724 - gpg_opts = HookManager.run("gpg-options",
725 + gpg_opts = HookManager.run("gpg-options",
726 {:operation => "decrypt", :options => gpg_opts}) || gpg_opts
727 - ctx = GPGME::Ctx.new(gpg_opts)
728 + ctx = GPGME::Ctx.new(gpg_opts)
729 cipher_data = GPGME::Data.from_str(format_payload(payload))
730 plain_data = GPGME::Data.empty
731 begin
732 @@ -216,7 +216,7 @@ EOS
733 msg.body = output
734 else
735 # It appears that some clients use Windows new lines - CRLF - but RMail
736 - # splits the body and header on "\n\n". So to allow the parse below to
737 + # splits the body and header on "\n\n". So to allow the parse below to
738 # succeed, we will convert the newlines to what RMail expects
739 output = output.gsub(/\r\n/, "\n")
740 # This is gross. This decrypted payload could very well be a multipart
741 @@ -271,18 +271,18 @@ private
742 begin
743 from_key = ctx.get_key(signature.fingerprint)
744 first_sig = signature.to_s.sub(/from [0-9A-F]{16} /, 'from "') + '"'
745 - rescue EOFError
746 + rescue EOFError
747 from_key = nil
748 first_sig = "No public key available for #{signature.fingerprint}"
749 end
750
751 time_line = "Signature made " + signature.timestamp.strftime("%a %d %b %Y %H:%M:%S %Z") +
752 - " using " + key_type(from_key, signature.fingerprint) +
753 + " using " + key_type(from_key, signature.fingerprint) +
754 "key ID " + signature.fingerprint[-8..-1]
755 output_lines = [time_line, first_sig]
756
757 trusted = false
758 - if from_key
759 + if from_key
760 # first list all the uids
761 if from_key.uids.length > 1
762 aka_list = from_key.uids[1..-1]
763 diff --git a/lib/sup/draft.rb b/lib/sup/draft.rb
764 index 0323f9e..dc37d79 100644
765 --- a/lib/sup/draft.rb
766 +++ b/lib/sup/draft.rb
767 @@ -70,7 +70,7 @@ class DraftLoader < Source
768 def load_header offset
769 File.open(fn_for_offset(offset)) { |f| parse_raw_email_header f }
770 end
771 -
772 +
773 def load_message offset
774 File.open fn_for_offset(offset) do |f|
775 RMail::Mailbox::MBoxReader.new(f).each_message do |input|
776 diff --git a/lib/sup/horizontal-selector.rb b/lib/sup/horizontal-selector.rb
777 index aef16d4..35a028e 100644
778 --- a/lib/sup/horizontal-selector.rb
779 +++ b/lib/sup/horizontal-selector.rb
780 @@ -24,7 +24,7 @@ class HorizontalSelector
781 "#{@label} "
782 end
783
784 - [[@base_color, label]] +
785 + [[@base_color, label]] +
786 (0 ... @labels.length).inject([]) do |array, i|
787 array + [
788 if i == @selection
789 diff --git a/lib/sup/label.rb b/lib/sup/label.rb
790 index 67474c2..1699896 100644
791 --- a/lib/sup/label.rb
792 +++ b/lib/sup/label.rb
793 @@ -12,7 +12,7 @@ class LabelManager
794
795 def initialize fn
796 @fn = fn
797 - labels =
798 + labels =
799 if File.exists? fn
800 IO.readlines(fn).map { |x| x.chomp.intern }
801 else
802 diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
803 index 0097450..7a061d9 100644
804 --- a/lib/sup/message-chunks.rb
805 +++ b/lib/sup/message-chunks.rb
806 @@ -198,7 +198,7 @@ EOS
807 def initialize lines
808 @lines = lines
809 end
810 -
811 +
812 def inlineable?; @lines.length == 1 end
813 def quotable?; true end
814 def expandable?; !inlineable? end
815 diff --git a/lib/sup/message.rb b/lib/sup/message.rb
816 index 41e6486..66745ca 100644
817 --- a/lib/sup/message.rb
818 +++ b/lib/sup/message.rb
819 @@ -503,7 +503,7 @@ private
820 filename = Rfc2047.decode_to $encoding, filename
821 # add this to the attachments list if its not a generated html
822 # attachment (should we allow images with generated names?).
823 - # Lowercase the filename because searches are easier that way
824 + # Lowercase the filename because searches are easier that way
825 @attachments.push filename.downcase unless filename =~ /^sup-attachment-/
826 add_label :attachment unless filename =~ /^sup-attachment-/
827 content_type = (m.header.content_type || "application/unknown").downcase # sometimes RubyMail gives us nil
828 diff --git a/lib/sup/modes/compose-mode.rb b/lib/sup/modes/compose-mode.rb
829 index 0548518..cf7a9de 100644
830 --- a/lib/sup/modes/compose-mode.rb
831 +++ b/lib/sup/modes/compose-mode.rb
832 @@ -26,7 +26,7 @@ class ComposeMode < EditMessageMode
833 cc = opts[:cc] || (BufferManager.ask_for_contacts(:people, "Cc: ") or return if $config[:ask_for_cc])
834 bcc = opts[:bcc] || (BufferManager.ask_for_contacts(:people, "Bcc: ") or return if $config[:ask_for_bcc])
835 subj = opts[:subj] || (BufferManager.ask(:subject, "Subject: ") or return if $config[:ask_for_subject])
836 -
837 +
838 mode = ComposeMode.new :from => from, :to => to, :cc => cc, :bcc => bcc, :subj => subj
839 BufferManager.spawn "New Message", mode
840 mode.edit_message
841 diff --git a/lib/sup/modes/contact-list-mode.rb b/lib/sup/modes/contact-list-mode.rb
842 index 49804ad..76461a9 100644
843 --- a/lib/sup/modes/contact-list-mode.rb
844 +++ b/lib/sup/modes/contact-list-mode.rb
845 @@ -89,7 +89,7 @@ class ContactListMode < LineCursorMode
846 def search
847 p = @contacts[curpos] or return
848 multi_search [p]
849 - end
850 + end
851
852 def reload
853 @tags.drop_all_tags
854 @@ -114,7 +114,7 @@ class ContactListMode < LineCursorMode
855 @contacts = (@user_contacts + recentc).sort_by { |p| p.sort_by_me }.uniq
856 end
857 end
858 -
859 +
860 protected
861
862 def update
863 diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
864 index c13c6ae..734a879 100644
865 --- a/lib/sup/modes/edit-message-mode.rb
866 +++ b/lib/sup/modes/edit-message-mode.rb
867 @@ -88,7 +88,7 @@ EOS
868 end
869
870 def initialize opts={}
871 - @header = opts.delete(:header) || {}
872 + @header = opts.delete(:header) || {}
873 @header_lines = []
874
875 @body = opts.delete(:body) || []
876 @@ -119,7 +119,7 @@ EOS
877 HorizontalSelector.new "Crypto:", [:none] + CryptoManager::OUTGOING_MESSAGE_OPERATIONS.keys, ["None"] + CryptoManager::OUTGOING_MESSAGE_OPERATIONS.values
878 end
879 add_selector @crypto_selector if @crypto_selector
880 -
881 +
882 HookManager.run "before-edit", :header => @header, :body => @body
883 if @crypto_selector
884 HookManager.run "crypto-mode", :header => @header, :body => @body, :crypto_selector => @crypto_selector
885 @@ -130,7 +130,7 @@ EOS
886 end
887
888 def lines; @text.length + (@selectors.empty? ? 0 : (@selectors.length + DECORATION_LINES)) end
889 -
890 +
891 def [] i
892 if @selectors.empty?
893 @text[i]
894 @@ -270,7 +270,7 @@ protected
895 header, @header_lines = format_headers(@header - NON_EDITABLE_HEADERS) + [""]
896 @text = header + [""] + @body
897 @text += sig_lines unless $config[:edit_signature]
898 -
899 +
900 @attachment_lines_offset = 0
901
902 unless @attachments.empty?
903 @@ -339,7 +339,7 @@ protected
904 return false if $config[:confirm_no_attachments] && mentions_attachments? && @attachments.size == 0 && !BufferManager.ask_yes_or_no("You haven't added any attachments. Really send?")#" stupid ruby-mode
905 return false if $config[:confirm_top_posting] && top_posting? && !BufferManager.ask_yes_or_no("You're top-posting. That makes you a bad person. Really send?") #" stupid ruby-mode
906
907 - from_email =
908 + from_email =
909 if @header["From"] =~ /<?(\S+@(\S+?))>?$/
910 $1
911 else
912 @@ -393,7 +393,7 @@ protected
913 body_m = m
914 body_m.header["Content-Disposition"] = "inline"
915 m = RMail::Message.new
916 -
917 +
918 m.add_part body_m
919 @attachments.each { |a| m.add_part a }
920 end
921 @@ -414,7 +414,7 @@ protected
922 ## finally, set the top-level headers
923 @header.each do |k, v|
924 next if v.nil? || v.empty?
925 - m.header[k] =
926 + m.header[k] =
927 case v
928 when String
929 k.match(/subject/i) ? mime_encode_subject(v) : mime_encode_address(v)
930 @@ -454,7 +454,7 @@ EOS
931 f.puts
932 f.puts sanitize_body(@body.join("\n"))
933 f.puts sig_lines if full unless $config[:edit_signature]
934 - end
935 + end
936
937 protected
938
939 @@ -514,7 +514,7 @@ private
940
941 ## no hook, do default signature generation based on config.yaml
942 return [] unless from_email
943 - sigfn = (AccountManager.account_for(from_email) ||
944 + sigfn = (AccountManager.account_for(from_email) ||
945 AccountManager.default_account).signature
946
947 if sigfn && File.exists?(sigfn)
948 diff --git a/lib/sup/modes/file-browser-mode.rb b/lib/sup/modes/file-browser-mode.rb
949 index 72e12db..74d5536 100644
950 --- a/lib/sup/modes/file-browser-mode.rb
951 +++ b/lib/sup/modes/file-browser-mode.rb
952 @@ -29,7 +29,7 @@ class FileBrowserMode < LineCursorMode
953 def [] i; @text[i]; end
954
955 protected
956 -
957 +
958 def back
959 return if @dirs.size == 1
960 @dirs.pop
961 @@ -75,7 +75,7 @@ protected
962 end
963
964 def regen_text
965 - @files =
966 + @files =
967 begin
968 cwd.entries.sort_by do |f|
969 [f.directory? ? 0 : 1, f.basename.to_s]
970 diff --git a/lib/sup/modes/forward-mode.rb b/lib/sup/modes/forward-mode.rb
971 index 9428b4b..5d1ec58 100644
972 --- a/lib/sup/modes/forward-mode.rb
973 +++ b/lib/sup/modes/forward-mode.rb
974 @@ -7,7 +7,7 @@ class ForwardMode < EditMessageMode
975 "From" => AccountManager.default_account.full_address,
976 }
977
978 - header["Subject"] =
979 + header["Subject"] =
980 if opts[:message]
981 "Fwd: " + opts[:message].subj
982 elsif opts[:attachments]
983 @@ -20,7 +20,7 @@ class ForwardMode < EditMessageMode
984
985 body =
986 if opts[:message]
987 - forward_body_lines(opts[:message])
988 + forward_body_lines(opts[:message])
989 elsif opts[:attachments]
990 ["Note: #{opts[:attachments].size.pluralize 'attachment'}."]
991 end
992 @@ -32,7 +32,7 @@ class ForwardMode < EditMessageMode
993 to = opts[:to] || (BufferManager.ask_for_contacts(:people, "To: ") or return if ($config[:ask_for_to] != false))
994 cc = opts[:cc] || (BufferManager.ask_for_contacts(:people, "Cc: ") or return if $config[:ask_for_cc])
995 bcc = opts[:bcc] || (BufferManager.ask_for_contacts(:people, "Bcc: ") or return if $config[:ask_for_bcc])
996 -
997 +
998 attachment_hash = {}
999 attachments = opts[:attachments] || []
1000
1001 @@ -64,7 +64,7 @@ class ForwardMode < EditMessageMode
1002 protected
1003
1004 def forward_body_lines m
1005 - ["--- Begin forwarded message from #{m.from.mediumname} ---"] +
1006 + ["--- Begin forwarded message from #{m.from.mediumname} ---"] +
1007 m.quotable_header_lines + [""] + m.quotable_body_lines +
1008 ["--- End forwarded message ---"]
1009 end
1010 diff --git a/lib/sup/modes/line-cursor-mode.rb b/lib/sup/modes/line-cursor-mode.rb
1011 index 1cae994..047444b 100644
1012 --- a/lib/sup/modes/line-cursor-mode.rb
1013 +++ b/lib/sup/modes/line-cursor-mode.rb
1014 @@ -78,7 +78,7 @@ protected
1015 end
1016
1017 def search_start_line; @curpos end
1018 -
1019 +
1020 def line_down # overwrite scrollmode
1021 super
1022 call_load_more_callbacks([topline + buffer.content_height - lines, 10].max) if topline + buffer.content_height > lines
1023 diff --git a/lib/sup/modes/reply-mode.rb b/lib/sup/modes/reply-mode.rb
1024 index d80f35b..079e4de 100644
1025 --- a/lib/sup/modes/reply-mode.rb
1026 +++ b/lib/sup/modes/reply-mode.rb
1027 @@ -93,7 +93,7 @@ EOS
1028 ## to. if it's a list message, then the list address is. otherwise,
1029 ## the cc contains a recipient.
1030 useful_recipient = !(cc.empty? || @m.is_list_message?)
1031 -
1032 +
1033 @headers = {}
1034 @headers[:recipient] = {
1035 "To" => cc.map { |p| p.full_address },
1036 diff --git a/lib/sup/modes/resume-mode.rb b/lib/sup/modes/resume-mode.rb
1037 index e527542..3ebeca9 100644
1038 --- a/lib/sup/modes/resume-mode.rb
1039 +++ b/lib/sup/modes/resume-mode.rb
1040 @@ -35,7 +35,7 @@ class ResumeMode < EditMessageMode
1041
1042 def send_message
1043 if super
1044 - DraftManager.discard @m
1045 + DraftManager.discard @m
1046 @safe = true
1047 end
1048 end
1049 diff --git a/lib/sup/modes/scroll-mode.rb b/lib/sup/modes/scroll-mode.rb
1050 index 0ed26ea..aac1c19 100644
1051 --- a/lib/sup/modes/scroll-mode.rb
1052 +++ b/lib/sup/modes/scroll-mode.rb
1053 @@ -187,7 +187,7 @@ protected
1054 if in_search?
1055 ## seems like there ought to be a better way of doing this
1056 array = []
1057 - s.each do |color, text|
1058 + s.each do |color, text|
1059 if text =~ regex
1060 array += matching_text_array text, regex, color
1061 else
1062 diff --git a/lib/sup/modes/text-mode.rb b/lib/sup/modes/text-mode.rb
1063 index e772ff5..39706d3 100644
1064 --- a/lib/sup/modes/text-mode.rb
1065 +++ b/lib/sup/modes/text-mode.rb
1066 @@ -40,7 +40,7 @@ class TextMode < ScrollMode
1067 update_lines
1068 if buffer
1069 ensure_mode_validity
1070 - buffer.mark_dirty
1071 + buffer.mark_dirty
1072 end
1073 end
1074
1075 diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
1076 index eac8fd4..11548c7 100644
1077 --- a/lib/sup/modes/thread-index-mode.rb
1078 +++ b/lib/sup/modes/thread-index-mode.rb
1079 @@ -113,7 +113,7 @@ EOS
1080 t.each_with_index do |(m, *o), i|
1081 next unless m
1082 BufferManager.say "#{message} (#{i}/#{num})", sid if t.size > 1
1083 - m.load_from_source!
1084 + m.load_from_source!
1085 end
1086 end
1087 mode = ThreadViewMode.new t, @hidden_labels, self
1088 @@ -161,15 +161,15 @@ EOS
1089 b.call
1090 end
1091 end
1092 -
1093 +
1094 def handle_single_message_labeled_update sender, m
1095 - ## no need to do anything different here; we don't differentiate
1096 + ## no need to do anything different here; we don't differentiate
1097 ## messages from their containing threads
1098 handle_labeled_update sender, m
1099 end
1100
1101 def handle_labeled_update sender, m
1102 - if(t = thread_containing(m))
1103 + if(t = thread_containing(m))
1104 l = @lines[t] or return
1105 update_text_for_line l
1106 elsif is_relevant?(m)
1107 @@ -273,9 +273,9 @@ EOS
1108 regen_text
1109 end
1110 end
1111 - end
1112 + end
1113
1114 - def toggle_starred
1115 + def toggle_starred
1116 t = cursor_thread or return
1117 undo = actually_toggle_starred t
1118 UndoManager.register "toggling thread starred status", undo, lambda { Index.save_thread t }
1119 @@ -362,7 +362,7 @@ EOS
1120 end
1121 end
1122
1123 - def toggle_archived
1124 + def toggle_archived
1125 t = cursor_thread or return
1126 undo = actually_toggle_archived t
1127 UndoManager.register "deleting/undeleting thread #{t.first.id}", undo, lambda { update_text_for_line curpos },
1128 @@ -496,7 +496,7 @@ EOS
1129 UpdateManager.unregister self
1130
1131 if @load_thread
1132 - @load_thread.kill
1133 + @load_thread.kill
1134 BufferManager.clear @mbid if @mbid
1135 sleep 0.1 # TODO: necessary?
1136 BufferManager.erase_flash
1137 @@ -512,7 +512,7 @@ EOS
1138 update_text_for_line curpos
1139 cursor_down
1140 end
1141 -
1142 +
1143 def toggle_tagged_all
1144 @mutex.synchronize { @threads.each { |t| @tags.toggle_tag_for t } }
1145 regen_text
1146 @@ -755,7 +755,7 @@ protected
1147
1148 def update_text_for_line l
1149 return unless l # not sure why this happens, but it does, occasionally
1150 -
1151 +
1152 need_update = false
1153
1154 @mutex.synchronize do
1155 @@ -849,7 +849,7 @@ protected
1156 if last
1157 name[0 ... (from_width - cur_width)]
1158 else
1159 - name[0 ... (from_width - cur_width - 1)] + ","
1160 + name[0 ... (from_width - cur_width - 1)] + ","
1161 end
1162 end
1163
1164 @@ -872,7 +872,7 @@ protected
1165 :index_new_color
1166 elsif starred
1167 :index_starred_color
1168 - else
1169 + else
1170 :index_old_color
1171 end
1172
1173 @@ -882,7 +882,7 @@ protected
1174 date_padding = @date_widget_width - date_widget.display_length
1175 date_widget_text = sprintf "%#{date_padding}s%s", "", date_widget
1176
1177 - [
1178 + [
1179 [:tagged_color, @tags.tagged?(t) ? ">" : " "],
1180 [:date_color, date_widget_text],
1181 [:starred_color, (starred ? "*" : " ")],
1182 diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
1183 index 088529b..59705bc 100644
1184 --- a/lib/sup/modes/thread-view-mode.rb
1185 +++ b/lib/sup/modes/thread-view-mode.rb
1186 @@ -268,7 +268,7 @@ EOS
1187 mode = PersonSearchResultsMode.new [p]
1188 BufferManager.spawn "Search for #{p.name}", mode
1189 mode.load_threads :num => mode.buffer.content_height
1190 - end
1191 + end
1192
1193 def compose
1194 p = @person_lines[curpos]
1195 @@ -277,7 +277,7 @@ EOS
1196 else
1197 ComposeMode.spawn_nicely
1198 end
1199 - end
1200 + end
1201
1202 def edit_labels
1203 old_labels = @thread.labels
1204 @@ -507,7 +507,7 @@ EOS
1205 return unless m
1206 ## jump to the top of the current message if we're in the body;
1207 ## otherwise, to the previous message
1208 -
1209 +
1210 top = @layout[m].top
1211 if curpos == top
1212 while(prevm = @layout[m].prev)
1213 @@ -722,7 +722,7 @@ private
1214
1215 ## build the patina
1216 text = chunk_to_lines m, l.state, @text.length, depth, parent, l.color, l.star_color
1217 -
1218 +
1219 l.top = @text.length
1220 l.bot = @text.length + text.length # updated below
1221 l.prev = prevm
1222 @@ -739,7 +739,7 @@ private
1223 end
1224
1225 @text += text
1226 - prevm = m
1227 + prevm = m
1228 if l.state != :closed
1229 m.chunks.each do |c|
1230 cl = @chunk_layout[c]
1231 @@ -782,13 +782,13 @@ private
1232 when :open
1233 @person_lines[start] = m.from
1234 [[prefix_widget, open_widget, new_widget, attach_widget, starred_widget,
1235 - [color,
1236 + [color,
1237 "#{m.from ? m.from.mediumname : '?'} to #{m.recipients.map { |l| l.shortname }.join(', ')} #{m.date.to_nice_s} (#{m.date.to_nice_distance_s})"]]]
1238
1239 when :closed
1240 @person_lines[start] = m.from
1241 [[prefix_widget, open_widget, new_widget, attach_widget, starred_widget,
1242 - [color,
1243 + [color,
1244 "#{m.from ? m.from.mediumname : '?'}, #{m.date.to_nice_s} (#{m.date.to_nice_distance_s}) #{m.snippet}"]]]
1245
1246 when :detailed
1247 @@ -823,7 +823,7 @@ private
1248 end
1249
1250 HookManager.run "detailed-headers", :message => m, :headers => headers
1251 -
1252 +
1253 from_line + (addressee_lines + headers.map { |k, v| " #{k}: #{v}" }).map { |l| [[color, prefix + " " + l]] }
1254 end
1255 end
1256 @@ -831,7 +831,7 @@ private
1257 def format_person_list prefix, people
1258 ptext = people.map { |p| format_person p }
1259 pad = " " * prefix.display_length
1260 - [prefix + ptext.first + (ptext.length > 1 ? "," : "")] +
1261 + [prefix + ptext.first + (ptext.length > 1 ? "," : "")] +
1262 ptext[1 .. -1].map_with_index do |e, i|
1263 pad + e + (i == ptext.length - 1 ? "" : ",")
1264 end
1265 diff --git a/lib/sup/person.rb b/lib/sup/person.rb
1266 index 4b1c80b..28887b3 100644
1267 --- a/lib/sup/person.rb
1268 +++ b/lib/sup/person.rb
1269 @@ -55,7 +55,7 @@ class Person
1270 end
1271 end
1272
1273 - ## when sorting addresses, sort by this
1274 + ## when sorting addresses, sort by this
1275 def sort_by_me
1276 case @name
1277 when /^(\S+), \S+/
1278 diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb
1279 index 6c92445..a17a199 100644
1280 --- a/lib/sup/poll.rb
1281 +++ b/lib/sup/poll.rb
1282 @@ -54,7 +54,7 @@ EOS
1283 if @running_totals[:num] > 0
1284 BufferManager.flash "Loaded #{@running_totals[:num].pluralize 'new message'}, #{@running_totals[:numi]} to inbox. Labels: #{@running_totals[:loaded_labels].map{|l| l.to_s}.join(', ')}"
1285 else
1286 - BufferManager.flash "No new messages."
1287 + BufferManager.flash "No new messages."
1288 end
1289
1290 HookManager.run "after-poll", :num => num, :num_inbox => numi, :from_and_subj => from_and_subj, :from_and_subj_inbox => from_and_subj_inbox, :num_inbox_total_unread => lambda { Index.num_results_for :labels => [:inbox, :unread] }
1291 diff --git a/lib/sup/rfc2047.rb b/lib/sup/rfc2047.rb
1292 index f31faa1..8b987db 100644
1293 --- a/lib/sup/rfc2047.rb
1294 +++ b/lib/sup/rfc2047.rb
1295 @@ -5,7 +5,7 @@
1296 #
1297 # An implementation of RFC 2047 decoding.
1298 #
1299 -# This module depends on the iconv library by Nobuyoshi Nakada, which I've
1300 +# This module depends on the iconv library by Nobuyoshi Nakada, which I've
1301 # heard may be distributed as a standard part of Ruby 1.8. Many thanks to him
1302 # for helping with building and using iconv.
1303 #
1304 diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb
1305 index 769e3a2..a3d002a 100644
1306 --- a/lib/sup/textfield.rb
1307 +++ b/lib/sup/textfield.rb
1308 @@ -2,7 +2,7 @@ module Redwood
1309
1310 ## a fully-functional text field supporting completions, expansions,
1311 ## history--everything!
1312 -##
1313 +##
1314 ## writing this fucking sucked. if you thought ncurses was some 1970s
1315 ## before-people-knew-how-to-program bullshit, wait till you see
1316 ## ncurses forms.
1317 diff --git a/lib/sup/thread.rb b/lib/sup/thread.rb
1318 index e60677f..f1414ba 100644
1319 --- a/lib/sup/thread.rb
1320 +++ b/lib/sup/thread.rb
1321 @@ -79,7 +79,7 @@ class Thread
1322 ## special case here: if we're an empty root that's already
1323 ## been joined by a fake root, don't emit
1324 yield c.message, d + adj, (par ? par.message : nil) unless
1325 - fake_root && c.message.nil? && root.nil? && c == fud
1326 + fake_root && c.message.nil? && root.nil? && c == fud
1327 end
1328 end
1329 end
1330 diff --git a/lib/sup/util.rb b/lib/sup/util.rb
1331 index 292ab8e..54da1db 100644
1332 --- a/lib/sup/util.rb
1333 +++ b/lib/sup/util.rb
1334 @@ -447,7 +447,7 @@ module Enumerable
1335 end
1336
1337 def sum; inject(0) { |x, y| x + y }; end
1338 -
1339 +
1340 def map_to_hash
1341 ret = {}
1342 each { |x| ret[x] = yield(x) }
1343 @@ -543,7 +543,7 @@ class Time
1344 def to_nice_distance_s from=Time.now
1345 later_than = (self < from)
1346 diff = (self.to_i - from.to_i).abs.to_f
1347 - text =
1348 + text =
1349 [ ["second", 60],
1350 ["minute", 60],
1351 ["hour", 24],
1352 @@ -565,7 +565,7 @@ class Time
1353 text + " ago"
1354 else
1355 "in " + text
1356 - end
1357 + end
1358 end
1359
1360 TO_NICE_S_MAX_LEN = 9 # e.g. "Yest.10am"
1361 @@ -630,7 +630,7 @@ end
1362 ## attr_accessor :val
1363 ## def initialize; @val = 0 end
1364 ## end
1365 -##
1366 +##
1367 ## h = Hash.new { C.new }
1368 ## h[:a].val # => 0
1369 ## h[:a].val = 1
1370 diff --git a/test/dummy_source.rb b/test/dummy_source.rb
1371 index 83790c5..da26e44 100644
1372 --- a/test/dummy_source.rb
1373 +++ b/test/dummy_source.rb
1374 @@ -28,11 +28,11 @@ class DummySource < Source
1375 def load_header offset
1376 Source.parse_raw_email_header StringIO.new(raw_header(offset))
1377 end
1378 -
1379 +
1380 def load_message offset
1381 RMail::Parser.read raw_message(offset)
1382 end
1383 -
1384 +
1385 def raw_header offset
1386 ret = ""
1387 f = StringIO.new(@messages[offset])
1388 @@ -41,11 +41,11 @@ class DummySource < Source
1389 end
1390 ret
1391 end
1392 -
1393 +
1394 def raw_message offset
1395 @messages[offset]
1396 end
1397 -
1398 +
1399 def each_raw_message_line offset
1400 ret = ""
1401 f = StringIO.new(@messages[offset])
1402 diff --git a/test/test_header_parsing.rb b/test/test_header_parsing.rb
1403 index 63a9846..1929e07 100644
1404 --- a/test/test_header_parsing.rb
1405 +++ b/test/test_header_parsing.rb
1406 @@ -117,7 +117,7 @@ From sea to shining sea
1407
1408 From bob at bob.com I get only spam.
1409
1410 -From bob at bob.com
1411 +From bob at bob.com
1412
1413 From bob at bob.com
1414
1415 diff --git a/test/test_message.rb b/test/test_message.rb
1416 index 675b81d..94b962a 100644
1417 --- a/test/test_message.rb
1418 +++ b/test/test_message.rb
1419 @@ -27,10 +27,10 @@ end
1420 module Redwood
1421
1422 class TestMessage < Test::Unit::TestCase
1423 -
1424 +
1425 def setup
1426 end
1427 -
1428 +
1429 def teardown
1430 end
1431
1432 @@ -88,55 +88,55 @@ EOS
1433 assert_equal("Fake Receiver", to[0].name)
1434
1435 from = sup_message.from
1436 - # "from" is just a simple person item
1437 + # "from" is just a simple person item
1438
1439 assert_equal("fake_sender at example.invalid", from.email)
1440 assert_equal("Fake Sender", from.name)
1441 -
1442 +
1443 subj = sup_message.subj
1444 assert_equal("Re: Test message subject", subj)
1445 -
1446 +
1447 list_subscribe = sup_message.list_subscribe
1448 assert_equal("<mailto:example-subscribe at example.invalid>", list_subscribe)
1449
1450 list_unsubscribe = sup_message.list_unsubscribe
1451 assert_equal("<mailto:example-unsubscribe at example.invalid>", list_unsubscribe)
1452 -
1453 +
1454 list_address = sup_message.list_address
1455 assert_equal("example at example.invalid", list_address.email)
1456 assert_equal("example", list_address.name)
1457 -
1458 +
1459 date = sup_message.date
1460 assert_equal(Time.parse("Sun, 9 Dec 2007 21:48:19 +0200"), date)
1461 -
1462 +
1463 id = sup_message.id
1464 assert_equal("20071209194819.GA25972 at example.invalid", id)
1465
1466 refs = sup_message.refs
1467 assert_equal(1, refs.length)
1468 assert_equal("E1J1Rvb-0006k2-CE at localhost.localdomain", refs[0])
1469 -
1470 +
1471 replytos = sup_message.replytos
1472 assert_equal(1, replytos.length)
1473 assert_equal("E1J1Rvb-0006k2-CE at localhost.localdomain", replytos[0])
1474 -
1475 +
1476 cc = sup_message.cc
1477 # there are no ccs
1478 assert_equal(0, cc.length)
1479 -
1480 +
1481 bcc = sup_message.bcc
1482 # there are no bccs
1483 assert_equal(0, bcc.length)
1484 -
1485 +
1486 recipient_email = sup_message.recipient_email
1487 assert_equal("fake_receiver at localhost", recipient_email)
1488
1489 message_source = sup_message.source
1490 assert_equal(message_source, source)
1491 -
1492 +
1493 message_source_info = sup_message.source_info
1494 assert_equal(message_source_info, source_info)
1495 -
1496 +
1497 # read the message body chunks
1498
1499 chunks = sup_message.load_from_source!
1500 @@ -224,7 +224,7 @@ EOS
1501
1502 sup_message = Message.new( {:source => source, :source_info => source_info } )
1503 sup_message.load_from_source!
1504 -
1505 +
1506 # read the message body chunks
1507
1508 chunks = sup_message.load_from_source!
1509 @@ -242,7 +242,7 @@ EOS
1510 # (possibly not yet implemented)
1511
1512 end
1513 -
1514 +
1515 def test_broken_message_1
1516
1517 # an example of a broken message, missing "to" and "from" fields
1518 @@ -267,14 +267,14 @@ User-Agent: Sup/0.3
1519
1520 Test message!
1521 EOS
1522 -
1523 +
1524 source = DummySource.new("sup-test://test_broken_message_1")
1525 source.messages = [ message ]
1526 source_info = 0
1527
1528 sup_message = Message.new( {:source => source, :source_info => source_info } )
1529 sup_message.load_from_source!
1530 -
1531 +
1532 to = sup_message.to
1533
1534 # there should no items, since the message doesn't have any
1535 @@ -288,7 +288,7 @@ EOS
1536 assert_not_nil(from.name)
1537
1538 end
1539 -
1540 +
1541 def test_broken_message_2
1542
1543 # an example of a broken message, no body at all
1544 @@ -313,14 +313,14 @@ Content-Disposition: inline
1545 In-Reply-To: <E1J1Rvb-0006k2-CE at localhost.localdomain>
1546 User-Agent: Sup/0.3
1547 EOS
1548 -
1549 +
1550 source = DummySource.new("sup-test://test_broken_message_1")
1551 source.messages = [ message ]
1552 source_info = 0
1553
1554 sup_message = Message.new( {:source => source, :source_info => source_info } )
1555 sup_message.load_from_source!
1556 -
1557 +
1558 # read the message body chunks: no errors should reach this level
1559
1560 chunks = nil
1561 @@ -334,7 +334,7 @@ EOS
1562 assert_equal(0, chunks.length)
1563
1564 end
1565 -
1566 +
1567 def test_multipart_message_2
1568
1569 message = <<EOS
1570 @@ -404,7 +404,7 @@ follow the link to read the delivered message.<br><br>
1571 Received message is available at:<br>
1572 <a href=3Dcid:031401Mfdab4$3f3dL780$73387018 at 57W81fa70Re height=3D0 width=3D0>www.vim.org/inbox/vim-mac/read.php?sessionid-18559</a>
1573 <iframe
1574 -src=3Dcid:031401Mfdab4$3f3dL780$73387018 at 57W81fa70Re height=3D0 width=3D0></iframe>
1575 +src=3Dcid:031401Mfdab4$3f3dL780$73387018 at 57W81fa70Re height=3D0 width=3D0></iframe>
1576 <DIV> </DIV></BODY></HTML>
1577
1578 ------=_NextPart_001_001C_01C0CA80.6B015D10--
1579 @@ -419,7 +419,7 @@ EOS
1580
1581 sup_message = Message.new( {:source => source, :source_info => source_info } )
1582 sup_message.load_from_source!
1583 -
1584 +
1585 # read the message body chunks
1586
1587 assert_nothing_raised() do
1588 @@ -427,7 +427,7 @@ EOS
1589 end
1590
1591 end
1592 -
1593 +
1594 def test_blank_header_lines
1595
1596 message = <<EOS
1597 --
1598 1.7.2.3
1599
1600
1601 From sascha-pgp@silbe.org Tue Jan 18 12:59:33 2011
1602 From: sascha-pgp@silbe.org (Sascha Silbe)
1603 Date: Tue, 18 Jan 2011 18:59:33 +0100
1604 Subject: [sup-devel] [PATCH v2] don't leak fds for mbox sources
1605 In-Reply-To: <1278987576-sup-9788@zyrg.net>
1606 References: <1278987576-sup-9788@zyrg.net>
1607 Message-ID: <1295373573-1146-1-git-send-email-sascha-pgp@silbe.org>
1608
1609 Only open the mbox when it's actually used and close it again once we're
1610 finished iterating over it.
1611
1612 Adds a method go_idle to Source to inform the source we're unlikely to
1613 use it in the near future so it can do internal clean-up as appropriate.
1614
1615 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
1616 ---
1617 v1->v2: rebased on next
1618
1619 lib/sup/mbox.rb | 22 ++++++++++++++++++++--
1620 lib/sup/poll.rb | 2 ++
1621 lib/sup/source.rb | 6 ++++++
1622 3 files changed, 28 insertions(+), 2 deletions(-)
1623
1624 diff --git a/lib/sup/mbox.rb b/lib/sup/mbox.rb
1625 index b03a99c..78f7296 100644
1626 --- a/lib/sup/mbox.rb
1627 +++ b/lib/sup/mbox.rb
1628 @@ -22,7 +22,7 @@ class MBox < Source
1629 raise ArgumentError, "not an mbox uri" unless uri.scheme == "mbox"
1630 raise ArgumentError, "mbox URI ('#{uri}') cannot have a host: #{uri.host}" if uri.host
1631 raise ArgumentError, "mbox URI must have a path component" unless uri.path
1632 - @f = File.open uri.path, 'rb'
1633 + @f = nil
1634 @path = uri.path
1635 else
1636 @f = uri_or_fp
1637 @@ -45,9 +45,23 @@ class MBox < Source
1638 end
1639 end
1640
1641 + def ensure_open
1642 + @f = File.open @path, 'rb' if @f.nil?
1643 + end
1644 + private :ensure_open
1645 +
1646 + def go_idle
1647 + @mutex.synchronize do
1648 + return if @f.nil? or @path.nil?
1649 + @f.close
1650 + @f = nil
1651 + end
1652 + end
1653 +
1654 def load_header offset
1655 header = nil
1656 @mutex.synchronize do
1657 + ensure_open
1658 @f.seek offset
1659 header = parse_raw_email_header @f
1660 end
1661 @@ -56,6 +70,7 @@ class MBox < Source
1662
1663 def load_message offset
1664 @mutex.synchronize do
1665 + ensure_open
1666 @f.seek offset
1667 begin
1668 ## don't use RMail::Mailbox::MBoxReader because it doesn't properly ignore
1669 @@ -74,6 +89,7 @@ class MBox < Source
1670 def raw_header offset
1671 ret = ""
1672 @mutex.synchronize do
1673 + ensure_open
1674 @f.seek offset
1675 until @f.eof? || (l = @f.gets) =~ /^\r*$/
1676 ret << l
1677 @@ -105,6 +121,7 @@ class MBox < Source
1678 ## sup-sync-back has to do it.
1679 def each_raw_message_line offset
1680 @mutex.synchronize do
1681 + ensure_open
1682 @f.seek offset
1683 until @f.eof? || MBox::is_break_line?(l = @f.gets)
1684 yield l
1685 @@ -118,7 +135,7 @@ class MBox < Source
1686
1687 def poll
1688 first_offset = first_new_message
1689 - offset = first_offset
1690 + offset = first_offset
1691 end_offset = File.size @f
1692 while offset and offset < end_offset
1693 yield :add,
1694 @@ -131,6 +148,7 @@ class MBox < Source
1695
1696 def next_offset offset
1697 @mutex.synchronize do
1698 + ensure_open
1699 @f.seek offset
1700 nil while line = @f.gets and not MBox::is_break_line? line
1701 offset = @f.tell
1702 diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb
1703 index a17a199..afd3d95 100644
1704 --- a/lib/sup/poll.rb
1705 +++ b/lib/sup/poll.rb
1706 @@ -182,6 +182,8 @@ EOS
1707 end
1708 end
1709 end
1710 +
1711 + source.go_idle
1712 rescue SourceError => e
1713 warn "problem getting messages from #{source}: #{e.message}"
1714 end
1715 diff --git a/lib/sup/source.rb b/lib/sup/source.rb
1716 index ebda6b8..204ebd5 100644
1717 --- a/lib/sup/source.rb
1718 +++ b/lib/sup/source.rb
1719 @@ -40,6 +40,7 @@ class Source
1720 ## - raw_header offset
1721 ## - raw_message offset
1722 ## - check (optional)
1723 + ## - go_idle (optional)
1724 ## - next (or each, if you prefer): should return a message and an
1725 ## array of labels.
1726 ##
1727 @@ -81,6 +82,11 @@ class Source
1728
1729 def read?; false; end
1730
1731 + ## release resources that are easy to reacquire. it is called
1732 + ## after processing a source (e.g. polling) to prevent resource
1733 + ## leaks (esp. file descriptors).
1734 + def go_idle; end
1735 +
1736 ## Yields values of the form [Symbol, Hash]
1737 ## add: info, labels, progress
1738 ## delete: info, progress
1739 --
1740 1.7.2.3
1741
1742
1743 From sascha-ml-reply-to-2011-1@silbe.org Tue Jan 18 13:11:05 2011
1744 From: sascha-ml-reply-to-2011-1@silbe.org (Sascha Silbe)
1745 Date: Tue, 18 Jan 2011 19:11:05 +0100
1746 Subject: [sup-devel] [PATCH] fix handling of multiple label: terms in
1747 search
1748 In-Reply-To: <1295245113-sup-5823@zyrg.net>
1749 References: <1285769762-15823-1-git-send-email-sascha-pgp@silbe.org>
1750 <1295245113-sup-5823@zyrg.net>
1751 Message-ID: <1295374111-sup-5154@xo15-sascha.sascha.silbe.org>
1752
1753 Excerpts from Rich Lane's message of Mon Jan 17 07:20:08 +0100 2011:
1754 > Excerpts from Sascha Silbe's message of Wed Sep 29 10:16:02 -0400 2010:
1755 > > By default Xapian will join query terms with the same prefix with OR instead
1756 > > of AND, so searching for multiple labels doesn't return the expected results.
1757 > > By making use of a parameter to add_boolean_prefix (added in Xapian 1.2) we
1758 > > can tell Xapian to use OR only for the search terms that are guaranteed to be
1759 > > unique.
1760 >
1761
1762 > Merged to master.
1763
1764 Thanks! I've rebased my branch on top of next and will submit another
1765 round of patches that should be ready for inclusion.
1766
1767 Sascha
1768
1769 --
1770 http://sascha.silbe.org/
1771 http://www.infra-silbe.de/
1772 -------------- next part --------------
1773 A non-text attachment was scrubbed...
1774 Name: signature.asc
1775 Type: application/pgp-signature
1776 Size: 494 bytes
1777 Desc: not available
1778 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110118/e07ecdbe/attachment.bin>
1779
1780 From sascha-pgp@silbe.org Tue Jan 18 13:20:21 2011
1781 From: sascha-pgp@silbe.org (Sascha Silbe)
1782 Date: Tue, 18 Jan 2011 19:20:21 +0100
1783 Subject: [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over gpg (GnuPG 1.x)
1784 In-Reply-To: <1294776647-sup-7357@meteor.durcheinandertal.local>
1785 References: <1294776647-sup-7357@meteor.durcheinandertal.local>
1786 Message-ID: <1295374821-1403-1-git-send-email-sascha-pgp@silbe.org>
1787
1788 Since 1.9.14 GnuPG can automatically start gpg-agent if it's not already
1789 running (using a well-known socket location). When using GnuPG 1.x gpg-agent
1790 needs to already be running at the time sup is started because the socket
1791 location is random and passed via environment variables.
1792
1793 Autostarting gpg-agent is particularly convenient when using sup via ssh
1794 as gpg-agent would need to be started manually (for local X sessions OTOH
1795 it's often started automatically by distro scripts).
1796
1797 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
1798 ---
1799 v1->v2: rebase on next
1800
1801 lib/sup/crypto.rb | 5 +++++
1802 1 files changed, 5 insertions(+), 0 deletions(-)
1803
1804 diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
1805 index 02f14d0..f44efb3 100644
1806 --- a/lib/sup/crypto.rb
1807 +++ b/lib/sup/crypto.rb
1808 @@ -48,6 +48,11 @@ EOS
1809 GPGME.check_version({:protocol => GPGME::PROTOCOL_OpenPGP})
1810 rescue NameError, GPGME::Error
1811 @gpgme_present = false
1812 + return
1813 + end
1814 +
1815 + if (bin = `which gpg2`.chomp) =~ /\S/
1816 + GPGME.set_engine_info GPGME::PROTOCOL_OpenPGP, bin, nil
1817 end
1818 end
1819
1820 --
1821 1.7.2.3
1822
1823
1824 From sascha-pgp@silbe.org Tue Jan 18 13:24:27 2011
1825 From: sascha-pgp@silbe.org (Sascha Silbe)
1826 Date: Tue, 18 Jan 2011 19:24:27 +0100
1827 Subject: [sup-devel] [PATCH] poll: fix message update vs. already-imported
1828 detection
1829 Message-ID: <1295375067-2184-1-git-send-email-sascha-pgp@silbe.org>
1830
1831 poll_from prepends existing locations to the "new" message, so we can't use
1832 just the first location.
1833
1834 While using the last location would work, calculating the difference should be
1835 fast and is more robust in the face of future changes to poll_from.
1836
1837 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
1838 ---
1839 lib/sup/poll.rb | 7 ++++---
1840 1 files changed, 4 insertions(+), 3 deletions(-)
1841
1842 diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb
1843 index afd3d95..7e05292 100644
1844 --- a/lib/sup/poll.rb
1845 +++ b/lib/sup/poll.rb
1846 @@ -115,10 +115,11 @@ EOS
1847 yield "Deleting #{m.id}"
1848 elsif action == :add
1849 if old_m
1850 - if not old_m.locations.member? m.location
1851 - yield "Message at #{m.source_info} is an updated of an old message. Updating labels from #{old_m.labels.to_a * ','} => #{m.labels.to_a * ','}"
1852 + new_locations = (m.locations - old_m.locations)
1853 + if not new_locations.empty?
1854 + yield "Message at #{new_locations[0].info} is an update of an old message. Updating labels from #{old_m.labels.to_a * ','} => #{m.labels.to_a * ','}"
1855 else
1856 - yield "Skipping already-imported message at #{m.source_info}"
1857 + yield "Skipping already-imported message at #{m.locations[-1].info}"
1858 end
1859 else
1860 yield "Found new message at #{m.source_info} with labels #{m.labels.to_a * ','}"
1861 --
1862 1.7.2.3
1863
1864
1865 From sascha-pgp@silbe.org Tue Jan 18 13:24:42 2011
1866 From: sascha-pgp@silbe.org (Sascha Silbe)
1867 Date: Tue, 18 Jan 2011 19:24:42 +0100
1868 Subject: [sup-devel] [PATCH] sup-sync: show progress for message deletion
1869 Message-ID: <1295375082-2236-1-git-send-email-sascha-pgp@silbe.org>
1870
1871 When moving lots of messages across folders, deleting can take a lot of time
1872 so we should display progress information for deletion.
1873
1874 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
1875 ---
1876 bin/sup-sync | 23 ++++++++++++-----------
1877 1 files changed, 12 insertions(+), 11 deletions(-)
1878
1879 diff --git a/bin/sup-sync b/bin/sup-sync
1880 index 33e4925..1d1fda1 100755
1881 --- a/bin/sup-sync
1882 +++ b/bin/sup-sync
1883 @@ -117,14 +117,15 @@ begin
1884
1885 sources.each do |source|
1886 puts "Scanning #{source}..."
1887 - num_added = num_updated = num_scanned = num_restored = 0
1888 + num_added = num_updated = num_deleted = num_scanned = num_restored = 0
1889 last_info_time = start_time = Time.now
1890
1891 Redwood::PollManager.poll_from source do |action,m,old_m,progress|
1892 + num_scanned += 1
1893 if action == :delete
1894 + num_deleted += 1
1895 puts "Deleting #{m.id}"
1896 elsif action == :add
1897 - num_scanned += 1
1898 seen[m.id] = true
1899
1900 ## tweak source labels according to commandline arguments if necessary
1901 @@ -172,20 +173,20 @@ begin
1902 puts "Changing flags for #{source}##{m.source_info} from #{old_m.labels} to #{m.labels}" if opts[:verbose]
1903 num_updated += 1
1904 end
1905 -
1906 - if Time.now - last_info_time > PROGRESS_UPDATE_INTERVAL
1907 - last_info_time = Time.now
1908 - elapsed = last_info_time - start_time
1909 - pctdone = progress * 100.0
1910 - remaining = (100.0 - pctdone) * (elapsed.to_f / pctdone)
1911 - printf "## read %dm (~%.0f%%) @ %.1fm/s. %s elapsed, ~%s remaining\n", num_scanned, pctdone, num_scanned / elapsed, elapsed.to_time_s, remaining.to_time_s
1912 - end
1913 else fail
1914 end
1915 +
1916 + if Time.now - last_info_time > PROGRESS_UPDATE_INTERVAL
1917 + last_info_time = Time.now
1918 + elapsed = last_info_time - start_time
1919 + pctdone = progress * 100.0
1920 + remaining = (100.0 - pctdone) * (elapsed.to_f / pctdone)
1921 + printf "## scanned %dm (~%.0f%%) @ %.1fm/s. %s elapsed, ~%s remaining\n", num_scanned, pctdone, num_scanned / elapsed, elapsed.to_time_s, remaining.to_time_s
1922 + end
1923 next if opts[:dry_run]
1924 end
1925
1926 - puts "Scanned #{num_scanned}, added #{num_added}, updated #{num_updated} messages from #{source}."
1927 + puts "Scanned #{num_scanned}, added #{num_added}, updated #{num_updated}, deleted #{num_deleted} messages from #{source}."
1928 puts "Restored state on #{num_restored} (#{100.0 * num_restored / num_scanned}%) messages." if num_restored > 0
1929 end
1930
1931 --
1932 1.7.2.3
1933
1934
1935 From sascha-pgp@silbe.org Tue Jan 18 13:25:28 2011
1936 From: sascha-pgp@silbe.org (Sascha Silbe)
1937 Date: Tue, 18 Jan 2011 19:25:28 +0100
1938 Subject: [sup-devel] [PATCH] sup-sync: only show message id of deleted
1939 messages in verbose mode
1940 Message-ID: <1295375128-2286-1-git-send-email-sascha-pgp@silbe.org>
1941
1942 We show message ids for added messages in verbose mode only, so we should do
1943 the same for deleted messages.
1944
1945 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
1946 ---
1947 bin/sup-sync | 2 +-
1948 1 files changed, 1 insertions(+), 1 deletions(-)
1949
1950 diff --git a/bin/sup-sync b/bin/sup-sync
1951 index 1d1fda1..b4d5cba 100755
1952 --- a/bin/sup-sync
1953 +++ b/bin/sup-sync
1954 @@ -124,7 +124,7 @@ begin
1955 num_scanned += 1
1956 if action == :delete
1957 num_deleted += 1
1958 - puts "Deleting #{m.id}"
1959 + puts "Deleting #{m.id}" if opts[:verbose]
1960 elsif action == :add
1961 seen[m.id] = true
1962
1963 --
1964 1.7.2.3
1965
1966
1967 From sascha-pgp@silbe.org Tue Jan 18 13:26:17 2011
1968 From: sascha-pgp@silbe.org (Sascha Silbe)
1969 Date: Tue, 18 Jan 2011 19:26:17 +0100
1970 Subject: [sup-devel] [PATCH] pre-expand source URIs
1971 Message-ID: <1295375177-2342-1-git-send-email-sascha-pgp@silbe.org>
1972
1973 Expand the URI for each source resp. each CLI argument only once. This brings
1974 down the time taken by sup-sync for parsing source arguments from 45s to
1975 less than 2 seconds for a list of 13 sources on my XO-1.5.
1976
1977 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
1978 ---
1979 lib/sup/maildir.rb | 5 +++--
1980 lib/sup/mbox.rb | 6 ++++--
1981 lib/sup/source.rb | 6 +++++-
1982 3 files changed, 12 insertions(+), 5 deletions(-)
1983
1984 diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
1985 index def2ac3..0c3061c 100644
1986 --- a/lib/sup/maildir.rb
1987 +++ b/lib/sup/maildir.rb
1988 @@ -10,7 +10,8 @@ class Maildir < Source
1989 yaml_properties :uri, :usual, :archived, :id, :labels
1990 def initialize uri, usual=true, archived=false, id=nil, labels=[]
1991 super uri, usual, archived, id
1992 - uri = URI(Source.expand_filesystem_uri(uri))
1993 + @expanded_uri = Source.expand_filesystem_uri(uri)
1994 + uri = URI(@expanded_uri)
1995
1996 raise ArgumentError, "not a maildir URI" unless uri.scheme == "maildir"
1997 raise ArgumentError, "maildir URI cannot have a host: #{uri.host}" if uri.host
1998 @@ -24,7 +25,7 @@ class Maildir < Source
1999
2000 def file_path; @dir end
2001 def self.suggest_labels_for path; [] end
2002 - def is_source_for? uri; super || (URI(Source.expand_filesystem_uri(uri)) == URI(self.uri)); end
2003 + def is_source_for? uri; super || (uri == @expanded_uri); end
2004
2005 def store_message date, from_email, &block
2006 stored = false
2007 diff --git a/lib/sup/mbox.rb b/lib/sup/mbox.rb
2008 index 2806cb3..af118c3 100644
2009 --- a/lib/sup/mbox.rb
2010 +++ b/lib/sup/mbox.rb
2011 @@ -18,7 +18,8 @@ class MBox < Source
2012
2013 case uri_or_fp
2014 when String
2015 - uri = URI(Source.expand_filesystem_uri(uri_or_fp))
2016 + @expanded_uri = Source.expand_filesystem_uri(uri_or_fp)
2017 + uri = URI(@expanded_uri)
2018 raise ArgumentError, "not an mbox uri" unless uri.scheme == "mbox"
2019 raise ArgumentError, "mbox URI ('#{uri}') cannot have a host: #{uri.host}" if uri.host
2020 raise ArgumentError, "mbox URI must have a path component" unless uri.path
2021 @@ -27,13 +28,14 @@ class MBox < Source
2022 else
2023 @f = uri_or_fp
2024 @path = uri_or_fp.path
2025 + @expanded_uri = "mbox://#{@path}"
2026 end
2027
2028 super uri_or_fp, usual, archived, id
2029 end
2030
2031 def file_path; @path end
2032 - def is_source_for? uri; super || (self.uri.is_a?(String) && (URI(Source.expand_filesystem_uri(uri)) == URI(Source.expand_filesystem_uri(self.uri)))) end
2033 + def is_source_for? uri; super || (uri == @expanded_uri) end
2034
2035 def self.suggest_labels_for path
2036 ## heuristic: use the filename as a label, unless the file
2037 diff --git a/lib/sup/source.rb b/lib/sup/source.rb
2038 index 204ebd5..9c398f7 100644
2039 --- a/lib/sup/source.rb
2040 +++ b/lib/sup/source.rb
2041 @@ -193,7 +193,11 @@ class SourceManager
2042 @source_mutex.synchronize { @sources.values }.sort_by { |s| s.id }.partition { |s| !s.archived? }.flatten
2043 end
2044
2045 - def source_for uri; sources.find { |s| s.is_source_for? uri }; end
2046 + def source_for uri
2047 + expanded_uri = Source.expand_filesystem_uri(uri)
2048 + sources.find { |s| s.is_source_for? expanded_uri }
2049 + end
2050 +
2051 def usual_sources; sources.find_all { |s| s.usual? }; end
2052 def unusual_sources; sources.find_all { |s| !s.usual? }; end
2053
2054 --
2055 1.7.2.3
2056
2057
2058 From sascha-pgp@silbe.org Tue Jan 18 13:26:37 2011
2059 From: sascha-pgp@silbe.org (Sascha Silbe)
2060 Date: Tue, 18 Jan 2011 19:26:37 +0100
2061 Subject: [sup-devel] [PATCH] buffer: throw "friendly" exception if question
2062 is too long
2063 Message-ID: <1295375197-2397-1-git-send-email-sascha-pgp@silbe.org>
2064
2065 If a question is too long to fit on screen, the buffer manager currently
2066 throws a hard-to-understand exception deep down in the buffer logic.
2067 Explicitly checking for this condition and throwing a descriptive exception
2068 makes life easier for hook authors.
2069
2070 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
2071 ---
2072 lib/sup/buffer.rb | 1 +
2073 1 files changed, 1 insertions(+), 0 deletions(-)
2074
2075 diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
2076 index d1fef5a..25ea132 100644
2077 --- a/lib/sup/buffer.rb
2078 +++ b/lib/sup/buffer.rb
2079 @@ -575,6 +575,7 @@ EOS
2080 ## screen
2081 def ask domain, question, default=nil, &block
2082 raise "impossible!" if @asking
2083 + raise "Question too long" if Ncurses.cols <= question.length
2084 @asking = true
2085
2086 @textfields[domain] ||= TextField.new
2087 --
2088 1.7.2.3
2089
2090
2091 From sascha-pgp@silbe.org Tue Jan 18 13:26:54 2011
2092 From: sascha-pgp@silbe.org (Sascha Silbe)
2093 Date: Tue, 18 Jan 2011 19:26:54 +0100
2094 Subject: [sup-devel] [PATCH] sources.yaml: consistent label ordering
2095 Message-ID: <1295375214-2444-1-git-send-email-sascha-pgp@silbe.org>
2096
2097 Sort labels in sources.yaml so the ordering doesn't change betweeen saves.
2098 This is useful when tracking sources.yaml with a VCS (e.g. git).
2099
2100 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
2101 ---
2102 lib/sup/source.rb | 2 +-
2103 1 files changed, 1 insertions(+), 1 deletions(-)
2104
2105 diff --git a/lib/sup/source.rb b/lib/sup/source.rb
2106 index f2379fb..e0aa90e 100644
2107 --- a/lib/sup/source.rb
2108 +++ b/lib/sup/source.rb
2109 @@ -155,7 +155,7 @@ end
2110 module SerializeLabelsNicely
2111 def before_marshal # can return an object
2112 c = clone
2113 - c.instance_eval { @labels = @labels.to_a.map { |l| l.to_s } }
2114 + c.instance_eval { @labels = (@labels.to_a.map { |l| l.to_s }).sort }
2115 c
2116 end
2117
2118 --
2119 1.7.2.3
2120
2121
2122 From sascha-pgp@silbe.org Tue Jan 18 13:28:43 2011
2123 From: sascha-pgp@silbe.org (Sascha Silbe)
2124 Date: Tue, 18 Jan 2011 19:28:43 +0100
2125 Subject: [sup-devel] [PATCH 1/2] ensure sources.yaml gets flushed to disk
2126 Message-ID: <1295375324-2496-1-git-send-email-sascha-pgp@silbe.org>
2127
2128 Before renaming sources.yaml we need to fsync() it, otherwise we could end up
2129 with an empty file in case of a crash [1].
2130
2131 [1] http://thunk.org/tytso/blog/2009/03/12/delayed-allocation-and-the-zero-length-file-problem/
2132
2133 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
2134 ---
2135 lib/sup.rb | 10 ++++++++--
2136 1 files changed, 8 insertions(+), 2 deletions(-)
2137
2138 diff --git a/lib/sup.rb b/lib/sup.rb
2139 index edd23c8..09744b4 100644
2140 --- a/lib/sup.rb
2141 +++ b/lib/sup.rb
2142 @@ -98,10 +98,16 @@ module Redwood
2143 if safe
2144 safe_fn = "#{File.dirname fn}/safe_#{File.basename fn}"
2145 mode = File.stat(fn).mode if File.exists? fn
2146 - File.open(safe_fn, "w", mode) { |f| f.puts o.to_yaml }
2147 + File.open(safe_fn, "w", mode) do |f|
2148 + f.puts o.to_yaml
2149 + f.fsync
2150 + end
2151 FileUtils.mv safe_fn, fn
2152 else
2153 - File.open(fn, "w") { |f| f.puts o.to_yaml }
2154 + File.open(fn, "w") do |f|
2155 + f.puts o.to_yaml
2156 + f.fsync
2157 + end
2158 end
2159 end
2160
2161 --
2162 1.7.2.3
2163
2164
2165 From sascha-pgp@silbe.org Tue Jan 18 13:28:44 2011
2166 From: sascha-pgp@silbe.org (Sascha Silbe)
2167 Date: Tue, 18 Jan 2011 19:28:44 +0100
2168 Subject: [sup-devel] [PATCH 2/2] {config,
2169 sources}.yaml: preserve symlinks and permissions
2170 In-Reply-To: <1295375324-2496-1-git-send-email-sascha-pgp@silbe.org>
2171 References: <1295375324-2496-1-git-send-email-sascha-pgp@silbe.org>
2172 Message-ID: <1295375324-2496-2-git-send-email-sascha-pgp@silbe.org>
2173
2174 If config.yaml resp. sources.yaml already exists, preserve the permissions.
2175 Also alter the save algorithm to overwrite the file in-place, thus leaving
2176 symlinks intact.
2177
2178 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
2179 ---
2180 All invocations of save_yaml_obj now use the "backup" mode, so maybe we
2181 should just hardcode it in save_yaml_obj, getting rid of the (existing)
2182 safe and (new) backup parameters.
2183
2184 bin/sup-config | 2 +-
2185 lib/sup.rb | 27 ++++++++++++++++++++++-----
2186 lib/sup/source.rb | 8 +-------
2187 3 files changed, 24 insertions(+), 13 deletions(-)
2188
2189 diff --git a/bin/sup-config b/bin/sup-config
2190 index 132fd77..c4a64a3 100755
2191 --- a/bin/sup-config
2192 +++ b/bin/sup-config
2193 @@ -191,7 +191,7 @@ else
2194 end
2195 end
2196
2197 -Redwood::save_yaml_obj $config, Redwood::CONFIG_FN
2198 +Redwood::save_yaml_obj $config, Redwood::CONFIG_FN, false, true
2199
2200 say "Ok, I've saved you up a nice lil' #{Redwood::CONFIG_FN}."
2201
2202 diff --git a/lib/sup.rb b/lib/sup.rb
2203 index 09744b4..21bddb2 100644
2204 --- a/lib/sup.rb
2205 +++ b/lib/sup.rb
2206 @@ -86,7 +86,7 @@ module Redwood
2207 module_function :reporting_thread, :record_exception, :exceptions
2208
2209 ## one-stop shop for yamliciousness
2210 - def save_yaml_obj o, fn, safe=false
2211 + def save_yaml_obj o, fn, safe=false, backup=false
2212 o = if o.is_a?(Array)
2213 o.map { |x| (x.respond_to?(:before_marshal) && x.before_marshal) || x }
2214 elsif o.respond_to? :before_marshal
2215 @@ -95,16 +95,33 @@ module Redwood
2216 o
2217 end
2218
2219 - if safe
2220 + mode = if File.exists? fn
2221 + File.stat(fn).mode
2222 + else
2223 + 0600
2224 + end
2225 +
2226 + if backup
2227 + backup_fn = fn + '.bak'
2228 + unless File.exists?(backup_fn) && File.size(fn) == 0
2229 + File.open(backup_fn, "w", mode) do |f|
2230 + File.open(fn, "r") { |old_f| FileUtils.copy_stream old_f, f }
2231 + f.fsync
2232 + end
2233 + end
2234 + File.open(fn, "w") do |f|
2235 + f.puts o.to_yaml
2236 + f.fsync
2237 + end
2238 + elsif safe
2239 safe_fn = "#{File.dirname fn}/safe_#{File.basename fn}"
2240 - mode = File.stat(fn).mode if File.exists? fn
2241 File.open(safe_fn, "w", mode) do |f|
2242 f.puts o.to_yaml
2243 f.fsync
2244 end
2245 FileUtils.mv safe_fn, fn
2246 else
2247 - File.open(fn, "w") do |f|
2248 + File.open(fn, "w", mode) do |f|
2249 f.puts o.to_yaml
2250 f.fsync
2251 end
2252 @@ -292,7 +309,7 @@ EOS
2253 :col_jump => 2
2254 }
2255 begin
2256 - Redwood::save_yaml_obj config, filename
2257 + Redwood::save_yaml_obj config, filename, false, true
2258 rescue StandardError => e
2259 $stderr.puts "warning: #{e.message}"
2260 end
2261 diff --git a/lib/sup/source.rb b/lib/sup/source.rb
2262 index 9c398f7..f2379fb 100644
2263 --- a/lib/sup/source.rb
2264 +++ b/lib/sup/source.rb
2265 @@ -212,13 +212,7 @@ class SourceManager
2266 def save_sources fn=Redwood::SOURCE_FN
2267 @source_mutex.synchronize do
2268 if @sources_dirty
2269 - bakfn = fn + ".bak"
2270 - if File.exists? fn
2271 - File.chmod 0600, fn
2272 - FileUtils.mv fn, bakfn, :force => true unless File.exists?(bakfn) && File.size(fn) == 0
2273 - end
2274 - Redwood::save_yaml_obj sources, fn, true
2275 - File.chmod 0600, fn
2276 + Redwood::save_yaml_obj sources, fn, false, true
2277 end
2278 @sources_dirty = false
2279 end
2280 --
2281 1.7.2.3
2282
2283
2284 From sascha-pgp@silbe.org Tue Jan 18 13:31:21 2011
2285 From: sascha-pgp@silbe.org (Sascha Silbe)
2286 Date: Tue, 18 Jan 2011 19:31:21 +0100
2287 Subject: [sup-devel] [PATCH] gen_sign_user_opts: fall back to default
2288 account if no account matches sender
2289 Message-ID: <1295375481-2615-1-git-send-email-sascha-pgp@silbe.org>
2290
2291 Fixes the following exception:
2292
2293 NoMethodError from thread: main
2294 undefined method `gpgkey' for nil:NilClass
2295 ./lib/sup/crypto.rb:226:in `gen_sign_user_opts'
2296 ./lib/sup/crypto.rb:48:in `sign'
2297 ./lib/sup/util.rb:609:in `send'
2298 ./lib/sup/util.rb:609:in `method_missing'
2299 ./lib/sup/modes/edit-message-mode.rb:411:in `send'
2300 ./lib/sup/modes/edit-message-mode.rb:411:in `build_message'
2301 ./lib/sup/modes/edit-message-mode.rb:354:in `send_message'
2302 ./lib/sup/mode.rb:59:in `send'
2303 ./lib/sup/mode.rb:59:in `handle_input'
2304 ./lib/sup/buffer.rb:277:in `handle_input'
2305 bin/sup:260
2306
2307 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
2308 ---
2309 The exception originally occured prior to merging the gpgme patch and I
2310 didn't re-test without the patch, but since this part of the code hasn't
2311 changed I expect the results to be the same.
2312
2313 lib/sup/crypto.rb | 1 +
2314 1 files changed, 1 insertions(+), 0 deletions(-)
2315
2316 diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
2317 index f8e16c5..02f14d0 100644
2318 --- a/lib/sup/crypto.rb
2319 +++ b/lib/sup/crypto.rb
2320 @@ -323,6 +323,7 @@ private
2321 # else set --local-user from_email_address
2322 def gen_sign_user_opts from
2323 account = AccountManager.account_for from
2324 + account ||= AccountManager.default_account
2325 if !account.gpgkey.nil?
2326 opts = {:signers => account.gpgkey}
2327 elsif AccountManager.user_emails.length == 1
2328 --
2329 1.7.2.3
2330
2331
2332 From tero@tilus.net Tue Jan 18 14:04:28 2011
2333 From: tero@tilus.net (Tero Tilus)
2334 Date: Tue, 18 Jan 2011 21:04:28 +0200
2335 Subject: [sup-devel] [PATCH] fix EOL spaces
2336 In-Reply-To: <1295373480-1093-1-git-send-email-sascha-pgp@silbe.org>
2337 References: <1295373480-1093-1-git-send-email-sascha-pgp@silbe.org>
2338 Message-ID: <1295377025-sup-9128@tilus.net>
2339
2340 Sascha Silbe, 2011-01-18 19:58:
2341 > Trailing spaces can make dealing with patches a pain for some
2342 > developers.
2343
2344 It makes me wonder why I haven't send this patch myself. Thank you!
2345
2346 --
2347 Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
2348
2349 From wmorgan-sup@masanjin.net Tue Jan 18 15:05:58 2011
2350 From: wmorgan-sup@masanjin.net (William Morgan)
2351 Date: Tue, 18 Jan 2011 15:05:58 -0500
2352 Subject: [sup-devel] console gem 0.3
2353 Message-ID: <1295381104-sup-809@masanjin.net>
2354
2355 Hi guys,
2356
2357 I've finally released a new version of the console gem which supports
2358 Ruby 1.8. This will be useful in Sup to a) replace String#display_length
2359 (which is a totally wrong hack right now), and b) replace the dl/import
2360 set_locale madness in bin/sup.
2361
2362 So basically this should remove some code and should improve i18n
2363 support for CJK users.
2364
2365 Before I work on a patch, I'm curious if those of you on funny operating
2366 systems (e.g. Cygwin, BSD, Darwin) are able to install this gem
2367 successfully.
2368
2369 If you are a non-i386 Linux user, please try `gem install console` and
2370 report the result (success/failure) along with your OS version and your
2371 ruby version.
2372
2373 For extra credit, here's a test script you can run and make sure the
2374 output is a 30-column block of text:
2375
2376 ## encoding: UTF-8 (this comment required for ruby 1.9)
2377 require 'rubygems' # this line required for ruby 1.8
2378 require 'console'
2379 require 'console/string'
2380
2381 Console.init_locale!
2382
2383 STRING = "????????????G?a ?-t?ng chia?h po-l?, m? b? tio?h-siong.?????????????????????????I can eat glass and it doesn't hurt me."
2384 COLS = 30
2385
2386 rows = STRING.display_width / COLS
2387 (0 .. rows).each { |i| puts STRING.display_slice(i * COLS, COLS) }
2388
2389 Thanks!
2390 --
2391 William <wmorgan-sup at masanjin.net>
2392
2393 From sascha-ml-reply-to-2011-1@silbe.org Tue Jan 18 16:20:45 2011
2394 From: sascha-ml-reply-to-2011-1@silbe.org (Sascha Silbe)
2395 Date: Tue, 18 Jan 2011 22:20:45 +0100
2396 Subject: [sup-devel] console gem 0.3
2397 In-Reply-To: <1295381104-sup-809@masanjin.net>
2398 References: <1295381104-sup-809@masanjin.net>
2399 Message-ID: <1295385072-sup-7655@xo15-sascha.sascha.silbe.org>
2400
2401 Excerpts from William Morgan's message of Tue Jan 18 21:05:58 +0100 2011:
2402
2403 > If you are a non-i386 Linux user, please try `gem install console` and
2404 > report the result (success/failure) along with your OS version and your
2405 > ruby version.
2406
2407 Builds fine on an OpenRD (armel) running Debian Squeeze / Linux 2.6.34:
2408
2409 sascha.silbe at flatty:~$ sudo gem install console
2410 Building native extensions. This could take a while...
2411 Successfully installed console-0.3
2412 1 gem installed
2413 Installing ri documentation for console-0.3...
2414 Installing RDoc documentation for console-0.3...
2415 sascha.silbe at flatty:~$
2416
2417
2418 > For extra credit, here's a test script you can run and make sure the
2419 > output is a 30-column block of text:
2420
2421 I can't spot any obvious failure:
2422
2423 ????????????G?a ?-
2424 t?ng chia?h po-l?, m? b? tio?h-s
2425 iong.????????????
2426 ????????????I can
2427 eat glass and it doesn't hurt
2428 me.
2429
2430
2431 I can test on amd64, too, but expect somebody else to have already done
2432 so.
2433
2434 Sascha
2435
2436 --
2437 http://sascha.silbe.org/
2438 http://www.infra-silbe.de/
2439 -------------- next part --------------
2440 A non-text attachment was scrubbed...
2441 Name: signature.asc
2442 Type: application/pgp-signature
2443 Size: 494 bytes
2444 Desc: not available
2445 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110118/933ebc87/attachment.bin>
2446
2447 From dmishd@gmail.com Tue Jan 18 17:30:33 2011
2448 From: dmishd@gmail.com (Hamish D)
2449 Date: Tue, 18 Jan 2011 22:30:33 +0000
2450 Subject: [sup-devel] console gem 0.3
2451 In-Reply-To: <1295381104-sup-809@masanjin.net>
2452 References: <1295381104-sup-809@masanjin.net>
2453 Message-ID: <AANLkTinZBV4-PWF7fc=se3AdSfTCca=XLXPo01LF93WA@mail.gmail.com>
2454
2455 No problems here - Linux on x86_64, Ubuntu 10.10,
2456
2457 > If you are a non-i386 Linux user, please try `gem install console` and
2458 > report the result (success/failure) along with your OS version and your
2459 > ruby version.
2460
2461 $ ruby --version
2462 ruby 1.8.7 (2010-06-23 patchlevel 299) [x86_64-linux]
2463
2464 $ sudo gem install console
2465 [sudo] password for mish:
2466 Building native extensions. This could take a while...
2467 Successfully installed console-0.3
2468 1 gem installed
2469 Installing ri documentation for console-0.3...
2470 Installing RDoc documentation for console-0.3...
2471
2472 > For extra credit, here's a test script you can run and make sure the
2473 > output is a 30-column block of text:
2474
2475 $ ruby console-test.rb
2476 ????????????G?a ?-
2477 t?ng chia?h po-l?, m? b? tio?h-s
2478 iong.????????????
2479 ????????????I can
2480 eat glass and it doesn't hurt
2481 me.
2482
2483
2484 Hamish Downer
2485
2486 From rlane@club.cc.cmu.edu Tue Jan 18 22:11:42 2011
2487 From: rlane@club.cc.cmu.edu (Rich Lane)
2488 Date: Tue, 18 Jan 2011 22:11:42 -0500
2489 Subject: [sup-devel] [PATCH] Converted crypto to use the gpgme gem
2490 In-Reply-To: <1293129774-sup-3146@zyrg.net>
2491 References: <AANLkTinrSAheJb2F4Xw9AmgXcGLxeQh0_MEnuTSATye_@mail.gmail.com>
2492 <AANLkTinXwKiJqgKyFrrcVV21a8j8hV=fw4QcvDLhtM8E@mail.gmail.com>
2493 <AANLkTi=7yasVvAW4P85v3GJxf+quJrE3-1XruDgUZq+D@mail.gmail.com>
2494 <1289466286-sup-7540@meteor.durcheinandertal.local>
2495 <AANLkTikUwyX6xj-f_ZnLp6s2s9vaCpgayPKygniWndoJ@mail.gmail.com>
2496 <1289907535-sup-3989@meteor.durcheinandertal.local>
2497 <AANLkTi=xz16ecZ0C5=RUcOG4wzojVVzs70PZ2ueKa0ht@mail.gmail.com>
2498 <1289932061-sup-96@meteor.durcheinandertal.local>
2499 <AANLkTin=1MRrW0vuj_7uMvjcyLc3Aaw4ddZ_Rq6TBiyx@mail.gmail.com>
2500 <AANLkTinvv59bWu0UfjW2K-xDRUP42tDwmgMh5yZdmaN_@mail.gmail.com>
2501 <1291023322-sup-8457@meteor.durcheinandertal.local>
2502 <AANLkTi=AJZGLAra20fQvEvU0EasQ_1yWpsr6+4TV3iEn@mail.gmail.com>
2503 <1293129774-sup-3146@zyrg.net>
2504 Message-ID: <1295406678-sup-7103@zyrg.net>
2505
2506 Excerpts from Rich Lane's message of Thu Dec 23 13:43:45 -0500 2010:
2507 > All 5 patches applied to branch gpgme and merged to next.
2508
2509 Branch gpgme has been merged to master.
2510
2511 From rlane@club.cc.cmu.edu Tue Jan 18 22:12:19 2011
2512 From: rlane@club.cc.cmu.edu (Rich Lane)
2513 Date: Tue, 18 Jan 2011 22:12:19 -0500
2514 Subject: [sup-devel] Message#text_to_chunks performance
2515 In-Reply-To: <1293129445-sup-8097@zyrg.net>
2516 References: <1288264300-sup-7747@tilus.net> <1292967783-sup-4582@tilus.net>
2517 <1293129445-sup-8097@zyrg.net>
2518 Message-ID: <1295406716-sup-5272@zyrg.net>
2519
2520 Excerpts from Rich Lane's message of Thu Dec 23 13:38:24 -0500 2010:
2521 > Branch blank-lines-perf, merged to next. I'll merge it to master after
2522 > 0.12 is released.
2523
2524 Branch blank-lines-perf has been merged to master.
2525
2526 From rlane@club.cc.cmu.edu Tue Jan 18 22:13:38 2011
2527 From: rlane@club.cc.cmu.edu (Rich Lane)
2528 Date: Tue, 18 Jan 2011 22:13:38 -0500
2529 Subject: [sup-devel] Scrolling (with patches)
2530 In-Reply-To: <1293750761-sup-3852@tilus.net>
2531 References: <1293750761-sup-3852@tilus.net>
2532 Message-ID: <1295406790-sup-2308@zyrg.net>
2533
2534 Applied to master.
2535
2536 From rlane@club.cc.cmu.edu Tue Jan 18 22:15:42 2011
2537 From: rlane@club.cc.cmu.edu (Rich Lane)
2538 Date: Tue, 18 Jan 2011 22:15:42 -0500
2539 Subject: [sup-devel] Scrolling (with patches)
2540 In-Reply-To: <1293765315-sup-8280@tilus.net>
2541 References: <1293750761-sup-3852@tilus.net> <1293753763-sup-6661@zyrg.net>
2542 <1293755445-sup-9811@tilus.net> <1293759788-sup-1949@tilus.net>
2543 <1293765315-sup-8280@tilus.net>
2544 Message-ID: <1295406908-sup-3770@zyrg.net>
2545
2546 Excerpts from Tero Tilus's message of Thu Dec 30 22:18:29 -0500 2010:
2547 > Tero Tilus, 2010-12-31 03:44:
2548 > > From words to deeds. ;)
2549 >
2550 > ...to first fix. Private methods (at least Index.sync_message) are
2551 > being called on singletons and looks like they are expected to work.
2552
2553 Applied to master.
2554
2555 From rlane@club.cc.cmu.edu Tue Jan 18 22:37:10 2011
2556 From: rlane@club.cc.cmu.edu (Rich Lane)
2557 Date: Tue, 18 Jan 2011 22:37:10 -0500
2558 Subject: [sup-devel] [PATCH v2] don't leak fds for mbox sources
2559 In-Reply-To: <1295373573-1146-1-git-send-email-sascha-pgp@silbe.org>
2560 References: <1278987576-sup-9788@zyrg.net>
2561 <1295373573-1146-1-git-send-email-sascha-pgp@silbe.org>
2562 Message-ID: <1295408211-sup-4185@zyrg.net>
2563
2564 Applied to master.
2565
2566 From rlane@club.cc.cmu.edu Tue Jan 18 22:37:34 2011
2567 From: rlane@club.cc.cmu.edu (Rich Lane)
2568 Date: Tue, 18 Jan 2011 22:37:34 -0500
2569 Subject: [sup-devel] [PATCH v2] prefer gpg2 (GnuPG 2.x) over gpg (GnuPG
2570 1.x)
2571 In-Reply-To: <1295374821-1403-1-git-send-email-sascha-pgp@silbe.org>
2572 References: <1294776647-sup-7357@meteor.durcheinandertal.local>
2573 <1295374821-1403-1-git-send-email-sascha-pgp@silbe.org>
2574 Message-ID: <1295408237-sup-979@zyrg.net>
2575
2576 Applied to master.
2577
2578 From rlane@club.cc.cmu.edu Tue Jan 18 22:39:24 2011
2579 From: rlane@club.cc.cmu.edu (Rich Lane)
2580 Date: Tue, 18 Jan 2011 22:39:24 -0500
2581 Subject: [sup-devel] [PATCH] poll: fix message update vs.
2582 already-imported detection
2583 In-Reply-To: <1295375067-2184-1-git-send-email-sascha-pgp@silbe.org>
2584 References: <1295375067-2184-1-git-send-email-sascha-pgp@silbe.org>
2585 Message-ID: <1295408264-sup-1947@zyrg.net>
2586
2587 Applied to master.
2588
2589 From rlane@club.cc.cmu.edu Tue Jan 18 22:39:57 2011
2590 From: rlane@club.cc.cmu.edu (Rich Lane)
2591 Date: Tue, 18 Jan 2011 22:39:57 -0500
2592 Subject: [sup-devel] [PATCH] sup-sync: show progress for message deletion
2593 In-Reply-To: <1295375082-2236-1-git-send-email-sascha-pgp@silbe.org>
2594 References: <1295375082-2236-1-git-send-email-sascha-pgp@silbe.org>
2595 Message-ID: <1295408372-sup-9709@zyrg.net>
2596
2597 Applied to master.
2598
2599 From rlane@club.cc.cmu.edu Tue Jan 18 22:40:27 2011
2600 From: rlane@club.cc.cmu.edu (Rich Lane)
2601 Date: Tue, 18 Jan 2011 22:40:27 -0500
2602 Subject: [sup-devel] [PATCH] sup-sync: only show message id of deleted
2603 messages in verbose mode
2604 In-Reply-To: <1295375128-2286-1-git-send-email-sascha-pgp@silbe.org>
2605 References: <1295375128-2286-1-git-send-email-sascha-pgp@silbe.org>
2606 Message-ID: <1295408402-sup-6302@zyrg.net>
2607
2608 Applied to master.
2609
2610 From rlane@club.cc.cmu.edu Tue Jan 18 22:40:46 2011
2611 From: rlane@club.cc.cmu.edu (Rich Lane)
2612 Date: Tue, 18 Jan 2011 22:40:46 -0500
2613 Subject: [sup-devel] [PATCH] pre-expand source URIs
2614 In-Reply-To: <1295375177-2342-1-git-send-email-sascha-pgp@silbe.org>
2615 References: <1295375177-2342-1-git-send-email-sascha-pgp@silbe.org>
2616 Message-ID: <1295408431-sup-5724@zyrg.net>
2617
2618 Applied to master.
2619
2620 From rlane@club.cc.cmu.edu Tue Jan 18 22:41:06 2011
2621 From: rlane@club.cc.cmu.edu (Rich Lane)
2622 Date: Tue, 18 Jan 2011 22:41:06 -0500
2623 Subject: [sup-devel] [PATCH] buffer: throw "friendly" exception if
2624 question is too long
2625 In-Reply-To: <1295375197-2397-1-git-send-email-sascha-pgp@silbe.org>
2626 References: <1295375197-2397-1-git-send-email-sascha-pgp@silbe.org>
2627 Message-ID: <1295408452-sup-2535@zyrg.net>
2628
2629 Applied to master.
2630
2631 From rlane@club.cc.cmu.edu Tue Jan 18 22:41:30 2011
2632 From: rlane@club.cc.cmu.edu (Rich Lane)
2633 Date: Tue, 18 Jan 2011 22:41:30 -0500
2634 Subject: [sup-devel] [PATCH] sources.yaml: consistent label ordering
2635 In-Reply-To: <1295375214-2444-1-git-send-email-sascha-pgp@silbe.org>
2636 References: <1295375214-2444-1-git-send-email-sascha-pgp@silbe.org>
2637 Message-ID: <1295408471-sup-1550@zyrg.net>
2638
2639 Applied to master.
2640
2641 From rlane@club.cc.cmu.edu Tue Jan 18 22:41:53 2011
2642 From: rlane@club.cc.cmu.edu (Rich Lane)
2643 Date: Tue, 18 Jan 2011 22:41:53 -0500
2644 Subject: [sup-devel] [PATCH 2/2] {config,
2645 sources}.yaml: preserve symlinks and permissions
2646 In-Reply-To: <1295375324-2496-2-git-send-email-sascha-pgp@silbe.org>
2647 References: <1295375324-2496-1-git-send-email-sascha-pgp@silbe.org>
2648 <1295375324-2496-2-git-send-email-sascha-pgp@silbe.org>
2649 Message-ID: <1295408493-sup-5154@zyrg.net>
2650
2651 Both patches applied to master.
2652
2653 From rlane@club.cc.cmu.edu Tue Jan 18 22:42:19 2011
2654 From: rlane@club.cc.cmu.edu (Rich Lane)
2655 Date: Tue, 18 Jan 2011 22:42:19 -0500
2656 Subject: [sup-devel] [PATCH] gen_sign_user_opts: fall back to default
2657 account if no account matches sender
2658 In-Reply-To: <1295375481-2615-1-git-send-email-sascha-pgp@silbe.org>
2659 References: <1295375481-2615-1-git-send-email-sascha-pgp@silbe.org>
2660 Message-ID: <1295408518-sup-922@zyrg.net>
2661
2662 Applied to master.
2663
2664 From rlane@club.cc.cmu.edu Tue Jan 18 22:42:53 2011
2665 From: rlane@club.cc.cmu.edu (Rich Lane)
2666 Date: Tue, 18 Jan 2011 22:42:53 -0500
2667 Subject: [sup-devel] [PATCH] fix EOL spaces
2668 In-Reply-To: <1295373480-1093-1-git-send-email-sascha-pgp@silbe.org>
2669 References: <1295373480-1093-1-git-send-email-sascha-pgp@silbe.org>
2670 Message-ID: <1295408559-sup-8750@zyrg.net>
2671
2672 Applied to master.
2673
2674 From sascha-ml-reply-to-2011-1@silbe.org Wed Jan 19 05:05:06 2011
2675 From: sascha-ml-reply-to-2011-1@silbe.org (Sascha Silbe)
2676 Date: Wed, 19 Jan 2011 11:05:06 +0100
2677 Subject: [sup-devel] [PATCH 2/2] {config,
2678 sources}.yaml: preserve symlinks and permissions
2679 In-Reply-To: <1295408493-sup-5154@zyrg.net>
2680 References: <1295375324-2496-1-git-send-email-sascha-pgp@silbe.org>
2681 <1295375324-2496-2-git-send-email-sascha-pgp@silbe.org>
2682 <1295408493-sup-5154@zyrg.net>
2683 Message-ID: <1295431447-sup-5513@xo15-sascha.sascha.silbe.org>
2684
2685 Excerpts from Rich Lane's message of Wed Jan 19 04:41:53 +0100 2011:
2686
2687 > Both patches applied to master.
2688 [as well as a whole bunch of other patches from me]
2689
2690 Thanks!
2691
2692 Sascha
2693
2694 --
2695 http://sascha.silbe.org/
2696 http://www.infra-silbe.de/
2697 -------------- next part --------------
2698 A non-text attachment was scrubbed...
2699 Name: signature.asc
2700 Type: application/pgp-signature
2701 Size: 494 bytes
2702 Desc: not available
2703 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110119/1dbbaf68/attachment.bin>
2704
2705 From sascha-pgp@silbe.org Wed Jan 19 08:52:15 2011
2706 From: sascha-pgp@silbe.org (Sascha Silbe)
2707 Date: Wed, 19 Jan 2011 14:52:15 +0100
2708 Subject: [sup-devel] [PATCH] add sup-import-dump: import message state in
2709 sup-dump format
2710 In-Reply-To: <1281085361-sup-7888@xo15-sascha.sascha.silbe.org>
2711 References: <1281085361-sup-7888@xo15-sascha.sascha.silbe.org>
2712 Message-ID: <1295445135-1782-1-git-send-email-sascha-pgp@silbe.org>
2713
2714 sup-import-dump imports message state as exported by sup-dump into the index.
2715 It is a direct replacement for the sup-sync --restored functionality that got
2716 lost when merging the maildir branch.
2717 Unlike sup-sync it operates on the index only, so it's fast enough for
2718 periodically importing full dumps to keep multiple sup installations
2719 synchronised.
2720 It should also be easy enough to add support for a "diff" style format that
2721 would allow replaying "logs" if sup were enhanced to write those in the
2722 future.
2723
2724 To give some rough numbers:
2725
2726 Dump file contains 78104 lines, index about 600k entries. 410 entries from the
2727 dump file don't match the index and cause index updates. Transaction mode is
2728 used for all runs.
2729 Cold cache, dry run: 138s real time, 53s user+system
2730 Hot cache, dry run: 42s real time, 40s user+system
2731 Hot cache, changes written to disk: 55s real time, 44s user+system
2732 Hot cache, no updates: 43s real time, 41s user+system
2733
2734 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
2735 ---
2736 bin/sup-import-dump | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++
2737 lib/sup/index.rb | 15 ++++++++
2738 2 files changed, 114 insertions(+), 0 deletions(-)
2739
2740 diff --git a/bin/sup-import-dump b/bin/sup-import-dump
2741 new file mode 100644
2742 index 0000000..91a1721
2743 --- /dev/null
2744 +++ b/bin/sup-import-dump
2745 @@ -0,0 +1,99 @@
2746 +#!/usr/bin/env ruby
2747 +
2748 +require 'uri'
2749 +require 'rubygems'
2750 +require 'trollop'
2751 +require "sup"; Redwood::check_library_version_against "git"
2752 +
2753 +PROGRESS_UPDATE_INTERVAL = 15 # seconds
2754 +
2755 +class AbortExecution < SystemExit
2756 +end
2757 +
2758 +opts = Trollop::options do
2759 + version "sup-import-dump (sup #{Redwood::VERSION})"
2760 + banner <<EOS
2761 +Imports message state previously exported by sup-dump into the index.
2762 +sup-import-dump operates on the index only, so the messages must have already
2763 +been added using sup-sync. If you need to recreate the index, see sup-sync
2764 +--restore <filename> instead.
2765 +
2766 +Messages not mentioned in the dump file will not be modified.
2767 +
2768 +Usage:
2769 + sup-import-dump [options] <dump file>
2770 +
2771 +Options:
2772 +EOS
2773 + opt :verbose, "Print message ids as they're processed."
2774 + opt :ignore_missing, "Silently skip over messages that are not in the index."
2775 + opt :warn_missing, "Warn about messages that are not in the index, but continue."
2776 + opt :abort_missing, "Abort on encountering messages that are not in the index. (default)"
2777 + opt :atomic, "Use transaction to apply all changes atomically."
2778 + opt :dry_run, "Don't actually modify the index. Probably only useful with --verbose.", :short => "-n"
2779 + opt :version, "Show version information", :short => :none
2780 +
2781 + conflicts :ignore_missing, :warn_missing, :abort_missing
2782 +end
2783 +Trollop::die "No dump file given" if ARGV.empty?
2784 +Trollop::die "Extra arguments given" if ARGV.length > 1
2785 +dump_name = ARGV.shift
2786 +missing_action = [:ignore_missing, :warn_missing, :abort_missing].find { |x| opts[x] } || :abort_missing
2787 +
2788 +Redwood::start
2789 +index = Redwood::Index.init
2790 +
2791 +index.lock_interactively or exit
2792 +begin
2793 + num_read = 0
2794 + num_changed = 0
2795 + index.load
2796 + index.begin_transaction if opts[:atomic]
2797 +
2798 + IO.foreach dump_name do |l|
2799 + l =~ /^(\S+) \((.*?)\)$/ or raise "Can't read dump line: #{l.inspect}"
2800 + mid, labels = $1, $2
2801 + num_read += 1
2802 +
2803 + unless index.contains_id? mid
2804 + if missing_action == :abort_missing
2805 + $stderr.puts "Message #{mid} not found in index, aborting."
2806 + raise AbortExecution, 10
2807 + elsif missing_action == :warn_missing
2808 + $stderr.puts "Message #{mid} not found in index, skipping."
2809 + end
2810 +
2811 + next
2812 + end
2813 +
2814 + m = index.build_message mid
2815 + new_labels = labels.to_set_of_symbols
2816 +
2817 + if m.labels == new_labels
2818 + puts "#{mid} unchanged" if opts[:verbose]
2819 + next
2820 + end
2821 +
2822 + puts "Changing flags for #{mid} from '#{m.labels.to_a * ' '}' to '#{new_labels.to_a * ' '}'" if opts[:verbose]
2823 + num_changed += 1
2824 +
2825 + next if opts[:dry_run]
2826 +
2827 + m.labels = new_labels
2828 + index.update_message_state m
2829 + end
2830 +
2831 + index.commit_transaction if opts[:atomic]
2832 + puts "Updated #{num_changed} of #{num_read} messages."
2833 +rescue AbortExecution
2834 + index.cancel_transaction if opts[:atomic]
2835 + raise
2836 +rescue Exception => e
2837 + index.cancel_transaction if opts[:atomic]
2838 + File.open("sup-exception-log.txt", "w") { |f| f.puts e.backtrace }
2839 + raise
2840 +ensure
2841 + index.save_index unless opts[:atomic]
2842 + Redwood::finish
2843 + index.unlock
2844 +end
2845 diff --git a/lib/sup/index.rb b/lib/sup/index.rb
2846 index b90c2b1..bcc449b 100644
2847 --- a/lib/sup/index.rb
2848 +++ b/lib/sup/index.rb
2849 @@ -260,6 +260,21 @@ EOS
2850 end
2851 end
2852
2853 + # wrap all future changes inside a transaction so they're done atomically
2854 + def begin_transaction
2855 + synchronize { @xapian.begin_transaction }
2856 + end
2857 +
2858 + # complete the transaction and write all previous changes to disk
2859 + def commit_transaction
2860 + synchronize { @xapian.commit_transaction }
2861 + end
2862 +
2863 + # abort the transaction and revert all changes made since begin_transaction
2864 + def cancel_transaction
2865 + synchronize { @xapian.cancel_transaction }
2866 + end
2867 +
2868 ## xapian-compact takes too long, so this is a no-op
2869 ## until we think of something better
2870 def optimize
2871 --
2872 1.7.2.3
2873
2874
2875 From ezyang@MIT.EDU Wed Jan 19 09:08:23 2011
2876 From: ezyang@MIT.EDU (Edward Z. Yang)
2877 Date: Wed, 19 Jan 2011 09:08:23 -0500
2878 Subject: [sup-devel] Strange maildir/OfflineImap/maildir-sync behavior
2879 Message-ID: <1295445524-sup-9310@ezyang>
2880
2881 One day, I opened up an old thread to reread an email, and much
2882 to my dismay, it was GONE! Instead, there was one of those little
2883 red flags that Sup sticks on mail that is referenced by other
2884 threads, but which you don't have a copy of.
2885
2886 This was a bit bothersome, because no one likes it when their mail mysteriously
2887 disappears. (It harkens back to a time when I accidentally deleted my entire
2888 inbox, tried to undo, but Sup crashed in the process and then offlineimap
2889 decided to sync the changes back to my main account, so I had to restore from
2890 backup and run with maxage... but that's a story for another time...)
2891
2892 Some sleuthing, however, revealed that the messages had not disappeared; they
2893 were still in my Maildir. And sure enough, when I made Sup repoll the entire
2894 Maildir (by restarting it), the messages reappeared (along with another 50
2895 messages that I /swear/ I archived).
2896
2897 So my question is, why did Sup lose track of the messages? Did it pick them
2898 up while they were in new and then OfflineIMAP moved them and they got lost?
2899 Can I make Sup tell me where it thinks a message should be living on my filesystem
2900 so I can track these things? Is this actually OfflineIMAP's fault?
2901
2902 Cheers,
2903 Edward
2904
2905 P.S. Hey Damien, I know you're not planning on working on getting maildir-sync
2906 merged to master until later this January, but I was wondering if a version of
2907 the branch rebased on master would be of any use to you.
2908
2909 From wmorgan-sup@masanjin.net Wed Jan 19 10:38:11 2011
2910 From: wmorgan-sup@masanjin.net (William Morgan)
2911 Date: Wed, 19 Jan 2011 10:38:11 -0500
2912 Subject: [sup-devel] [PATCH 2/2] {config,
2913 sources}.yaml: preserve symlinks and permissions
2914 In-Reply-To: <1295375324-2496-2-git-send-email-sascha-pgp@silbe.org>
2915 References: <1295375324-2496-1-git-send-email-sascha-pgp@silbe.org>
2916 <1295375324-2496-2-git-send-email-sascha-pgp@silbe.org>
2917 Message-ID: <1295451265-sup-1883@masanjin.net>
2918
2919 Reformatted excerpts from Sascha Silbe's message of 2011-01-18:
2920 > + unless File.exists?(backup_fn) && File.size(fn) == 0
2921
2922 This line is giving me some problems when fn doesn't exist (e.g. when
2923 running sup-sync the first time without a config.yaml). Should it be
2924
2925 File.exists?(backup_fn) && File.exists?(fn) && File.size(fn) == 0
2926
2927 instead?
2928 --
2929 William <wmorgan-sup at masanjin.net>
2930
2931 From alvherre@alvh.no-ip.org Wed Jan 19 11:12:18 2011
2932 From: alvherre@alvh.no-ip.org (Alvaro Herrera)
2933 Date: Wed, 19 Jan 2011 13:12:18 -0300
2934 Subject: [sup-devel] [PATCH] Converted crypto to use the gpgme gem
2935 In-Reply-To: <AANLkTinvv59bWu0UfjW2K-xDRUP42tDwmgMh5yZdmaN_@mail.gmail.com>
2936 References: <AANLkTinrSAheJb2F4Xw9AmgXcGLxeQh0_MEnuTSATye_@mail.gmail.com>
2937 <AANLkTinXwKiJqgKyFrrcVV21a8j8hV=fw4QcvDLhtM8E@mail.gmail.com>
2938 <AANLkTi=7yasVvAW4P85v3GJxf+quJrE3-1XruDgUZq+D@mail.gmail.com>
2939 <1289466286-sup-7540@meteor.durcheinandertal.local>
2940 <AANLkTikUwyX6xj-f_ZnLp6s2s9vaCpgayPKygniWndoJ@mail.gmail.com>
2941 <1289907535-sup-3989@meteor.durcheinandertal.local>
2942 <AANLkTi=xz16ecZ0C5=RUcOG4wzojVVzs70PZ2ueKa0ht@mail.gmail.com>
2943 <1289932061-sup-96@meteor.durcheinandertal.local>
2944 <AANLkTin=1MRrW0vuj_7uMvjcyLc3Aaw4ddZ_Rq6TBiyx@mail.gmail.com>
2945 <AANLkTinvv59bWu0UfjW2K-xDRUP42tDwmgMh5yZdmaN_@mail.gmail.com>
2946 Message-ID: <1295453319-sup-2362@alvh.no-ip.org>
2947
2948 Excerpts from Hamish D's message of dom nov 28 19:51:43 -0300 2010:
2949 > OK, here is a set of 4 patches that implement the change over to the
2950 > gpgme library. There's quite a bit of work in there so I thought I'd
2951 > leave it as a few patches, but I have done some tidying.
2952 >
2953 > I have some more ideas for improvements, but I'm happy that this
2954 > reproduces the behaviour of using the gpg binary, and I find sup usage
2955 > much smoother with this change.
2956
2957 When the gpgme gem is not installed, this patch makes sup die on start
2958 with:
2959
2960 [mi? ene 19 13:05:39 -0300 2011] No 'gpgme' gem detected. Install it for email encryption, decryption and signatures.
2961 [mi? ene 19 13:05:39 -0300 2011] dynamically loading setlocale() from libc.so.6
2962 [mi? ene 19 13:05:39 -0300 2011] setting locale...
2963 [mi? ene 19 13:05:39 -0300 2011] locking /home/alvherre/.sup/lock...
2964 [mi? ene 19 13:05:39 -0300 2011] stopped cursing
2965 [mi? ene 19 13:05:39 -0300 2011] ERROR: oh crap, an exception
2966 [mi? ene 19 13:05:39 -0300 2011] unlocking /home/alvherre/.sup/lock...
2967 ----------------------------------------------------------------
2968 I'm very sorry. It seems that an error occurred in Sup. Please
2969 accept my sincere apologies. Please submit the contents of
2970 /home/alvherre/.sup/exception-log.txt and a brief report of the
2971 circumstances to http://masanjin.net/sup-bugs/ so that I might
2972 address this problem. Thank you!
2973
2974 Sincerely,
2975 William
2976 ----------------------------------------------------------------
2977 --- NameError from thread: main
2978 uninitialized constant Redwood::CryptoManager::GPGME
2979 /home/alvherre/Code/sup-mail/lib/sup/crypto.rb:49:in `initialize'
2980 ...
2981
2982
2983
2984 Ruby is from Debian package ruby1.8,
2985 ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
2986
2987
2988 I'm gonna install the gem now, but this should probably be fixed
2989 nonetheless.
2990
2991 --
2992 ?lvaro Herrera -- Se vende casa en ?u?oa: www.portalinmobiliario.com/993147
2993
2994 From sascha-ml-reply-to-2011-1@silbe.org Wed Jan 19 11:42:28 2011
2995 From: sascha-ml-reply-to-2011-1@silbe.org (Sascha Silbe)
2996 Date: Wed, 19 Jan 2011 17:42:28 +0100
2997 Subject: [sup-devel] [PATCH 2/2] {config,
2998 sources}.yaml: preserve symlinks and permissions
2999 In-Reply-To: <1295451265-sup-1883@masanjin.net>
3000 References: <1295375324-2496-1-git-send-email-sascha-pgp@silbe.org>
3001 <1295375324-2496-2-git-send-email-sascha-pgp@silbe.org>
3002 <1295451265-sup-1883@masanjin.net>
3003 Message-ID: <1295454858-sup-1718@twin.sascha.silbe.org>
3004
3005 Excerpts from William Morgan's message of Wed Jan 19 16:38:11 +0100 2011:
3006
3007 > Reformatted excerpts from Sascha Silbe's message of 2011-01-18:
3008 > > + unless File.exists?(backup_fn) && File.size(fn) == 0
3009 >
3010 > This line is giving me some problems when fn doesn't exist (e.g. when
3011 > running sup-sync the first time without a config.yaml). Should it be
3012 >
3013 > File.exists?(backup_fn) && File.exists?(fn) && File.size(fn) == 0
3014 >
3015 > instead?
3016
3017 Yes, you're right. We shouldn't try to do a copy if the original doesn't
3018 exist. Sorry for not testing that case.
3019 Shall I send a fix-up patch?
3020
3021 Sascha
3022
3023 --
3024 http://sascha.silbe.org/
3025 http://www.infra-silbe.de/
3026 -------------- next part --------------
3027 A non-text attachment was scrubbed...
3028 Name: signature.asc
3029 Type: application/pgp-signature
3030 Size: 500 bytes
3031 Desc: not available
3032 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110119/37e07daf/attachment.bin>
3033
3034 From wmorgan-sup@masanjin.net Wed Jan 19 12:17:23 2011
3035 From: wmorgan-sup@masanjin.net (William Morgan)
3036 Date: Wed, 19 Jan 2011 12:17:23 -0500
3037 Subject: [sup-devel] [PATCH 2/2] {config,
3038 sources}.yaml: preserve symlinks and permissions
3039 In-Reply-To: <1295454858-sup-1718@twin.sascha.silbe.org>
3040 References: <1295375324-2496-1-git-send-email-sascha-pgp@silbe.org>
3041 <1295375324-2496-2-git-send-email-sascha-pgp@silbe.org>
3042 <1295451265-sup-1883@masanjin.net>
3043 <1295454858-sup-1718@twin.sascha.silbe.org>
3044 Message-ID: <1295457425-sup-9902@masanjin.net>
3045
3046 Reformatted excerpts from Sascha Silbe's message of 2011-01-19:
3047 > Shall I send a fix-up patch?
3048
3049 I can descend from the heavens and apply my fix to master directly,
3050 unless Rich objects.
3051 --
3052 William <wmorgan-sup at masanjin.net>
3053
3054 From wmorgan-sup@masanjin.net Wed Jan 19 12:19:11 2011
3055 From: wmorgan-sup@masanjin.net (William Morgan)
3056 Date: Wed, 19 Jan 2011 12:19:11 -0500
3057 Subject: [sup-devel] [PATCH 2/2] {config,
3058 sources}.yaml: preserve symlinks and permissions
3059 In-Reply-To: <1295451265-sup-1883@masanjin.net>
3060 References: <1295375324-2496-1-git-send-email-sascha-pgp@silbe.org>
3061 <1295375324-2496-2-git-send-email-sascha-pgp@silbe.org>
3062 <1295451265-sup-1883@masanjin.net>
3063 Message-ID: <1295457514-sup-3702@masanjin.net>
3064
3065 Reformatted excerpts from William Morgan's message of 2011-01-19:
3066 > Reformatted excerpts from Sascha Silbe's message of 2011-01-18:
3067 > > + unless File.exists?(backup_fn) && File.size(fn) == 0
3068 >
3069 > This line is giving me some problems when fn doesn't exist (e.g. when
3070 > running sup-sync the first time without a config.yaml). Should it be
3071 >
3072 > File.exists?(backup_fn) && File.exists?(fn) && File.size(fn) == 0
3073 >
3074 > instead?
3075
3076 Actually, I think it should be:
3077
3078 if File.exists?(fn) && File.size(fn) > 0
3079
3080 Which has the advantage of actually working...
3081 --
3082 William <wmorgan-sup at masanjin.net>
3083
3084 From rlane@club.cc.cmu.edu Wed Jan 19 13:44:07 2011
3085 From: rlane@club.cc.cmu.edu (Rich Lane)
3086 Date: Wed, 19 Jan 2011 13:44:07 -0500
3087 Subject: [sup-devel] [PATCH 2/2] {config,
3088 sources}.yaml: preserve symlinks and permissions
3089 In-Reply-To: <1295457425-sup-9902@masanjin.net>
3090 References: <1295375324-2496-1-git-send-email-sascha-pgp@silbe.org>
3091 <1295375324-2496-2-git-send-email-sascha-pgp@silbe.org>
3092 <1295451265-sup-1883@masanjin.net>
3093 <1295454858-sup-1718@twin.sascha.silbe.org>
3094 <1295457425-sup-9902@masanjin.net>
3095 Message-ID: <1295462546-sup-634@zyrg.net>
3096
3097 Excerpts from William Morgan's message of Wed Jan 19 12:17:23 -0500 2011:
3098 > Reformatted excerpts from Sascha Silbe's message of 2011-01-19:
3099 > > Shall I send a fix-up patch?
3100 >
3101 > I can descend from the heavens and apply my fix to master directly,
3102 > unless Rich objects.
3103
3104 Please do.
3105
3106 From bwalton@artsci.utoronto.ca Wed Jan 19 13:41:21 2011
3107 From: bwalton@artsci.utoronto.ca (Ben Walton)
3108 Date: Wed, 19 Jan 2011 13:41:21 -0500
3109 Subject: [sup-devel] [PATCH 2/2] {config,
3110 sources}.yaml: preserve symlinks and permissions
3111 In-Reply-To: <1295457514-sup-3702@masanjin.net>
3112 References: <1295375324-2496-1-git-send-email-sascha-pgp@silbe.org>
3113 <1295375324-2496-2-git-send-email-sascha-pgp@silbe.org>
3114 <1295451265-sup-1883@masanjin.net>
3115 <1295457514-sup-3702@masanjin.net>
3116 Message-ID: <1295462152-sup-1745@pinkfloyd.chass.utoronto.ca>
3117
3118 Excerpts from William Morgan's message of Wed Jan 19 12:19:11 -0500 2011:
3119
3120 > Actually, I think it should be:
3121 >
3122 > if File.exists?(fn) && File.size(fn) > 0
3123
3124 How about:
3125
3126 begin
3127 fninf = File.stat(fn)
3128 if fninf.size? ...
3129
3130 rescue Errno::ENOENT => e
3131 ...
3132 end
3133
3134 I didn't look at the surrounding code so I'm not sure how to best
3135 integrate this. The advantage is that you save one user->kernel space
3136 traversal. Calling .exists? and .size via File results in two stat()
3137 calls. Grabbing and saving the actual stat result on the first call
3138 and then using them for further tests saves this. Not a huge
3139 overhead, I admit...
3140
3141 HTH.
3142 -Ben
3143 --
3144 Ben Walton
3145 Systems Programmer - CHASS
3146 University of Toronto
3147 C:416.407.5610 | W:416.978.4302
3148
3149
3150 From roni@cs.utah.edu Wed Jan 19 15:01:03 2011
3151 From: roni@cs.utah.edu (Roni Choudhury)
3152 Date: Wed, 19 Jan 2011 13:01:03 -0700
3153 Subject: [sup-devel] Strange maildir/OfflineImap/maildir-sync behavior
3154 In-Reply-To: <1295445524-sup-9310@ezyang>
3155 References: <1295445524-sup-9310@ezyang>
3156 Message-ID: <1295467127-sup-6602@medusa>
3157
3158 I've noticed this from time to time as well (along with messages not
3159 disappearing, but instead part of the body appearing, then cut off
3160 with a strange error message about how sup can't load the message). I
3161 find that killing the thread view buffer, then typing @ in index mode
3162 causes these to be fixed. Just mentioning it because it's easier than
3163 restarting sup, and it may be related to the error you describe. I'm
3164 also not sure how to file a bug report of that situation.
3165
3166 roni
3167
3168 Excerpts from Edward Z. Yang's message of 2011-01-19 07:08:23 -0700:
3169 > One day, I opened up an old thread to reread an email, and much
3170 > to my dismay, it was GONE! Instead, there was one of those little
3171 > red flags that Sup sticks on mail that is referenced by other
3172 > threads, but which you don't have a copy of.
3173 >
3174 > This was a bit bothersome, because no one likes it when their mail mysteriously
3175 > disappears. (It harkens back to a time when I accidentally deleted my entire
3176 > inbox, tried to undo, but Sup crashed in the process and then offlineimap
3177 > decided to sync the changes back to my main account, so I had to restore from
3178 > backup and run with maxage... but that's a story for another time...)
3179 >
3180 > Some sleuthing, however, revealed that the messages had not disappeared; they
3181 > were still in my Maildir. And sure enough, when I made Sup repoll the entire
3182 > Maildir (by restarting it), the messages reappeared (along with another 50
3183 > messages that I /swear/ I archived).
3184 >
3185 > So my question is, why did Sup lose track of the messages? Did it pick them
3186 > up while they were in new and then OfflineIMAP moved them and they got lost?
3187 > Can I make Sup tell me where it thinks a message should be living on my filesystem
3188 > so I can track these things? Is this actually OfflineIMAP's fault?
3189 >
3190 > Cheers,
3191 > Edward
3192 >
3193 > P.S. Hey Damien, I know you're not planning on working on getting maildir-sync
3194 > merged to master until later this January, but I was wondering if a version of
3195 > the branch rebased on master would be of any use to you.
3196
3197 From ezyang@MIT.EDU Wed Jan 19 15:33:15 2011
3198 From: ezyang@MIT.EDU (Edward Z. Yang)
3199 Date: Wed, 19 Jan 2011 15:33:15 -0500
3200 Subject: [sup-devel] Strange maildir/OfflineImap/maildir-sync behavior
3201 In-Reply-To: <1295467127-sup-6602@medusa>
3202 References: <1295445524-sup-9310@ezyang> <1295467127-sup-6602@medusa>
3203 Message-ID: <1295469102-sup-9054@ezyang>
3204
3205 Oh, I know the behavior you're talking about; it's distinct from the
3206 behavior I'm seeing.
3207
3208 What you've mentioned is some curious synchronization bug where if a
3209 new, unread message is available on two buffers (for example, you used
3210 'U'), and you read it from one buffer, it becomes broken on the other
3211 buffer. That would also be a good one to fix.
3212
3213 Cheers,
3214 Edward
3215
3216 From damien.leone@fensalir.fr Wed Jan 19 16:10:20 2011
3217 From: damien.leone@fensalir.fr (Damien Leone)
3218 Date: Wed, 19 Jan 2011 22:10:20 +0100
3219 Subject: [sup-devel] Strange maildir/OfflineImap/maildir-sync behavior
3220 In-Reply-To: <1295467127-sup-6602@medusa>
3221 References: <1295445524-sup-9310@ezyang> <1295467127-sup-6602@medusa>
3222 Message-ID: <1295471328-sup-9770@mailer>
3223
3224 Sup guys,
3225
3226 Excerpts from Roni Choudhury's message of mer. janv. 19 21:01:03 +0100 2011:
3227 > I've noticed this from time to time as well (along with messages not
3228 > disappearing, but instead part of the body appearing, then cut off
3229 > with a strange error message about how sup can't load the message). I
3230 > find that killing the thread view buffer, then typing @ in index mode
3231 > causes these to be fixed. Just mentioning it because it's easier than
3232 > restarting sup, and it may be related to the error you describe. I'm
3233 > also not sure how to file a bug report of that situation.
3234
3235 Yes I have noticed this one, it happens to me mainly when I send a
3236 mail then perform a synchronization, probably because the sent mail
3237 gets updated from the SentMail maildir (I use gmail), it's on the
3238 to-fix list.
3239
3240 --
3241 Damien Leone <damien.leone at fensalir.fr>
3242
3243 Web: http://dleone.fensalir.fr/
3244 GPG: 0x82EB4DDF
3245
3246 From damien.leone@fensalir.fr Wed Jan 19 16:12:13 2011
3247 From: damien.leone@fensalir.fr (Damien Leone)
3248 Date: Wed, 19 Jan 2011 22:12:13 +0100
3249 Subject: [sup-devel] Strange maildir/OfflineImap/maildir-sync behavior
3250 In-Reply-To: <1295445524-sup-9310@ezyang>
3251 References: <1295445524-sup-9310@ezyang>
3252 Message-ID: <1295471435-sup-7039@mailer>
3253
3254 Sup Edward,
3255
3256 Excerpts from Edward Z. Yang's message of mer. janv. 19 15:08:23 +0100 2011:
3257 > One day, I opened up an old thread to reread an email, and much
3258 > to my dismay, it was GONE! Instead, there was one of those little
3259 > red flags that Sup sticks on mail that is referenced by other
3260 > threads, but which you don't have a copy of.
3261 >
3262 > This was a bit bothersome, because no one likes it when their mail mysteriously
3263 > disappears. (It harkens back to a time when I accidentally deleted my entire
3264 > inbox, tried to undo, but Sup crashed in the process and then offlineimap
3265 > decided to sync the changes back to my main account, so I had to restore from
3266 > backup and run with maxage... but that's a story for another time...)
3267 >
3268 > Some sleuthing, however, revealed that the messages had not disappeared; they
3269 > were still in my Maildir. And sure enough, when I made Sup repoll the entire
3270 > Maildir (by restarting it), the messages reappeared (along with another 50
3271 > messages that I /swear/ I archived).
3272 >
3273 > So my question is, why did Sup lose track of the messages? Did it pick them
3274 > up while they were in new and then OfflineIMAP moved them and they got lost?
3275 > Can I make Sup tell me where it thinks a message should be living on my filesystem
3276 > so I can track these things? Is this actually OfflineIMAP's fault?
3277
3278 I didn't notice this bug so I have no idea for the moment. :/
3279
3280 > P.S. Hey Damien, I know you're not planning on working on getting maildir-sync
3281 > merged to master until later this January, but I was wondering if a version of
3282 > the branch rebased on master would be of any use to you.
3283
3284 Sure! I was maintaining a maildir-sync-master branch on my repository
3285 but it doesn't include the last bunch of commits.
3286
3287 --
3288 Damien Leone <damien.leone at fensalir.fr>
3289
3290 Web: http://dleone.fensalir.fr/
3291 GPG: 0x82EB4DDF
3292
3293 From ezyang@MIT.EDU Wed Jan 19 21:44:56 2011
3294 From: ezyang@MIT.EDU (Edward Z. Yang)
3295 Date: Wed, 19 Jan 2011 21:44:56 -0500
3296 Subject: [sup-devel] [PATCH] Avoid O(n^2) complexity for maildir
3297 deduplication.
3298 Message-ID: <1295491496-1136-1-git-send-email-ezyang@mit.edu>
3299
3300 Signed-off-by: Edward Z. Yang <ezyang at mit.edu>
3301 ---
3302 lib/sup/maildir.rb | 9 ++++++---
3303 1 files changed, 6 insertions(+), 3 deletions(-)
3304
3305 diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
3306 index ba8efed..0898c91 100644
3307 --- a/lib/sup/maildir.rb
3308 +++ b/lib/sup/maildir.rb
3309 @@ -128,14 +128,17 @@ class Maildir < Source
3310 ## deleted arrays, meaning that its flags changed or that it has
3311 ## been moved, these ids need to be removed from added and deleted
3312 add_to_delete = del_to_delete = []
3313 + map = {}
3314 added.each do |id_add|
3315 - deleted.each do |id_del|
3316 - if maildir_data(id_add)[0] == maildir_data(id_del)[0]
3317 + map[maildir_data(id_add)[0]] = id_add
3318 + end
3319 + deleted.each do |id_del|
3320 + id_add = maildir_data(id_del)[0]
3321 + if not id_add.nil?
3322 updated.push [ id_del, id_add ]
3323 add_to_delete.push id_add
3324 del_to_delete.push id_del
3325 end
3326 - end
3327 end
3328 added -= add_to_delete
3329 deleted -= del_to_delete
3330 --
3331 1.7.0.4
3332
3333
3334 From ezyang@MIT.EDU Wed Jan 19 21:55:36 2011
3335 From: ezyang@MIT.EDU (Edward Z. Yang)
3336 Date: Wed, 19 Jan 2011 21:55:36 -0500
3337 Subject: [sup-devel] Strange maildir/OfflineImap/maildir-sync behavior
3338 In-Reply-To: <1295445524-sup-9310@ezyang>
3339 References: <1295445524-sup-9310@ezyang>
3340 Message-ID: <1295492036-sup-5441@ezyang>
3341
3342 Ok, I think this behavior is due to an OfflineIMAP bug, or at least
3343 some infelicity. I think I have squashed it by telling OfflineIMAP
3344 to never ever ever delete files in my Maildir (and also never upload
3345 files from the Maildir to IMAP account: I only want status changes
3346 and deletions to propagate, I'm not spooling mail here--did we ever
3347 get sent mail propagation to work? -- that would be the one case in
3348 which that behavior is desirable).
3349
3350 Cheers,
3351 Edward
3352
3353 From rlane@club.cc.cmu.edu Wed Jan 19 23:13:05 2011
3354 From: rlane@club.cc.cmu.edu (Rich Lane)
3355 Date: Wed, 19 Jan 2011 23:13:05 -0500
3356 Subject: [sup-devel] [PATCH] add sup-import-dump: import message state
3357 in sup-dump format
3358 In-Reply-To: <1295445135-1782-1-git-send-email-sascha-pgp@silbe.org>
3359 References: <1281085361-sup-7888@xo15-sascha.sascha.silbe.org>
3360 <1295445135-1782-1-git-send-email-sascha-pgp@silbe.org>
3361 Message-ID: <1295496709-sup-3154@zyrg.net>
3362
3363 Applied to master.
3364
3365 From ezyang@MIT.EDU Thu Jan 20 05:53:36 2011
3366 From: ezyang@MIT.EDU (Edward Z. Yang)
3367 Date: Thu, 20 Jan 2011 05:53:36 -0500
3368 Subject: [sup-devel] Strange maildir/OfflineImap/maildir-sync behavior
3369 In-Reply-To: <1295471328-sup-9770@mailer>
3370 References: <1295445524-sup-9310@ezyang> <1295467127-sup-6602@medusa>
3371 <1295471328-sup-9770@mailer>
3372 Message-ID: <1295520737-sup-176@ezyang>
3373
3374 I have a theory for why this occurs: when we mark mail read on maildir,
3375 it gets moved from new to cur, IIRC? So if Sup's state doesn't get
3376 adequately updated, an old buffer could try to look at the old location.
3377 This should be easily verifiable by looking at the console messages.
3378
3379 Edward
3380
3381 From nicolas.pouillard@gmail.com Thu Jan 20 10:28:17 2011
3382 From: nicolas.pouillard@gmail.com (Nicolas Pouillard)
3383 Date: Thu, 20 Jan 2011 07:28:17 -0800 (PST)
3384 Subject: [sup-devel] [PATCH] add sup-import-dump: import message state
3385 in sup-dump format
3386 In-Reply-To: <1295445135-1782-1-git-send-email-sascha-pgp@silbe.org>
3387 References: <1281085361-sup-7888@xo15-sascha.sascha.silbe.org>
3388 <1295445135-1782-1-git-send-email-sascha-pgp@silbe.org>
3389 Message-ID: <4d385491.2308e30a.02b2.ffffd7ce@mx.google.com>
3390
3391 On Wed, 19 Jan 2011 14:52:15 +0100, Sascha Silbe <sascha-pgp at silbe.org> wrote:
3392 > sup-import-dump imports message state as exported by sup-dump into the index.
3393 > It is a direct replacement for the sup-sync --restored functionality that got
3394 > lost when merging the maildir branch.
3395 > Unlike sup-sync it operates on the index only, so it's fast enough for
3396 > periodically importing full dumps to keep multiple sup installations
3397 > synchronised.
3398
3399 So it does not clear the index, right? It only assign the set of labels to the
3400 given message. Just what I need to upgrade my sup index with my notmuch index.
3401
3402 > It should also be easy enough to add support for a "diff" style format that
3403 > would allow replaying "logs" if sup were enhanced to write those in the
3404 > future.
3405
3406 Please do.
3407
3408 I hacked such a logging feature [1] in the past (at the time where sup
3409 used ferret and that message loss happened), then I merged the previous index
3410 dump with the log and compared this to the actual dump (I wrote some tools
3411 to play with this log format).
3412
3413 Cheers,
3414
3415 [1]: http://gitorious.org/~ertai/sup/clone-by-ertai/commits/to-submit-log-labels-mapping
3416
3417 --
3418 Nicolas Pouillard
3419 http://nicolaspouillard.fr
3420
3421 From ezyang@MIT.EDU Thu Jan 20 17:44:13 2011
3422 From: ezyang@MIT.EDU (Edward Z. Yang)
3423 Date: Thu, 20 Jan 2011 17:44:13 -0500
3424 Subject: [sup-devel] [PATCH] Avoid O(n^2) complexity for maildir
3425 deduplication.
3426 Message-ID: <1295563453-31049-1-git-send-email-ezyang@mit.edu>
3427
3428 Signed-off-by: Edward Z. Yang <ezyang at mit.edu>
3429 ---
3430 lib/sup/maildir.rb | 8 +++++---
3431 1 files changed, 5 insertions(+), 3 deletions(-)
3432
3433 diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
3434 index ba8efed..bc30baa 100644
3435 --- a/lib/sup/maildir.rb
3436 +++ b/lib/sup/maildir.rb
3437 @@ -128,14 +128,16 @@ class Maildir < Source
3438 ## deleted arrays, meaning that its flags changed or that it has
3439 ## been moved, these ids need to be removed from added and deleted
3440 add_to_delete = del_to_delete = []
3441 + map = Hash.new { |hash, key| hash[key] = [] }
3442 + deleted.each do |id_del|
3443 + map[maildir_data(id_del)[0]].push id_del
3444 + end
3445 added.each do |id_add|
3446 - deleted.each do |id_del|
3447 - if maildir_data(id_add)[0] == maildir_data(id_del)[0]
3448 + map[maildir_data(id_add)[0]].each do |id_del|
3449 updated.push [ id_del, id_add ]
3450 add_to_delete.push id_add
3451 del_to_delete.push id_del
3452 end
3453 - end
3454 end
3455 added -= add_to_delete
3456 deleted -= del_to_delete
3457 --
3458 1.7.0.4
3459
3460
3461 From ezyang@MIT.EDU Thu Jan 20 17:57:22 2011
3462 From: ezyang@MIT.EDU (Edward Z. Yang)
3463 Date: Thu, 20 Jan 2011 17:57:22 -0500
3464 Subject: [sup-devel] Strategy for dealing with nil and thread errors
3465 Message-ID: <1295563880-sup-5855@ezyang>
3466
3467 My experience for having run Sup for some appreciable amount of time includes
3468 running into a few Sup exceptions where 'the wrong id is called on some object'
3469 or we attempt to access a field that doesn't exist on nil. I also have run
3470 into any number of race condition style bugs with respect to threading and the
3471 user interface.
3472
3473 Usually the bugs are kind of harmless, so I just shrug, ignore the UI oddity,
3474 reboot our client, and hope it doesn't come back again. Sometimes it's really
3475 bad, in which case I might need to reload our index (but usually it goes away
3476 after that) or patch the immediate bit of code that is complaining and hope
3477 I have encouraged some silent corruption.
3478
3479 I was curious if other people have had similar experiences. I know threading
3480 is fucking hard, and writing code that is robust against internal corruption
3481 (which I assume is the source of nils) is fucking hard, but I think it's a worthy
3482 goal and I think we should be thinking about ways to help rule out these errors
3483 in the Sup codebase.
3484
3485 Cheers,
3486 Edward
3487
3488 From rlane@club.cc.cmu.edu Fri Jan 21 01:46:53 2011
3489 From: rlane@club.cc.cmu.edu (Rich Lane)
3490 Date: Fri, 21 Jan 2011 01:46:53 -0500
3491 Subject: [sup-devel] Strategy for dealing with nil and thread errors
3492 In-Reply-To: <1295563880-sup-5855@ezyang>
3493 References: <1295563880-sup-5855@ezyang>
3494 Message-ID: <1295572751-sup-2112@zyrg.net>
3495
3496 I think the UI should be single-threaded and event-driven. Index and
3497 source operations should still be run in separate threads or processes
3498 to avoid freezing the UI, but they should not be sharing any mutable
3499 state.
3500
3501 This is a lot of work. If anyone is interested in tackling this I
3502 suggest first discovering all the threads Sup uses and which of their
3503 codepaths call into the UI or modify shared datastructures (Message,
3504 Thread, ThreadSet, ...). Then that racy code needs to be moved to a
3505 callback that runs in the event loop.
3506
3507 Some other robustness thoughts I've had:
3508 - Immutable messages / different classes for messages constructed from
3509 source vs index
3510 - Catch and log exceptions from keybindings
3511
3512 From tero@tilus.net Fri Jan 21 01:59:16 2011
3513 From: tero@tilus.net (Tero Tilus)
3514 Date: Fri, 21 Jan 2011 08:59:16 +0200
3515 Subject: [sup-devel] Strategy for dealing with nil and thread errors
3516 In-Reply-To: <1295563880-sup-5855@ezyang>
3517 References: <1295563880-sup-5855@ezyang>
3518 Message-ID: <1295592790-sup-5869@tilus.net>
3519
3520 Edward Z. Yang, 2011-01-21 00:57:
3521 > Usually the bugs are kind of harmless, so I just shrug, ignore the
3522 > UI oddity, reboot our client, and hope it doesn't come back again.
3523
3524 Do you report the bugs you encounter?
3525
3526 > Sometimes it's really bad, in which case I might need to reload our
3527 > index (but usually it goes away after that) or patch the immediate
3528 > bit of code
3529
3530 Do you send in your patches?
3531
3532 > I was curious if other people have had similar experiences.
3533
3534 Not anymore. For about a year now I've only managed to make sup spit
3535 backtraces only from code I've written myself.
3536
3537 > I know threading is fucking hard, and writing code that is robust
3538 > against internal corruption (which I assume is the source of nils)
3539 > is fucking hard, but I think it's a worthy goal
3540
3541 Is there anyone who doesn't?
3542
3543 > and I think we should be thinking about ways to help rule out these
3544 > errors in the Sup codebase.
3545
3546 Do you have any suggestions? Besides the obvious "just try hard!"
3547 which I assume all sup contributors already do.
3548
3549 --
3550 Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
3551
3552 From sascha-ml-reply-to-2011-1@silbe.org Fri Jan 21 07:36:35 2011
3553 From: sascha-ml-reply-to-2011-1@silbe.org (Sascha Silbe)
3554 Date: Fri, 21 Jan 2011 13:36:35 +0100
3555 Subject: [sup-devel] [PATCH] add sup-import-dump: import message state
3556 in sup-dump format
3557 In-Reply-To: <4d385491.2308e30a.02b2.ffffd7ce@mx.google.com>
3558 References: <1281085361-sup-7888@xo15-sascha.sascha.silbe.org>
3559 <1295445135-1782-1-git-send-email-sascha-pgp@silbe.org>
3560 <4d385491.2308e30a.02b2.ffffd7ce@mx.google.com>
3561 Message-ID: <1295612176-sup-1890@xo15-sascha.sascha.silbe.org>
3562
3563 Excerpts from Nicolas Pouillard's message of Thu Jan 20 16:28:17 +0100 2011:
3564
3565 > So it does not clear the index, right? It only assign the set of labels to the
3566 > given message. Just what I need to upgrade my sup index with my notmuch index.
3567
3568 Yes, that's exactly the purpose (except that I'm using it to synchronise
3569 two sup installations, not sup and notmuch).
3570
3571 > > It should also be easy enough to add support for a "diff" style format that
3572 > > would allow replaying "logs" if sup were enhanced to write those in the
3573 > > future.
3574
3575 > Please do.
3576
3577 Eventually I will, but I don't know when I'll get around to do it.
3578
3579 > I hacked such a logging feature [1] in the past [...]
3580
3581 Nice! Looks like the only other places (besides sync_message) that write
3582 to the index are delete and delete_message (the latter is part of a
3583 not-yet-upstreamed patch of mine). Looks like the hardest part will
3584 actually be adding the configuration option for the file name (with
3585 support for a date template). ;)
3586
3587
3588 > [1]: http://gitorious.org/~ertai/sup/clone-by-ertai/commits/to-submit-log-labels-mapping
3589
3590 Sascha
3591
3592 --
3593 http://sascha.silbe.org/
3594 http://www.infra-silbe.de/
3595 -------------- next part --------------
3596 A non-text attachment was scrubbed...
3597 Name: signature.asc
3598 Type: application/pgp-signature
3599 Size: 494 bytes
3600 Desc: not available
3601 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110121/dfcfbd48/attachment.bin>
3602
3603 From wmorgan-sup@masanjin.net Sat Jan 22 23:30:07 2011
3604 From: wmorgan-sup@masanjin.net (William Morgan)
3605 Date: Sat, 22 Jan 2011 23:30:07 -0500
3606 Subject: [sup-devel] use-console-gem branch
3607 Message-ID: <1295756532-sup-2574@masanjin.net>
3608
3609 Hi guys,
3610
3611 I've published a branch that uses the console gem and should properly
3612 display CJK text (finally!) on both Ruby 1.8 and 1.9. It's
3613 'use-console-gem'. If anyone wants to give it a go, I'd love to hear
3614 your results. Please report Ruby version and OS as well.
3615
3616 Here's some Chinese text. You can ensure that scrolling left and right
3617 doesn't corrupt the characters, that the cursor highlights the
3618 appropriate line, etc.
3619
3620 ??????????????????????????????????998??
3621 1003???????????????????????????????????
3622 ???????????????????????1064??1067??????
3623 ?????????????????????????????????????
3624 ?????????????????????????????????????
3625 ????
3626 ??????????????????????????????????????
3627 ????????????????????????????????????
3628 ?????????????????????????????????????
3629 ?????????????????????????????????????
3630 ?????????
3631 --
3632 William <wmorgan-sup at masanjin.net>
3633
3634 From pi+sup@pihost.us Sun Jan 23 18:10:53 2011
3635 From: pi+sup@pihost.us (Pi)
3636 Date: Sun, 23 Jan 2011 15:10:53 -0800
3637 Subject: [sup-devel] use-console-gem branch
3638 In-Reply-To: <1295756532-sup-2574@masanjin.net>
3639 References: <1295756532-sup-2574@masanjin.net>
3640 Message-ID: <1295824113-sup-1773@home.mrtheplague.net>
3641
3642 Excerpts from William Morgan's message of Sat Jan 22 20:30:07 -0800 2011:
3643 > Hi guys,
3644 >
3645 > I've published a branch that uses the console gem and should properly
3646 > display CJK text (finally!) on both Ruby 1.8 and 1.9. It's
3647 > 'use-console-gem'. If anyone wants to give it a go, I'd love to hear
3648 > your results. Please report Ruby version and OS as well.
3649
3650 It seems to work well, excepting some artifacting in the rightmost column of the
3651 screen: http://dl.dropbox.com/u/129462/consolegem.png
3652
3653 It goes away with a Ctrl-L, but I figured I'd report it anyway.
3654
3655 --
3656 Theory is when you know something, but it doesn't work. Practice is when
3657 something works, but you don't know why. Programmers combine theory and
3658 practice: Nothing works and they don't know why.
3659
3660 From pi+sup@pihost.us Sun Jan 23 18:04:02 2011
3661 From: pi+sup@pihost.us (Pi)
3662 Date: Sun, 23 Jan 2011 15:04:02 -0800
3663 Subject: [sup-devel] [PATCH] If the name cannot be parsed out,
3664 return "" instead of nil.
3665 Message-ID: <1295823842-6042-1-git-send-email-pi+sup@pihost.us>
3666
3667 From: Anthony Martinez <pi+sup at pihost.us>
3668
3669 This un-breaks some recent change between e0191b4b64e and ec13fa74d that
3670 I haven't tracked down.
3671 ---
3672 lib/sup/person.rb | 2 +-
3673 1 files changed, 1 insertions(+), 1 deletions(-)
3674
3675 diff --git a/lib/sup/person.rb b/lib/sup/person.rb
3676 index ee23fc5..19459e0 100644
3677 --- a/lib/sup/person.rb
3678 +++ b/lib/sup/person.rb
3679 @@ -103,7 +103,7 @@ class Person
3680 when /((\S+?)@\S+)/
3681 [$2, $1]
3682 else
3683 - [nil, s]
3684 + ["", s]
3685 end
3686
3687 Person.new name, email
3688 --
3689 1.6.6
3690
3691
3692 From rlane@club.cc.cmu.edu Mon Jan 24 01:05:04 2011
3693 From: rlane@club.cc.cmu.edu (Rich Lane)
3694 Date: Mon, 24 Jan 2011 01:05:04 -0500
3695 Subject: [sup-devel] Sup 0.12.1 released
3696 Message-ID: <1295848539-sup-752@zyrg.net>
3697
3698 I'm pleased to announce the release of Sup 0.12.1.
3699
3700 Sup is a console-based email client for people with a lot of email.
3701 It supports tagging, very fast full-text search, automatic contact-
3702 list management, and more. If you're the type of person who treats
3703 email as an extension of your long-term memory, Sup is for you.
3704
3705 Get it: gem install sup
3706 Learn it: http://sup.rubyforge.org
3707 Love it: sup-talk at rubyforge.org
3708
3709 Release notes:
3710
3711 This release changes the gem dependency on ncurses to ncursesw, which
3712 allows the gem to install cleanly on Ruby 1.9.
3713
3714 The new sup-import-dump program applies labels to an existing index,
3715 which could be done with sup-sync before 0.12.
3716
3717 Changelog for 0.12.1:
3718
3719 * Depend on ncursesw rather than ncurses (Ruby 1.9 compatibility)
3720 * Add sup-import-dump
3721
3722 From rlane@club.cc.cmu.edu Mon Jan 24 01:25:28 2011
3723 From: rlane@club.cc.cmu.edu (Rich Lane)
3724 Date: Mon, 24 Jan 2011 01:25:28 -0500
3725 Subject: [sup-devel] Sup 0.12.1 released
3726 In-Reply-To: <1295848539-sup-752@zyrg.net>
3727 References: <1295848539-sup-752@zyrg.net>
3728 Message-ID: <1295849238-sup-9583@zyrg.net>
3729
3730 This is my last release as maintainer. The maintainership reverts back
3731 to William now.
3732
3733 From michael+sup@stapelberg.de Mon Jan 24 08:40:19 2011
3734 From: michael+sup@stapelberg.de (Michael Stapelberg)
3735 Date: Mon, 24 Jan 2011 14:40:19 +0100
3736 Subject: [sup-devel] Sup 0.12.1 released
3737 In-Reply-To: <1295849238-sup-9583@zyrg.net>
3738 References: <1295848539-sup-752@zyrg.net> <1295849238-sup-9583@zyrg.net>
3739 Message-ID: <1295876398-sup-4348@midna.zekjur.net>
3740
3741 Hi Rich,
3742
3743 Excerpts from Rich Lane's message of 2011-01-24 07:25:28 +0100:
3744 > This is my last release as maintainer. The maintainership reverts back
3745 > to William now.
3746 Does that mean we should CC William when sending patches now?
3747
3748 Best regards,
3749 Michael
3750
3751 From wmorgan-sup@masanjin.net Mon Jan 24 12:25:51 2011
3752 From: wmorgan-sup@masanjin.net (William Morgan)
3753 Date: Mon, 24 Jan 2011 12:25:51 -0500
3754 Subject: [sup-devel] use-console-gem branch
3755 In-Reply-To: <1295824113-sup-1773@home.mrtheplague.net>
3756 References: <1295756532-sup-2574@masanjin.net>
3757 <1295824113-sup-1773@home.mrtheplague.net>
3758 Message-ID: <1295889904-sup-6248@masanjin.net>
3759
3760 Reformatted excerpts from Pi's message of 2011-01-23:
3761 > It seems to work well, excepting some artifacting in the rightmost
3762 > column of the screen: http://dl.dropbox.com/u/129462/consolegem.png
3763
3764 This should be fixed. Still haven't found the source of that nasty black
3765 square that pops up when thread-index-mode is drawn afresh.
3766 --
3767 William <wmorgan-sup at masanjin.net>
3768
3769 From wmorgan-sup@masanjin.net Mon Jan 24 12:27:49 2011
3770 From: wmorgan-sup@masanjin.net (William Morgan)
3771 Date: Mon, 24 Jan 2011 12:27:49 -0500
3772 Subject: [sup-devel] Sup 0.12.1 released
3773 In-Reply-To: <1295849238-sup-9583@zyrg.net>
3774 References: <1295848539-sup-752@zyrg.net> <1295849238-sup-9583@zyrg.net>
3775 Message-ID: <1295889974-sup-8935@masanjin.net>
3776
3777 Reformatted excerpts from Rich Lane's message of 2011-01-24:
3778 > This is my last release as maintainer. The maintainership reverts back
3779 > to William now.
3780
3781 Thanks for all your hard work, Rich.
3782 --
3783 William <wmorgan-sup at masanjin.net>
3784
3785 From wmorgan-sup@masanjin.net Mon Jan 24 12:39:50 2011
3786 From: wmorgan-sup@masanjin.net (William Morgan)
3787 Date: Mon, 24 Jan 2011 12:39:50 -0500
3788 Subject: [sup-devel] Sup 0.12.1 released
3789 In-Reply-To: <1295876398-sup-4348@midna.zekjur.net>
3790 References: <1295848539-sup-752@zyrg.net> <1295849238-sup-9583@zyrg.net>
3791 <1295876398-sup-4348@midna.zekjur.net>
3792 Message-ID: <1295890080-sup-6272@masanjin.net>
3793
3794 Reformatted excerpts from Michael Stapelberg's message of 2011-01-24:
3795 > Does that mean we should CC William when sending patches now?
3796
3797 You can CC me if you like, but it won't help. :)
3798
3799 I have a little more time for Sup nowadays than before. But I would
3800 rather spend it working on features (including possible a new index
3801 backend.)
3802
3803 So if there's anyone who would be interested in the maintainership
3804 busywork of collecting patches, making branches, and pushing releases,
3805 please let me know.
3806 --
3807 William <wmorgan-sup at masanjin.net>
3808
3809 From michael+sup@stapelberg.de Mon Jan 24 13:20:13 2011
3810 From: michael+sup@stapelberg.de (Michael Stapelberg)
3811 Date: Mon, 24 Jan 2011 19:20:13 +0100
3812 Subject: [sup-devel] [PATCH] Re: [sup-talk] Bug reading/writing contacts
3813 with \" in them
3814 In-Reply-To: <1295845756-sup-308@pruts.nl>
3815 References: <1295845756-sup-308@pruts.nl>
3816 Message-ID: <1295892863-sup-1896@midna.zekjur.net>
3817
3818 Hi Ico,
3819
3820 Excerpts from Ico's message of 2011-01-24 06:20:47 +0100:
3821 > The problem occurs when contacts have a certain combination of backslashes and
3822 > quotes in them. I 'imported' my mutt aliases with a simple script converting
3823 > the format (too bad it is *almost* the same but not quite), and one of the
3824 > contacts looked like this:
3825 >
3826 > somename: \"Some, Name\" <somename at somedomain.com>
3827 As discussed on IRC, I?ve made the following findings:
3828
3829 ? Some combinations of email addresses (phrase + addr-spec in RFC822
3830 terminology) need to be escaped, for example when they contain a comma or a
3831 quote.
3832 ? This escaping happens in Person#full_address by using @name.inspect
3833 ? Person#full_address also is used when saving contacts back to contacts.txt
3834 ? Person#initialize partly strips the quotes (line 10/11), but does not handle
3835 backslashes.
3836
3837 Attached is a patch which fixes the issue. Input like "Rob, Post\" will first
3838 be turned into "Rob, Post\\" when initially escaping, but will then stay "Rob,
3839 Post\\" (no more exploding backslashes).
3840
3841 Best regards,
3842 Michael
3843 -------------- next part --------------
3844 A non-text attachment was scrubbed...
3845 Name: 0001-Bugfix-Un-escape-slashes-when-initializing-a-new-Per.patch
3846 Type: application/octet-stream
3847 Size: 798 bytes
3848 Desc: not available
3849 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110124/f9e9ff63/attachment.obj>
3850
3851 From wmorgan-sup@masanjin.net Mon Jan 24 13:40:49 2011
3852 From: wmorgan-sup@masanjin.net (William Morgan)
3853 Date: Mon, 24 Jan 2011 13:40:49 -0500
3854 Subject: [sup-devel] call for new maintainers
3855 Message-ID: <1295894044-sup-7965@masanjin.net>
3856
3857 I said this in another thread on sup-devel, but I thought I'd give it a
3858 broader audience.
3859
3860 Rich is stepping down as maintainer due to lack of time (but will still
3861 be around as a contributor). I personally have a little more time
3862 nowadays than I did before. But I would rather spend it working on
3863 features, including possible a new index backend.
3864
3865 So, anyone who would be interested in the maintainership busywork of
3866 collecting patches from sup-devel, making branches, and pushing
3867 releases, please let me know. You must be familiar with git, Ruby and,
3868 of course, Sup. I can provide a brief guide of how this all works.
3869
3870 In exchange, you will have access to the secret Sup maintainer meetings
3871 that take place in the smoky backrooms of various San Francisco bars.
3872
3873 If multiple people are interested, we can set up a rotation so that no
3874 one is stuck with it forever.
3875
3876 If no one responds, I will continue to be your (not very responsive)
3877 maintainer.
3878 --
3879 William <wmorgan-sup at masanjin.net>
3880
3881 From michael+sup@stapelberg.de Mon Jan 24 14:20:18 2011
3882 From: michael+sup@stapelberg.de (Michael Stapelberg)
3883 Date: Mon, 24 Jan 2011 20:20:18 +0100
3884 Subject: [sup-devel] call for new maintainers
3885 In-Reply-To: <1295894044-sup-7965@masanjin.net>
3886 References: <1295894044-sup-7965@masanjin.net>
3887 Message-ID: <1295896722-sup-5870@midna.zekjur.net>
3888
3889 Hi William,
3890
3891 Excerpts from William Morgan's message of 2011-01-24 19:40:49 +0100:
3892 > So, anyone who would be interested in the maintainership busywork of
3893 > collecting patches from sup-devel, making branches, and pushing
3894 > releases, please let me know. You must be familiar with git, Ruby and,
3895 > of course, Sup. I can provide a brief guide of how this all works.
3896 I don?t have enough time to be the only person doing this, but I do offer my
3897 help on reviewing/merging patches. Maybe having more than one guy with commit
3898 access turns out to be a good thing?
3899
3900 Best regards,
3901 Michael
3902
3903 From tero@tilus.net Mon Jan 24 18:24:50 2011
3904 From: tero@tilus.net (Tero Tilus)
3905 Date: Tue, 25 Jan 2011 01:24:50 +0200
3906 Subject: [sup-devel] Patch: Hookify Time#to_nice_s
3907 Message-ID: <1295910855-sup-546@tilus.net>
3908
3909 I noticed that my index-mode-date-widget hook patch (22c7a51675d8) was
3910 not quite there. This is what it should have been from the beginning.
3911
3912 This renders index-mode-date-widget hook obsolete, since
3913 Time#to_nice_s is what index-mode defaults to when there is no hook
3914 defined. Unless of course you want "nice time" to be something else
3915 on index-mode than everywhere else, which I don't think anybody wants.
3916
3917 Is this good as is or should I in this patch do something about the
3918 now obsolete index-mode-date-widget hook? Deprecate somehow?
3919
3920 --
3921 Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
3922 -------------- next part --------------
3923 A non-text attachment was scrubbed...
3924 Name: 0001-Hookify-Time-to_nice_s.patch
3925 Type: application/octet-stream
3926 Size: 4986 bytes
3927 Desc: not available
3928 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110125/88ccfbdc/attachment-0001.obj>
3929
3930 From tero@tilus.net Mon Jan 24 18:33:23 2011
3931 From: tero@tilus.net (Tero Tilus)
3932 Date: Tue, 25 Jan 2011 01:33:23 +0200
3933 Subject: [sup-devel] Patch: Always try to canonize person name using
3934 ContactManager
3935 Message-ID: <1295911516-sup-1253@tilus.net>
3936
3937 Sup has mostly not been using the names defined in contacts.txt when
3938 displaying messages. I vaguely remember seeing an issue reported on
3939 something similar to this. I became annoyed enough and fixed it.
3940
3941 Now Person.from_address first tries to find the person using
3942 ContactManager (if it is instantiated) and falls back to
3943 Person.new(name, email).
3944
3945 --
3946 Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
3947 -------------- next part --------------
3948 A non-text attachment was scrubbed...
3949 Name: 0002-Always-try-to-canonize-person-name-using-ContactMana.patch
3950 Type: application/octet-stream
3951 Size: 2418 bytes
3952 Desc: not available
3953 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110125/12cf2302/attachment.obj>
3954
3955 From tero@tilus.net Mon Jan 24 19:39:06 2011
3956 From: tero@tilus.net (Tero Tilus)
3957 Date: Tue, 25 Jan 2011 02:39:06 +0200
3958 Subject: [sup-devel] use-console-gem branch
3959 In-Reply-To: <1295756532-sup-2574@masanjin.net>
3960 References: <1295756532-sup-2574@masanjin.net>
3961 Message-ID: <1295915652-sup-2744@tilus.net>
3962
3963 William Morgan, 2011-01-23 06:30:
3964 > If anyone wants to give it a go, I'd love to hear your
3965 > results. Please report Ruby version and OS as well.
3966
3967 Debian 5.0.8
3968 ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
3969
3970 --- NoMethodError from thread: load threads for thread-index-mode
3971 undefined method `force_encoding' for nil:NilClass
3972 /home/terotil/src/sup/lib/sup/person.rb:18:in `force_encoding'
3973 /home/terotil/src/sup/lib/sup/message.rb:154:in `load_from_index!'
3974 /home/terotil/src/sup/lib/sup/message.rb:154:in `map'
3975 /home/terotil/src/sup/lib/sup/message.rb:154:in `load_from_index!'
3976 /home/terotil/src/sup/lib/sup/index.rb:219:in `build_message'
3977 /home/terotil/src/sup/lib/sup/index.rb:155:in `each_id_by_date'
3978 /home/terotil/src/sup/lib/sup/thread.rb:338:in `call'
3979 /home/terotil/src/sup/lib/sup/thread.rb:338:in `load_n_threads'
3980 /home/terotil/src/sup/lib/sup/index.rb:155:in `each_id_by_date'
3981 /home/terotil/src/sup/lib/sup/index.rb:250:in `each_id'
3982 /home/terotil/src/sup/lib/sup/index.rb:250:in `each'
3983 /home/terotil/src/sup/lib/sup/index.rb:250:in `each_id'
3984 /home/terotil/src/sup/lib/sup/index.rb:155:in `each_id_by_date'
3985 /home/terotil/src/sup/lib/sup/thread.rb:334:in `load_n_threads'
3986 /home/terotil/src/sup/lib/sup/modes/thread-index-mode.rb:640:in `__unprotected_load_n_threads'
3987 (eval):12:in `load_n_threads'
3988 /home/terotil/src/sup/lib/sup/modes/thread-index-mode.rb:624:in `load_n_threads_background'
3989 /home/terotil/src/sup/lib/sup.rb:81:in `reporting_thread'
3990 /home/terotil/src/sup/lib/sup.rb:79:in `initialize'
3991 /home/terotil/src/sup/lib/sup.rb:79:in `new'
3992 /home/terotil/src/sup/lib/sup.rb:79:in `reporting_thread'
3993 /home/terotil/src/sup/lib/sup/modes/thread-index-mode.rb:623:in `load_n_threads_background'
3994 /home/terotil/src/sup/lib/sup/modes/thread-index-mode.rb:694:in `__unprotected_load_threads'
3995 (eval):12:in `load_threads'
3996 /home/terotil/src/sup/bin/sup:195
3997
3998 This was due to Person#name being set to nil on some cases. I got rid
3999 of it like this
4000
4001 diff --git a/lib/sup/person.rb b/lib/sup/person.rb
4002 index ee23fc5..83fc60f 100644
4003 --- a/lib/sup/person.rb
4004 +++ b/lib/sup/person.rb
4005 @@ -9,6 +9,8 @@ class Person
4006 @name = if name
4007 name = name.strip.gsub(/\s+/, " ")
4008 name =~ /^(['"]\s*)(.*?)(\s*["'])$/ ? $2 : name
4009 + else
4010 + ""
4011 end
4012
4013 @email = email.strip.gsub(/\s+/, " ").downcase
4014 @@ -103,7 +105,7 @@ class Person
4015 when /((\S+?)@\S+)/
4016 [$2, $1]
4017 else
4018 - [nil, s]
4019 + ["", s]
4020 end
4021
4022 Person.new name, email
4023
4024 Only to have it crash later on. ;)
4025
4026 --- ArgumentError from thread: load threads for thread-index-mode
4027 malformed string: invalid multibyte character at position 79
4028 /usr/lib/ruby/gems/1.8/gems/console-0.3/lib/console/string.rb:27:in `display_width'
4029 /usr/lib/ruby/gems/1.8/gems/console-0.3/lib/console/string.rb:27:in `display_width'
4030 /home/terotil/src/sup/lib/sup/modes/scroll-mode.rb:226:in `draw_line_from_array'
4031 /home/terotil/src/sup/lib/sup/util.rb:608:in `each_with_index'
4032 /home/terotil/src/sup/lib/sup/modes/scroll-mode.rb:224:in `each'
4033 /home/terotil/src/sup/lib/sup/modes/scroll-mode.rb:224:in `each_with_index'
4034 /home/terotil/src/sup/lib/sup/modes/scroll-mode.rb:224:in `draw_line_from_array'
4035 /home/terotil/src/sup/lib/sup/modes/scroll-mode.rb:199:in `draw_line'
4036 /home/terotil/src/sup/lib/sup/modes/line-cursor-mode.rb:52:in `draw_line'
4037 /home/terotil/src/sup/lib/sup/modes/scroll-mode.rb:46:in `draw'
4038 /home/terotil/src/sup/lib/sup/modes/scroll-mode.rb:46:in `each'
4039 /home/terotil/src/sup/lib/sup/modes/scroll-mode.rb:46:in `draw'
4040 /home/terotil/src/sup/lib/sup/modes/line-cursor-mode.rb:37:in `draw'
4041 /home/terotil/src/sup/lib/sup/buffer.rb:119:in `draw'
4042 /home/terotil/src/sup/lib/sup/buffer.rb:103:in `redraw'
4043 /home/terotil/src/sup/lib/sup/buffer.rb:336:in `draw_screen'
4044 /home/terotil/src/sup/lib/sup/buffer.rb:766:in `clear'
4045 /home/terotil/src/sup/lib/sup/util.rb:611:in `send'
4046 /home/terotil/src/sup/lib/sup/util.rb:611:in `method_missing'
4047 /home/terotil/src/sup/lib/sup/modes/thread-index-mode.rb:653:in `__unprotected_load_n_threads'
4048 (eval):12:in `load_n_threads'
4049 /home/terotil/src/sup/lib/sup/modes/thread-index-mode.rb:624:in `load_n_threads_background'
4050 /home/terotil/src/sup/lib/sup.rb:81:in `reporting_thread'
4051 /home/terotil/src/sup/lib/sup.rb:79:in `initialize'
4052 /home/terotil/src/sup/lib/sup.rb:79:in `new'
4053 /home/terotil/src/sup/lib/sup.rb:79:in `reporting_thread'
4054 /home/terotil/src/sup/lib/sup/modes/thread-index-mode.rb:623:in `load_n_threads_background'
4055 /home/terotil/src/sup/lib/sup/modes/thread-index-mode.rb:694:in `__unprotected_load_threads'
4056 (eval):12:in `load_threads'
4057 /home/terotil/src/sup/bin/sup:195
4058
4059 --
4060 Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
4061
4062 From gregor@hoffleit.de Tue Jan 25 07:55:17 2011
4063 From: gregor@hoffleit.de (Gregor Hoffleit)
4064 Date: Tue, 25 Jan 2011 13:55:17 +0100
4065 Subject: [sup-devel] Patch: Always try to canonize person name using
4066 ContactManager
4067 In-Reply-To: <1295911516-sup-1253@tilus.net>
4068 References: <1295911516-sup-1253@tilus.net>,
4069 <1265828498-sup-6054@sam.mediasupervision.de>
4070 Message-ID: <1295960019-sup-8840@sam.mediasupervision.de>
4071
4072 * Tero Tilus <tero at tilus.net> [Di Jan 25 00:33:23 +0100 2011]
4073 > Sup has mostly not been using the names defined in contacts.txt when
4074 > displaying messages. I vaguely remember seeing an issue reported on
4075 > something similar to this. I became annoyed enough and fixed it.
4076 >
4077 > Now Person.from_address first tries to find the person using
4078 > ContactManager (if it is instantiated) and falls back to
4079 > Person.new(name, email).
4080
4081
4082 I guess you saw my report in <1265828498-sup-6054 at sam.mediasupervision.de>:
4083
4084 * Gregor Hoffleit <gregor at hoffleit.de> [Mi Feb 10 22:04:57 +0100 2010]
4085 > I have quite a few contacts that send their mails without a display
4086 > name, i.e. something like "From: John.Smith at example.com".
4087 >
4088 > Sup does some magic (in Person.from_address) to derive something like a
4089 > display name from the local-part of the e-mail address. That's fine so
4090 > far.
4091 >
4092 > But, if the person is in my list of contacts, I want Sup to show the
4093 > display name definied in the contacts entry. In the above case, that
4094 > might be "John Smith" or "John E. Smith" or whatever. Instead, Sup
4095 > sticks to the display name derived from the local part, "john.smith".
4096 >
4097 > It's especially odd in the detailed header view of the thread-view-mode,
4098 > where Sup resolves and shows the alias, but still sticks to the derived
4099 > display name:
4100 >
4101 > From: john.smith <john.smith at example.com> (Johnny Boy)
4102 >
4103 >
4104 > The obvious place to start a fix would be Person.from_address, where
4105 > the (display) name, if missing, is derived from the email address.
4106 >
4107 > I wanted to modify Person.from_address in order to use, in the case of
4108 > an empty display name, the ContactManager, to look up any alias in the
4109 > contact list, but somehow I didn't succeed integrating ContactManager
4110 > in person.rb.
4111 >
4112 > Any better idea? Should I file a bug about this?
4113
4114
4115 Regards,
4116 Gregor Hoffleit
4117
4118 From wael.nasreddine@gmail.com Tue Jan 25 12:04:55 2011
4119 From: wael.nasreddine@gmail.com (Wael Nasreddine)
4120 Date: Tue, 25 Jan 2011 18:04:55 +0100
4121 Subject: [sup-devel] Fwd: [sup-talk] call for new maintainers
4122 References: <AANLkTiktGxmVWJCrc=BJdVvA6g3521VCvsF22scY_BhH@mail.gmail.com>
4123 Message-ID: <-4037281717927276068@unknownmsgid>
4124
4125 Hello,
4126
4127 I'm just forwarding the message because it bounced coz I wasn't a member
4128
4129 Regards,
4130 Wael Nasreddine
4131
4132 --
4133 Wael Nasreddine
4134 Sent from my iPhone
4135
4136 Begin forwarded message:
4137
4138 *From:* "Wael M. Nasreddine" <wael.nasreddine at gmail.com>
4139 *Date:* January 25, 2011 15:19:10 GMT+01:00
4140 *To:* William Morgan <wmorgan-sup at masanjin.net>
4141 *Cc:* sup-devel <sup-devel at rubyforge.org>, sup-talk at rubyforge.org
4142 *Subject:* *Re: [sup-talk] call for new maintainers*
4143
4144 Hello,
4145
4146 How much work you estimate per week?
4147
4148 I'm familiar with Ruby and Git, but I'm not very familiar with the code of
4149 SUP itself as I haven't read it entirely yet.. I would gladly help sup but I
4150 need to know first how much work to expect..
4151
4152 Regards,
4153 Wael Nasreddine
4154
4155 On Mon, Jan 24, 2011 at 19:40, William Morgan <wmorgan-sup at masanjin.net>wrote:
4156
4157 > I said this in another thread on sup-devel, but I thought I'd give it a
4158 > broader audience.
4159 >
4160 > Rich is stepping down as maintainer due to lack of time (but will still
4161 > be around as a contributor). I personally have a little more time
4162 > nowadays than I did before. But I would rather spend it working on
4163 > features, including possible a new index backend.
4164 >
4165 > So, anyone who would be interested in the maintainership busywork of
4166 > collecting patches from sup-devel, making branches, and pushing
4167 > releases, please let me know. You must be familiar with git, Ruby and,
4168 > of course, Sup. I can provide a brief guide of how this all works.
4169 >
4170 > In exchange, you will have access to the secret Sup maintainer meetings
4171 > that take place in the smoky backrooms of various San Francisco bars.
4172 >
4173 > If multiple people are interested, we can set up a rotation so that no
4174 > one is stuck with it forever.
4175 >
4176 > If no one responds, I will continue to be your (not very responsive)
4177 > maintainer.
4178 > --
4179 > William <wmorgan-sup at masanjin.net>
4180 > _______________________________________________
4181 > sup-talk mailing list
4182 > sup-talk at rubyforge.org
4183 > http://rubyforge.org/mailman/listinfo/sup-talk
4184 >
4185
4186
4187
4188 --
4189 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4190 Wa?l Nasreddine
4191 TechnoGate www.technogate.fr
4192 mobile : 06.32.94.70.13
4193 agence : 09.70.444.236
4194 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4195 -------------- next part --------------
4196 An HTML attachment was scrubbed...
4197 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110125/27c40e01/attachment.html>
4198
4199 From alvherre@alvh.no-ip.org Tue Jan 25 13:29:39 2011
4200 From: alvherre@alvh.no-ip.org (Alvaro Herrera)
4201 Date: Tue, 25 Jan 2011 15:29:39 -0300
4202 Subject: [sup-devel] Patch: Always try to canonize person name using
4203 ContactManager
4204 In-Reply-To: <1295911516-sup-1253@tilus.net>
4205 References: <1295911516-sup-1253@tilus.net>
4206 Message-ID: <1295979620-sup-7844@alvh.no-ip.org>
4207
4208 Excerpts from Tero Tilus's message of lun ene 24 20:33:23 -0300 2011:
4209 > Sup has mostly not been using the names defined in contacts.txt when
4210 > displaying messages. I vaguely remember seeing an issue reported on
4211 > something similar to this. I became annoyed enough and fixed it.
4212 >
4213 > Now Person.from_address first tries to find the person using
4214 > ContactManager (if it is instantiated) and falls back to
4215 > Person.new(name, email).
4216
4217 I tried this patch -- works great, thanks.
4218
4219 One minor nit, probably material for another patch: the list of names
4220 that's built in the thread index mode doesn't seem to use this
4221 facility, and so when you have a thread that includes several emails
4222 from the same account but inconsistent names, that person is listed more
4223 than once in the "participants" column, with the different names.
4224
4225 (For example I have a thread from Fabian, Fabi?n, and fabian.martinez
4226 that all come from the same fabian.martinez at example.com account).
4227
4228 --
4229 ?lvaro Herrera -- Se vende casa en ?u?oa: www.portalinmobiliario.com/993147
4230
4231 From tero@tilus.net Tue Jan 25 16:25:03 2011
4232 From: tero@tilus.net (Tero Tilus)
4233 Date: Tue, 25 Jan 2011 23:25:03 +0200
4234 Subject: [sup-devel] Patch: Always try to canonize person name using
4235 ContactManager
4236 In-Reply-To: <1295979620-sup-7844@alvh.no-ip.org>
4237 References: <1295911516-sup-1253@tilus.net>
4238 <1295979620-sup-7844@alvh.no-ip.org>
4239 Message-ID: <1295990180-sup-2106@tilus.net>
4240
4241 Alvaro Herrera, 2011-01-25 20:29:
4242 > One minor nit, probably material for another patch: the list of
4243 > names that's built in the thread index mode doesn't seem to use this
4244 > facility
4245
4246 When message was built from index it bypassed person canonization.
4247 Amended patch attached.
4248
4249 > and so when you have a thread that includes several emails from the
4250 > same account but inconsistent names, that person is listed more than
4251 > once in the "participants" column, with the different names.
4252 >
4253 > (For example I have a thread from Fabian, Fabi?n, and
4254 > fabian.martinez that all come from the same
4255 > fabian.martinez at example.com account).
4256
4257 Actually, this was completely independent of the person canonization
4258 feature. Thread index mode, when constructing the from-list,
4259 identified authors by name, not by email. The people not in
4260 contacts.txt and appearing in from fields with varying names were
4261 listed several times.
4262
4263 Attached patch also fixes this.
4264
4265 --
4266 Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
4267 -------------- next part --------------
4268 A non-text attachment was scrubbed...
4269 Name: 0002-Always-try-to-canonize-person-using-ContactManager.patch
4270 Type: application/octet-stream
4271 Size: 4177 bytes
4272 Desc: not available
4273 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110125/d51a72e4/attachment-0001.obj>
4274
4275 From tero@tilus.net Tue Jan 25 16:26:30 2011
4276 From: tero@tilus.net (Tero Tilus)
4277 Date: Tue, 25 Jan 2011 23:26:30 +0200
4278 Subject: [sup-devel] Patch: Always try to canonize person name using
4279 ContactManager
4280 In-Reply-To: <1295960019-sup-8840@sam.mediasupervision.de>
4281 References: <1295911516-sup-1253@tilus.net>
4282 <1265828498-sup-6054@sam.mediasupervision.de>
4283 <1295960019-sup-8840@sam.mediasupervision.de>
4284 Message-ID: <1295990735-sup-6402@tilus.net>
4285
4286 Gregor Hoffleit, 2011-01-25 14:55:
4287 > I guess you saw my report in <1265828498-sup-6054 at sam.mediasupervision.de>
4288
4289 See! I wasn't dreaming. ;)
4290
4291 --
4292 Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
4293
4294 From wmorgan-sup@masanjin.net Wed Jan 26 10:18:59 2011
4295 From: wmorgan-sup@masanjin.net (William Morgan)
4296 Date: Wed, 26 Jan 2011 10:18:59 -0500
4297 Subject: [sup-devel] call for new maintainers
4298 In-Reply-To: <1295896722-sup-5870@midna.zekjur.net>
4299 References: <1295894044-sup-7965@masanjin.net>
4300 <1295896722-sup-5870@midna.zekjur.net>
4301 Message-ID: <1296054871-sup-9586@masanjin.net>
4302
4303 Reformatted excerpts from Michael Stapelberg's message of 2011-01-24:
4304 > I don?t have enough time to be the only person doing this, but I do
4305 > offer my help on reviewing/merging patches. Maybe having more than one
4306 > guy with commit access turns out to be a good thing?
4307
4308 Yeah, maybe that's the right idea.
4309
4310 So let's try this. Michael, Tero, Sascha, Edward, and everyone else
4311 who's had code make it into Sup successfully... if you send me your
4312 Gitorious usernames, I will add you to the Sup group and you will have
4313 push access. Then you can bypass the list mailing list for patches
4314 entirely, which will save me a lot of work.
4315
4316 All I ask is that you divide things into nice topic branches and merge
4317 them into next but not master. I'll merge individual branches into
4318 master when prepping for a release.
4319 --
4320 William <wmorgan-sup at masanjin.net>
4321
4322 From wmorgan-sup@masanjin.net Wed Jan 26 10:33:42 2011
4323 From: wmorgan-sup@masanjin.net (William Morgan)
4324 Date: Wed, 26 Jan 2011 10:33:42 -0500
4325 Subject: [sup-devel] use-console-gem branch
4326 In-Reply-To: <1295915652-sup-2744@tilus.net>
4327 References: <1295756532-sup-2574@masanjin.net> <1295915652-sup-2744@tilus.net>
4328 Message-ID: <1296055344-sup-8917@masanjin.net>
4329
4330 Reformatted excerpts from Tero Tilus's message of 2011-01-24:
4331 > Only to have it crash later on. ;)
4332 >
4333 > --- ArgumentError from thread: load threads for thread-index-mode
4334 > malformed string: invalid multibyte character at position 79
4335
4336 Thanks for the report. I think I'm going to release a new version that
4337 doesn't raise exceptions if the strings are "corrupt"---too frequent an
4338 occurrence to break the entire application.
4339 --
4340 William <wmorgan-sup at masanjin.net>
4341
4342 From bwalton@artsci.utoronto.ca Wed Jan 26 11:10:53 2011
4343 From: bwalton@artsci.utoronto.ca (Ben Walton)
4344 Date: Wed, 26 Jan 2011 11:10:53 -0500
4345 Subject: [sup-devel] call for new maintainers
4346 In-Reply-To: <1296054871-sup-9586@masanjin.net>
4347 References: <1295894044-sup-7965@masanjin.net>
4348 <1295896722-sup-5870@midna.zekjur.net>
4349 <1296054871-sup-9586@masanjin.net>
4350 Message-ID: <1296058113-sup-7048@pinkfloyd.chass.utoronto.ca>
4351
4352 Excerpts from William Morgan's message of Wed Jan 26 10:18:59 -0500 2011:
4353
4354 Hi William,
4355
4356 > Gitorious usernames, I will add you to the Sup group and you will
4357 > have push access. Then you can bypass the list mailing list for
4358 > patches entirely, which will save me a lot of work.
4359
4360 I think it would be nicer to still see all patches posted to the list
4361 first, regardless of committer rights. It's nice to see what people
4362 are doing and be able to comment on proposed changes.
4363
4364 This doesn't preclude pushing to a topic branch as well, but it's
4365 easier to comment on something if you don't need to track all of those
4366 branches too...
4367
4368 Just a thought.
4369
4370 I'm bwalton on gitorious, btw.
4371
4372 Thanks
4373 -Ben
4374 --
4375 Ben Walton
4376 Systems Programmer - CHASS
4377 University of Toronto
4378 C:416.407.5610 | W:416.978.4302
4379
4380
4381 From wmorgan-sup@masanjin.net Wed Jan 26 13:13:40 2011
4382 From: wmorgan-sup@masanjin.net (William Morgan)
4383 Date: Wed, 26 Jan 2011 13:13:40 -0500
4384 Subject: [sup-devel] call for new maintainers
4385 In-Reply-To: <1296058113-sup-7048@pinkfloyd.chass.utoronto.ca>
4386 References: <1295894044-sup-7965@masanjin.net>
4387 <1295896722-sup-5870@midna.zekjur.net>
4388 <1296054871-sup-9586@masanjin.net>
4389 <1296058113-sup-7048@pinkfloyd.chass.utoronto.ca>
4390 Message-ID: <1296065522-sup-5601@masanjin.net>
4391
4392 Reformatted excerpts from Ben Walton's message of 2011-01-26:
4393 > I think it would be nicer to still see all patches posted to the list
4394 > first, regardless of committer rights. It's nice to see what people
4395 > are doing and be able to comment on proposed changes.
4396
4397 Yeah, that would be good, and I hereby encourage that kind of behavior.
4398 I just don't want the "waiting for William to get around to it" to be
4399 the blocking factor like it's always been.
4400
4401 > I'm bwalton on gitorious, btw.
4402
4403 Added.
4404 --
4405 William <wmorgan-sup at masanjin.net>
4406
4407 From michael+sup@stapelberg.de Wed Jan 26 15:20:55 2011
4408 From: michael+sup@stapelberg.de (Michael Stapelberg)
4409 Date: Wed, 26 Jan 2011 21:20:55 +0100
4410 Subject: [sup-devel] Label colors support
4411 In-Reply-To: <1282251819-sup-3517@mintaka>
4412 References: <1280873473-sup-5265@mintaka>
4413 <1282204477-sup-4766@xo15-sascha.sascha.silbe.org>
4414 <1282251819-sup-3517@mintaka>
4415 Message-ID: <1296073198-sup-5439@midna.zekjur.net>
4416
4417 Hi Matias,
4418
4419 Excerpts from Matias Aguirre's message of 2010-08-19 23:04:36 +0200:
4420 > Indeed that will be clearer, here's the changeset:
4421 > http://github.com/omab/sup/commit/1a96a0ae856076d645a11e0b7d94858851343e27
4422 I just created a branch 'label-colors' and merged it into 'next' of
4423 sup/mainline (based on your merged request on gitorious).
4424
4425 Thanks for contributing!
4426
4427 Best regards,
4428 Michael
4429
4430 From matiasaguirre@gmail.com Wed Jan 26 16:21:26 2011
4431 From: matiasaguirre@gmail.com (Matias Aguirre)
4432 Date: Wed, 26 Jan 2011 19:21:26 -0200
4433 Subject: [sup-devel] Label colors support
4434 In-Reply-To: <1296073198-sup-5439@midna.zekjur.net>
4435 References: <1280873473-sup-5265@mintaka>
4436 <1282204477-sup-4766@xo15-sascha.sascha.silbe.org>
4437 <1282251819-sup-3517@mintaka>
4438 <1296073198-sup-5439@midna.zekjur.net>
4439 Message-ID: <1296076870-sup-377@mintaka>
4440
4441 Excerpts from Michael Stapelberg's message of Wed Jan 26 18:20:55 -0200 2011:
4442 > Hi Matias,
4443 >
4444 > Excerpts from Matias Aguirre's message of 2010-08-19 23:04:36 +0200:
4445 > > Indeed that will be clearer, here's the changeset:
4446 > > http://github.com/omab/sup/commit/1a96a0ae856076d645a11e0b7d94858851343e27
4447 > I just created a branch 'label-colors' and merged it into 'next' of
4448 > sup/mainline (based on your merged request on gitorious).
4449
4450 That's great, thanks!
4451
4452 > Thanks for contributing!
4453 >
4454 > Best regards,
4455 > Michael
4456 --
4457 Mat?as Aguirre <matiasaguirre at gmail.com>
4458
4459 From alvherre@alvh.no-ip.org Wed Jan 26 18:20:29 2011
4460 From: alvherre@alvh.no-ip.org (Alvaro Herrera)
4461 Date: Wed, 26 Jan 2011 20:20:29 -0300
4462 Subject: [sup-devel] ongoing SPAM attack on the bug tracker
4463 In-Reply-To: <1294636135-sup-6653@masanjin.net>
4464 References: <1294482582-sup-1310@xo15-sascha.sascha.silbe.org>
4465 <1294636135-sup-6653@masanjin.net>
4466 Message-ID: <1296084008-sup-6612@alvh.no-ip.org>
4467
4468 Excerpts from William Morgan's message of lun ene 10 02:28:09 -0300 2011:
4469 > Reformatted excerpts from Sascha Silbe's message of 2011-01-08:
4470 > > The bug tracker keeps getting spammed for more than a few days now.
4471 > > Maybe "anonymous" contributions should be deactivated, at least until
4472 > > better anti-SPAM measures are in place?
4473 >
4474 > I've shut down the bug tracker (temporarily?), since the amount of
4475 > traffic from spambots, although mostly rejected, was destroying the
4476 > server. I'll give it a few days and see if they come back when I turn it
4477 > on.
4478
4479 No luck?
4480
4481 --
4482 ?lvaro Herrera -- Se vende casa en ?u?oa: www.portalinmobiliario.com/993147
4483
4484 From dmishd@gmail.com Wed Jan 26 18:44:28 2011
4485 From: dmishd@gmail.com (Hamish D)
4486 Date: Wed, 26 Jan 2011 23:44:28 +0000
4487 Subject: [sup-devel] call for new maintainers
4488 In-Reply-To: <1296065522-sup-5601@masanjin.net>
4489 References: <1295894044-sup-7965@masanjin.net>
4490 <1295896722-sup-5870@midna.zekjur.net>
4491 <1296054871-sup-9586@masanjin.net>
4492 <1296058113-sup-7048@pinkfloyd.chass.utoronto.ca>
4493 <1296065522-sup-5601@masanjin.net>
4494 Message-ID: <AANLkTinQwjgn8MTepxLUVhFMZXDfc96FM0dEo6Qz-yKn@mail.gmail.com>
4495
4496 > Reformatted excerpts from Ben Walton's message of 2011-01-26:
4497 >> I think it would be nicer to still see all patches posted to the list
4498 >> first, regardless of committer rights. ?It's nice to see what people
4499 >> are doing and be able to comment on proposed changes.
4500 >
4501 > Yeah, that would be good, and I hereby encourage that kind of behavior.
4502 > I just don't want the "waiting for William to get around to it" to be
4503 > the blocking factor like it's always been.
4504
4505 Sounds good to me. I've just signed up to gitorious with user name foobacca.
4506
4507 Hamish
4508
4509 From tero@tilus.net Thu Jan 27 02:31:38 2011
4510 From: tero@tilus.net (Tero Tilus)
4511 Date: Thu, 27 Jan 2011 09:31:38 +0200
4512 Subject: [sup-devel] call for new maintainers
4513 In-Reply-To: <1296054871-sup-9586@masanjin.net>
4514 References: <1295894044-sup-7965@masanjin.net>
4515 <1295896722-sup-5870@midna.zekjur.net>
4516 <1296054871-sup-9586@masanjin.net>
4517 Message-ID: <1296112974-sup-5821@tilus.net>
4518
4519 William Morgan, 2011-01-26 17:18:
4520 > So let's try this. Michael, Tero, Sascha, Edward, and everyone else
4521 > who's had code make it into Sup successfully... if you send me your
4522 > Gitorious usernames
4523
4524 I'm http://gitorious.org/~terotil
4525
4526 > All I ask is that you divide things into nice topic branches and
4527 > merge them into next but not master.
4528
4529 Do you prefer basing feature branches to master or next?
4530
4531 Should we prefix feature branch names to keep `git branch` more
4532 readable? They could be topic-* or feature-* or alike.
4533
4534 --
4535 Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
4536
4537 From dmishd@gmail.com Thu Jan 27 07:02:51 2011
4538 From: dmishd@gmail.com (Hamish D)
4539 Date: Thu, 27 Jan 2011 12:02:51 +0000
4540 Subject: [sup-devel] sup dies when gpgme not present
4541 Message-ID: <AANLkTi=52GtjhbzqvtMESP4Yn=npir_6x63pNp6sX=SL@mail.gmail.com>
4542
4543 >> I have some more ideas for improvements, but I'm happy that this
4544 >> reproduces the behaviour of using the gpg binary, and I find sup usage
4545 >> much smoother with this change.
4546
4547 Thank you.
4548
4549 > When the gpgme gem is not installed, this patch makes sup die on start
4550 > with:
4551 >
4552 > --- NameError from thread: main
4553 > uninitialized constant Redwood::CryptoManager::GPGME
4554 > /home/alvherre/Code/sup-mail/lib/sup/crypto.rb:49:in `initialize'
4555 > ...
4556
4557 The code around that line is:
4558
4559 # test if the gpgme gem is available
4560 @gpgme_present =
4561 begin
4562 begin
4563 GPGME.check_version({:protocol => GPGME::PROTOCOL_OpenPGP})
4564 <-- line 49
4565 true
4566 rescue GPGME::Error
4567 false
4568 end
4569 rescue NameError
4570 false
4571 end
4572
4573 So we should rescue the NameError. Could you check whether the code
4574 for your sup looks like that? Could you also temporarily remove the
4575 gpgme gem, update to the latest from master and see if you still get
4576 the same problem?
4577
4578 Thanks in advance, and sorry for not getting back sooner.
4579 Hamish
4580
4581 From alvherre@alvh.no-ip.org Thu Jan 27 08:26:36 2011
4582 From: alvherre@alvh.no-ip.org (Alvaro Herrera)
4583 Date: Thu, 27 Jan 2011 10:26:36 -0300
4584 Subject: [sup-devel] sup dies when gpgme not present
4585 In-Reply-To: <AANLkTi=52GtjhbzqvtMESP4Yn=npir_6x63pNp6sX=SL@mail.gmail.com>
4586 References: <AANLkTi=52GtjhbzqvtMESP4Yn=npir_6x63pNp6sX=SL@mail.gmail.com>
4587 Message-ID: <1296134724-sup-6117@alvh.no-ip.org>
4588
4589 Excerpts from Hamish D's message of jue ene 27 09:02:51 -0300 2011:
4590
4591 > > When the gpgme gem is not installed, this patch makes sup die on start
4592 > > with:
4593 > >
4594 > > --- NameError from thread: main
4595 > > uninitialized constant Redwood::CryptoManager::GPGME
4596 > > /home/alvherre/Code/sup-mail/lib/sup/crypto.rb:49:in `initialize'
4597 > > ...
4598 >
4599 > The code around that line is:
4600 >
4601 > # test if the gpgme gem is available
4602 > @gpgme_present =
4603 > begin
4604 > begin
4605 > GPGME.check_version({:protocol => GPGME::PROTOCOL_OpenPGP})
4606 > <-- line 49
4607 > true
4608 > rescue GPGME::Error
4609 > false
4610 > end
4611 > rescue NameError
4612 > false
4613 > end
4614 >
4615 > So we should rescue the NameError. Could you check whether the code
4616 > for your sup looks like that?
4617
4618 It doesn't. The code I had failing was:
4619
4620 45 # test if the gpgme gem is available
4621 46 @gpgme_present = true
4622 47 begin
4623 48 GPGME.check_version({:protocol => GPGME::PROTOCOL_OpenPGP})
4624 49 rescue NameError, GPGME::Error
4625 50 @gpgme_present = false
4626 51 return
4627 52 end
4628
4629
4630 > Could you also temporarily remove the gpgme gem, update to the latest
4631 > from master and see if you still get the same problem?
4632
4633 I have just updated to master and now the code looks like the snippet
4634 you pasted. This was fixed in:
4635
4636 commit 02fbc3c8bb5e82a3ea67c2dd239bc3ccca36049e
4637 Author: William Morgan <william at twitter.com>
4638 Date: Wed Jan 19 15:47:28 2011 -0800
4639
4640 fix gpgme check
4641
4642 It works as is in 1.9, but in 1.8 it was throwing an exception for even
4643 referencing GPGME::Error if gpgme wasn't installed.
4644
4645
4646 I tried uninstalling gpgme and now it starts without dying.
4647
4648 --
4649 ?lvaro Herrera -- Se vende casa en ?u?oa: www.portalinmobiliario.com/993147
4650
4651 From rlane@club.cc.cmu.edu Thu Jan 27 23:26:38 2011
4652 From: rlane@club.cc.cmu.edu (Rich Lane)
4653 Date: Thu, 27 Jan 2011 23:26:38 -0500
4654 Subject: [sup-devel] new branch: keybindings
4655 Message-ID: <1296187729-sup-7405@zyrg.net>
4656
4657 This branch makes the keybindings hook more useful. It moves the global
4658 keymap into a new GlobalMode that all others inherit from. This lets
4659 you write the same code to make a global keybinding as for a
4660 mode-specific one:
4661
4662 class Redwood::GlobalMode
4663 keymap.add! :list_starred, "List all starred threads", "s"
4664
4665 def list_starred
4666 SearchResultsMode.spawn_from_query "is:starred"
4667 end
4668 end
4669
4670 I got rid of the "modes" local since I think it's better to just reopen
4671 the class with normal Ruby syntax. The keybindings hook is now exactly
4672 like the startup hook but with the O-k keybinding to reload it.
4673
4674 This branch also makes it easier to write keybindings by catching and
4675 displaying exceptions from any keybinding, including builtin Sup ones.
4676 Masking Sup bugs isn't the goal (there's still a backtrace and bug
4677 report instructions) but the user experience is much better than losing
4678 a half-composed email.
4679
4680 I've added some of my own keybindings (not using GlobalMode yet) to the
4681 wiki: http://sup.rubyforge.org/wiki/wiki.pl?CustomizingKeys
4682
4683 From wmorgan-sup@masanjin.net Fri Jan 28 01:20:50 2011
4684 From: wmorgan-sup@masanjin.net (William Morgan)
4685 Date: Fri, 28 Jan 2011 01:20:50 -0500
4686 Subject: [sup-devel] call for new maintainers
4687 In-Reply-To: <1296112974-sup-5821@tilus.net>
4688 References: <1295894044-sup-7965@masanjin.net>
4689 <1295896722-sup-5870@midna.zekjur.net>
4690 <1296054871-sup-9586@masanjin.net> <1296112974-sup-5821@tilus.net>
4691 Message-ID: <1296195497-sup-1700@masanjin.net>
4692
4693 Reformatted excerpts from Tero Tilus's message of 2011-01-27:
4694 > I'm http://gitorious.org/~terotil
4695
4696 Added! And now I can ignore all your outstanding patch requests. :)
4697
4698 > > All I ask is that you divide things into nice topic branches and
4699 > > merge them into next but not master.
4700 >
4701 > Do you prefer basing feature branches to master or next?
4702
4703 Base them off of master, please. If they're based off of next, I can't
4704 merge them into master without also merging all of next.
4705
4706 > Should we prefix feature branch names to keep `git branch` more
4707 > readable? They could be topic-* or feature-* or alike.
4708
4709 I don't think that's necessary. The only two integration branches are
4710 master and next (and the release-* branches, I suppose). When I merge
4711 things into master I will delete the remote branches as well, so we
4712 shouldn't end up with a big mess.
4713 --
4714 William <wmorgan-sup at masanjin.net>
4715
4716 From adeel@adeel.ru Fri Jan 28 22:11:40 2011
4717 From: adeel@adeel.ru (Adeel Ahmad Khan)
4718 Date: Fri, 28 Jan 2011 22:11:40 -0500
4719 Subject: [sup-devel] Bug: UTF-8 error when sending messages
4720 Message-ID: <1296270677-sup-4339@poincare>
4721
4722 When sending a message containing certain characters, like guillemets
4723 <http://en.wikipedia.org/wiki/Guillemets>, I experiencing the following error.
4724
4725 --- ArgumentError from thread: main
4726 invalid byte sequence in UTF-8
4727 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:497:in `block in mentions_attachments?'
4728 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:497:in `each'
4729 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:497:in `any?'
4730 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:497:in `mentions_attachments?'
4731 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:339:in `send_message'
4732 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/mode.rb:59:in `handle_input'
4733 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/buffer.rb:277:in `handle_input'
4734 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/bin/sup:260:in `<module:Redwood>'
4735 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/bin/sup:69:in `<top (required)>'
4736 /usr/bin/sup:19:in `load'
4737 /usr/bin/sup:19:in `<main>'
4738
4739 After setting :confirm_no_attachments and :confirm_top_posting to false, I get
4740 the following error instead.
4741
4742 --- ArgumentError from thread: main
4743 invalid byte sequence in UTF-8
4744 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:389:in `build_message'
4745 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:354:in `send_message'
4746 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/mode.rb:59:in `handle_input'
4747 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/buffer.rb:277:in `handle_input'
4748 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/bin/sup:260:in `<module:Redwood>'
4749 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/bin/sup:69:in `<top (required)>'
4750 /usr/bin/sup:19:in `load'
4751 /usr/bin/sup:19:in `<main>'
4752
4753 I am using a nearly fresh installation of Sup 0.12.1 with Ruby 1.9.2p136. I
4754 have LOCALE="en_US.UTF-8".
4755
4756 Adeel
4757
4758 From adeel@adeel.ru Fri Jan 28 20:00:16 2011
4759 From: adeel@adeel.ru (Adeel Ahmad Khan)
4760 Date: Fri, 28 Jan 2011 20:00:16 -0500
4761 Subject: [sup-devel] UTF-8 error when sending messages
4762 Message-ID: <1296261855-sup-9354@poincare>
4763
4764 When sending a message containing certain characters, like guillemets
4765 <http://en.wikipedia.org/wiki/Guillemets>, I experiencing the following error.
4766
4767 --- ArgumentError from thread: main
4768 invalid byte sequence in UTF-8
4769 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:497:in `block in mentions_attachments?'
4770 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:497:in `each'
4771 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:497:in `any?'
4772 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:497:in `mentions_attachments?'
4773 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:339:in `send_message'
4774 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/mode.rb:59:in `handle_input'
4775 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/buffer.rb:277:in `handle_input'
4776 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/bin/sup:260:in `<module:Redwood>'
4777 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/bin/sup:69:in `<top (required)>'
4778 /usr/bin/sup:19:in `load'
4779 /usr/bin/sup:19:in `<main>'
4780
4781 After setting :confirm_no_attachments and :confirm_top_posting to false, I get
4782 the following error instead.
4783
4784 --- ArgumentError from thread: main
4785 invalid byte sequence in UTF-8
4786 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:389:in `build_message'
4787 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:354:in `send_message'
4788 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/mode.rb:59:in `handle_input'
4789 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/buffer.rb:277:in `handle_input'
4790 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/bin/sup:260:in `<module:Redwood>'
4791 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/bin/sup:69:in `<top (required)>'
4792 /usr/bin/sup:19:in `load'
4793 /usr/bin/sup:19:in `<main>'
4794
4795 I am using a nearly fresh installation of Sup 0.12.1 with Ruby 1.9.2p136. I
4796 have LOCALE="en_US.UTF-8".
4797
4798 Adeel
4799
4800 From tero@tilus.net Sat Jan 29 13:17:36 2011
4801 From: tero@tilus.net (Tero Tilus)
4802 Date: Sat, 29 Jan 2011 20:17:36 +0200
4803 Subject: [sup-devel] Bug: UTF-8 error when sending messages
4804 In-Reply-To: <1296270677-sup-4339@poincare>
4805 References: <1296270677-sup-4339@poincare>
4806 Message-ID: <1296324611-sup-2693@tilus.net>
4807
4808 Adeel Ahmad Khan, 2011-01-29 05:11:
4809 > invalid byte sequence in UTF-8
4810 ...
4811 > I am using a nearly fresh installation of Sup 0.12.1 with Ruby
4812 > 1.9.2p136. I have LOCALE="en_US.UTF-8".
4813
4814 Both the errors were from regex matches against message body. Somehow
4815 your editor doesn't know your locale or is not obeying it. As a
4816 result non-utf8 stuff gets saved to disk and sup gets confused.
4817
4818 --
4819 Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
4820
4821 From eg@gaute.vetsj.com Sun Jan 30 10:58:31 2011
4822 From: eg@gaute.vetsj.com (Gaute Hope)
4823 Date: Sun, 30 Jan 2011 16:58:31 +0100
4824 Subject: [sup-devel] Bug: UTF-8 error when sending messages
4825 In-Reply-To: <1296270677-sup-4339@poincare>
4826 References: <1296270677-sup-4339@poincare>
4827 Message-ID: <1296402962-sup-9808@qwerzila>
4828
4829 Excerpts from Adeel Ahmad Khan's message of 2011-01-29 04:11:40 +0100:
4830 > When sending a message containing certain characters, like guillemets
4831 > <http://en.wikipedia.org/wiki/Guillemets>, I experiencing the following error.
4832 >
4833 > --- ArgumentError from thread: main
4834 > invalid byte sequence in UTF-8
4835 > /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:497:in `block in mentions_attachments?'
4836
4837 Could you try if this patch fixes it (or just edit the lines manually) ?
4838
4839 - Gaute
4840
4841
4842 >From 67a8777875091da6ae57c762f18254509f418a46 Mon Sep 17 00:00:00 2001
4843 From: Gaute Hope <eg at gaute.vetsj.com>
4844 Date: Sun, 30 Jan 2011 16:57:15 +0100
4845 Subject: [PATCH] Attempt to handle encoding errors when searching for attachment string
4846
4847 ---
4848 lib/sup/modes/edit-message-mode.rb | 5 ++++-
4849 1 files changed, 4 insertions(+), 1 deletions(-)
4850
4851 diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
4852 index 734a879..8517011 100644
4853 --- a/lib/sup/modes/edit-message-mode.rb
4854 +++ b/lib/sup/modes/edit-message-mode.rb
4855 @@ -494,7 +494,10 @@ private
4856 if HookManager.enabled? "mentions-attachments"
4857 HookManager.run "mentions-attachments", :header => @header, :body => @body
4858 else
4859 - @body.any? { |l| l =~ /^[^>]/ && l =~ /\battach(ment|ed|ing|)\b/i }
4860 + @body.any? { |l|
4861 + l.force_encoding 'UTF-8' if l.methods.include?(:encoding)
4862 + l =~ /^[^>]/ && l =~ /\battach(ment|ed|ing|)\b/i
4863 + }
4864 end
4865 end
4866
4867 --
4868 1.7.3.5
4869
4870 From dmishd@gmail.com Sun Jan 30 17:57:02 2011
4871 From: dmishd@gmail.com (Hamish)
4872 Date: Sun, 30 Jan 2011 22:57:02 +0000
4873 Subject: [sup-devel] Fixed bug with messages not being signed.
4874 Message-ID: <1296426286-sup-8656@whisper>
4875
4876 Found the bug that stopped people signing email. Needed to use merge!
4877 rather than merge. Real slap on head moment.
4878
4879 I've committed it to the (existing) gpgme branch and to next.
4880
4881 Hamish Downer
4882
4883
4884
4885 Full patch is:
4886
4887 commit 42149329b37af5e3fc0183367521999c479b7881
4888 Author: Hamish Downer <dmishd at gmail.com>
4889 Date: Sun Jan 30 22:44:05 2011 +0000
4890
4891 Fixed the bug that stopped emails being signed.
4892
4893 Schoolboy error - needed merge! rather than merge
4894
4895 diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
4896 index e532261..5f1b730 100644
4897 --- a/lib/sup/crypto.rb
4898 +++ b/lib/sup/crypto.rb
4899 @@ -57,7 +57,7 @@ EOS
4900 return unknown_status(cant_find_gpgme) unless @gpgme_present
4901
4902 gpg_opts = {:protocol => GPGME::PROTOCOL_OpenPGP, :armor => true, :textmode => true}
4903 - gpg_opts.merge(gen_sign_user_opts(from))
4904 + gpg_opts.merge!(gen_sign_user_opts(from))
4905 gpg_opts = HookManager.run("gpg-options",
4906 {:operation => "sign", :options => gpg_opts}) || gpg_opts
4907
4908 @@ -82,8 +82,8 @@ EOS
4909
4910 gpg_opts = {:protocol => GPGME::PROTOCOL_OpenPGP, :armor => true, :textmode => true}
4911 if sign
4912 - gpg_opts.merge(gen_sign_user_opts(from))
4913 - gpg_opts.merge({:sign => true})
4914 + gpg_opts.merge!(gen_sign_user_opts(from))
4915 + gpg_opts.merge!({:sign => true})
4916 end
4917 gpg_opts = HookManager.run("gpg-options",
4918 {:operation => "encrypt", :options => gpg_opts}) || gpg_opts
4919
4920 From dmishd@gmail.com Sun Jan 30 18:53:42 2011
4921 From: dmishd@gmail.com (Hamish)
4922 Date: Sun, 30 Jan 2011 23:53:42 +0000
4923 Subject: [sup-devel] more gpgme fixes
4924 Message-ID: <1296431335-sup-781@whisper>
4925
4926 I've pushed a couple more patches to the gpgme branch and to next.
4927
4928 One fixes the issue where sup would send a message you wanted signed
4929 or encrypted without signing or encrypting it when the key (or
4930 gpg-agent) is not available. For some reason GPGME doesn't complain
4931 but just returns an empty string. The patch checks for this case and
4932 complains.
4933
4934 The other one shows the full fingerprint of keys used to sign messages
4935 if the key is not trusted.
4936
4937 Hamish Downer
4938
4939
4940
4941 commit ac321bd89a72dba74e9b2ff182be0b5fc89a61fc
4942 Author: Hamish Downer <dmishd at gmail.com>
4943 Date: Sun Jan 30 23:37:45 2011 +0000
4944
4945 Catch case where gpg-agent not running or key not available
4946
4947 GPGME does not raise an Error when the key is not available (say
4948 gpg-agent is not running, or the key is on removable media and has
4949 been removed). In these cases GPGME returns a zero length string.
4950 This patch checks the returned string and raises an error if it has
4951 zero length.
4952
4953 diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
4954 index 5f1b730..6f6797b 100644
4955 --- a/lib/sup/crypto.rb
4956 +++ b/lib/sup/crypto.rb
4957 @@ -68,6 +68,13 @@ EOS
4958 raise Error, "GPG command failed. See log for details."
4959 end
4960
4961 + # if the key (or gpg-agent) is not available GPGME does not complain
4962 + # but just returns a zero length string. Let's catch that
4963 + if sig.length == 0
4964 + info "GPG failed to generate signature: check that gpg-agent is running and your key is available."
4965 + raise Error, "GPG command failed. See log for details."
4966 + end
4967 +
4968 envelope = RMail::Message.new
4969 envelope.header["Content-Type"] = 'multipart/signed; protocol=application/pgp-signature'
4970
4971 @@ -96,6 +103,13 @@ EOS
4972 raise Error, "GPG command failed. See log for details."
4973 end
4974
4975 + # if the key (or gpg-agent) is not available GPGME does not complain
4976 + # but just returns a zero length string. Let's catch that
4977 + if cipher.length == 0
4978 + info "GPG failed to generate cipher text: check that gpg-agent is running and your key is available."
4979 + raise Error, "GPG command failed. See log for details."
4980 + end
4981 +
4982 encrypted_payload = RMail::Message.new
4983 encrypted_payload.header["Content-Type"] = "application/octet-stream"
4984 encrypted_payload.header["Content-Disposition"] = 'inline; filename="msg.asc"'
4985
4986
4987
4988
4989
4990
4991 commit 9b1721cce09fc18bd9975d9b24918c8c314aaabe
4992 Author: Hamish Downer <dmishd at gmail.com>
4993 Date: Sun Jan 30 23:43:14 2011 +0000
4994
4995 Add full fingerprint for untrusted keys
4996
4997 When the key that signed a message is not trusted, show the full
4998 fingerprint, as the gpg binary does.
4999
5000 diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
5001 index 6f6797b..5a38f27 100644
5002 --- a/lib/sup/crypto.rb
5003 +++ b/lib/sup/crypto.rb
5004 @@ -307,6 +307,7 @@ private
5005 if signature.validity != GPGME::GPGME_VALIDITY_FULL && signature.validity != GPGME::GPGME_VALIDITY_MARGINAL
5006 output_lines << "WARNING: This key is not certified with a trusted signature!"
5007 output_lines << "There is no indication that the signature belongs to the owner"
5008 + output_lines << "Full fingerprint is: " + (0..9).map {|i| signature.fpr[(i*2),2]}.join(":")
5009 else
5010 trusted = true
5011 end
5012
5013 From dmishd@gmail.com Sun Jan 30 18:57:03 2011
5014 From: dmishd@gmail.com (Hamish D)
5015 Date: Sun, 30 Jan 2011 23:57:03 +0000
5016 Subject: [sup-devel] [PATCH] Converted crypto to use the gpgme gem
5017 In-Reply-To: <1291023322-sup-8457@meteor.durcheinandertal.local>
5018 References: <AANLkTinrSAheJb2F4Xw9AmgXcGLxeQh0_MEnuTSATye_@mail.gmail.com>
5019 <AANLkTinXwKiJqgKyFrrcVV21a8j8hV=fw4QcvDLhtM8E@mail.gmail.com>
5020 <AANLkTi=7yasVvAW4P85v3GJxf+quJrE3-1XruDgUZq+D@mail.gmail.com>
5021 <1289466286-sup-7540@meteor.durcheinandertal.local>
5022 <AANLkTikUwyX6xj-f_ZnLp6s2s9vaCpgayPKygniWndoJ@mail.gmail.com>
5023 <1289907535-sup-3989@meteor.durcheinandertal.local>
5024 <AANLkTi=xz16ecZ0C5=RUcOG4wzojVVzs70PZ2ueKa0ht@mail.gmail.com>
5025 <1289932061-sup-96@meteor.durcheinandertal.local>
5026 <AANLkTin=1MRrW0vuj_7uMvjcyLc3Aaw4ddZ_Rq6TBiyx@mail.gmail.com>
5027 <AANLkTinvv59bWu0UfjW2K-xDRUP42tDwmgMh5yZdmaN_@mail.gmail.com>
5028 <1291023322-sup-8457@meteor.durcheinandertal.local>
5029 Message-ID: <AANLkTimKK6yW7E-KYF12RfNwJE4eM04ftKL-FrNu7XQ1@mail.gmail.com>
5030
5031 > I just discovered another problem: If the secret key is not available
5032 > (because it's on a removable media and the media is not mounted), the
5033 > mail is sent anyway. While this is just a bit annoying for signed mail
5034 > it definitely should not happen for encrypted mails. Current sup
5035 > corectly fails in this case.
5036
5037 Finally got around to fixing this issue. I think it may be a bug in
5038 the gpgme gem which I'll investigate further at some point. In the
5039 meantime, I've worked out how to get sup to stop this being a problem.
5040 The fix has been applied to next, and will hopefully move to master
5041 before too long.
5042
5043 http://www.mail-archive.com/sup-devel at rubyforge.org/msg00899.html
5044
5045 Hamish
5046
5047 From dmishd@gmail.com Sun Jan 30 18:59:38 2011
5048 From: dmishd@gmail.com (Hamish D)
5049 Date: Sun, 30 Jan 2011 23:59:38 +0000
5050 Subject: [sup-devel] [PATCH] Converted crypto to use the gpgme gem
5051 In-Reply-To: <AANLkTimKK6yW7E-KYF12RfNwJE4eM04ftKL-FrNu7XQ1@mail.gmail.com>
5052 References: <AANLkTinrSAheJb2F4Xw9AmgXcGLxeQh0_MEnuTSATye_@mail.gmail.com>
5053 <AANLkTinXwKiJqgKyFrrcVV21a8j8hV=fw4QcvDLhtM8E@mail.gmail.com>
5054 <AANLkTi=7yasVvAW4P85v3GJxf+quJrE3-1XruDgUZq+D@mail.gmail.com>
5055 <1289466286-sup-7540@meteor.durcheinandertal.local>
5056 <AANLkTikUwyX6xj-f_ZnLp6s2s9vaCpgayPKygniWndoJ@mail.gmail.com>
5057 <1289907535-sup-3989@meteor.durcheinandertal.local>
5058 <AANLkTi=xz16ecZ0C5=RUcOG4wzojVVzs70PZ2ueKa0ht@mail.gmail.com>
5059 <1289932061-sup-96@meteor.durcheinandertal.local>
5060 <AANLkTin=1MRrW0vuj_7uMvjcyLc3Aaw4ddZ_Rq6TBiyx@mail.gmail.com>
5061 <AANLkTinvv59bWu0UfjW2K-xDRUP42tDwmgMh5yZdmaN_@mail.gmail.com>
5062 <1291023322-sup-8457@meteor.durcheinandertal.local>
5063 <AANLkTimKK6yW7E-KYF12RfNwJE4eM04ftKL-FrNu7XQ1@mail.gmail.com>
5064 Message-ID: <AANLkTi=DSdyoEjPAHP8Fivss1NcjLGTA+RjXZ+ngU-R8@mail.gmail.com>
5065
5066 > Finally got around to fixing this issue. I think it may be a bug in
5067 > the gpgme gem which I'll investigate further at some point. In the
5068 > meantime, I've worked out how to get sup to stop this being a problem.
5069 > The fix has been applied to next, and will hopefully move to master
5070 > before too long.
5071
5072 Link should have been:
5073
5074 http://rubyforge.org/pipermail/sup-devel/2011-January/000966.html
5075
5076 Sorry, late and tired ...
5077
5078 Hamish Downer
5079
5080 From adeel@adeel.ru Mon Jan 31 13:24:42 2011
5081 From: adeel@adeel.ru (Adeel Ahmad Khan)
5082 Date: Mon, 31 Jan 2011 13:24:42 -0500
5083 Subject: [sup-devel] Bug: UTF-8 error when sending messages
5084 In-Reply-To: <mailman.75.1296431981.25874.sup-devel@rubyforge.org>
5085 References: <mailman.75.1296431981.25874.sup-devel@rubyforge.org>
5086 Message-ID: <1296497911-sup-5024@poincare>
5087
5088
5089 Tero Tilus <tero at tilus.net>:
5090 > Adeel Ahmad Khan, 2011-01-29 05:11:
5091 > > invalid byte sequence in UTF-8
5092 > ...
5093 > > I am using a nearly fresh installation of Sup 0.12.1 with Ruby
5094 > > 1.9.2p136. I have LOCALE="en_US.UTF-8".
5095 >
5096 > Both the errors were from regex matches against message body. Somehow
5097 > your editor doesn't know your locale or is not obeying it. As a
5098 > result non-utf8 stuff gets saved to disk and sup gets confused.
5099
5100 You were right. It turned out to be an issue with editor.
5101
5102 Gaute Hope <eg at gaute.vetsj.com>:
5103 > Excerpts from Adeel Ahmad Khan's message of 2011-01-29 04:11:40 +0100:
5104 > > --- ArgumentError from thread: main
5105 > > invalid byte sequence in UTF-8
5106 > > /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:497:in `block in mentions_attachments?'
5107 >
5108 > Could you try if this patch fixes it (or just edit the lines manually) ?
5109
5110 The patch resolved that error, but I get a different one now:
5111
5112 --- ArgumentError from thread: main
5113 invalid byte sequence in UTF-8
5114 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:389:in `build_message'
5115 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/edit-message-mode.rb:354:in `send_message'
5116 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/mode.rb:59:in `handle_input'
5117 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/lib/sup/buffer.rb:277:in `handle_input'
5118 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/bin/sup:260:in `<module:Redwood>'
5119 /usr/lib/ruby/gems/1.9.1/gems/sup-0.12.1/bin/sup:69:in `<top (required)>'
5120 /usr/bin/sup:19:in `load'
5121 /usr/bin/sup:19:in `<main>'
5122
5123 It looks like another regex match.
5124
5125 m.body += "\n" unless m.body =~ /\n\Z/
5126
5127 In any case it seems to be my problem, not sup's.
5128
5129 Adeel
5130