sup

A curses threads-with-tags style email client

sup-website.git

git clone https://supmua.dev/git/sup-website/

community/pipermail-archives/sup-devel/2011-02.txt (128002B) - raw

      1 From eg@gaute.vetsj.com  Tue Feb  1 08:34:10 2011
      2 From: eg@gaute.vetsj.com (Gaute Hope)
      3 Date: Tue, 01 Feb 2011 14:34:10 +0100
      4 Subject: [sup-devel] Bug: UTF-8 error when sending messages
      5 In-Reply-To: <1296497911-sup-5024@poincare>
      6 References: <mailman.75.1296431981.25874.sup-devel@rubyforge.org>
      7 	<1296497911-sup-5024@poincare>
      8 Message-ID: <1296566276-sup-4340@qwerzila>
      9 
     10 Excerpts from Adeel Ahmad Khan's message of 2011-01-31 19:24:42 +0100:
     11 > 
     12 > Tero Tilus <tero at tilus.net>:
     13 > > Adeel Ahmad Khan, 2011-01-29 05:11:
     14 > > >     invalid byte sequence in UTF-8
     15 > > ...
     16 > > > I am using a nearly fresh installation of Sup 0.12.1 with Ruby
     17 > > > 1.9.2p136.  I have LOCALE="en_US.UTF-8".
     18 
     19 What editor are you using ? Could you attach some buggy text (make sure
     20 it is transferred in binary - ie upload an archive somewhere like
     21 http://paste.xinu.at/)?
     22 
     23 > > Both the errors were from regex matches against message body.  Somehow
     24 > > your editor doesn't know your locale or is not obeying it.  As a
     25 > > result non-utf8 stuff gets saved to disk and sup gets confused.
     26 >
     27 > You were right.  It turned out to be an issue with editor.
     28 
     29 I'm not so sure. I think it is a problem with Ruby (1.9) degrading the
     30 the text it reads to US-ASCII (8bit). And when you later try to do UTF-8
     31 stuff with it (append, or regexp with UTF-8) it fails. Perhaps even when
     32 trying to access chars in the string (the body) that are not really
     33 US-ASCII [2].
     34 
     35 What my patch does is tell Ruby that the string is an UTF-8 string, no
     36 matter what it deduced from reading the file in the first place - or
     37 what might have happened throughout Sup's processing of the text.
     38 
     39 Try this patch, it forces encoding on the entire body: http://ix.io/1rO
     40 
     41 (these patches are workarounds; not to be applied to source-tree)
     42 
     43 The same happened with labels.txt (or with contacts). Whenever a label
     44 string could be degraded to US-ASCII, Ruby did so (how should it know it
     45 was UTF-8 anyway?), then when trying to append, match or work with the
     46 US-ASCII string towards UTF-8 input it failed.
     47 
     48 What I think must be done (as an alternative to supporting different
     49 encodings all the way) - is to _always_ read all files in UTF-8 [1] (or
     50 transcode to UTF-8), and perhaps most difficultly _keep_ the strings
     51 UTF-8 throught the entire Sup processes.
     52 
     53 [1] http://blog.grayproductions.net/articles/ruby_19s_three_default_encodings
     54 [2] http://www.ruby-forum.com/topic/194493
     55 
     56 Best regards,
     57 Gaute
     58 
     59 From dmishd@gmail.com  Thu Feb  3 18:27:18 2011
     60 From: dmishd@gmail.com (Hamish D)
     61 Date: Thu, 3 Feb 2011 23:27:18 +0000
     62 Subject: [sup-devel] couple more gpg related patches
     63 Message-ID: <AANLkTiki8LbxGaCLO0m8ENTF_0bMdJfwWyhDTBscrDLq@mail.gmail.com>
     64 
     65 I've uploaded a couple more patches to the gpgme branch and merged
     66 them into next:
     67 
     68 * one fixes the fingerprint of untrusted keys
     69 * the other adds "untrusted" to the signature summary line when the
     70 key is untrusted - ie when there is no web of trust from you to that
     71 key.
     72 
     73 Patches below for your reading pleasure. Someone tell me if you'd
     74 rather have less detail from me.
     75 
     76 Hamish Downer
     77 
     78 
     79 commit 6f1b9d7e94496543eacc63807b99fa29059ed300
     80 Author: Hamish Downer <dmishd at gmail.com>
     81 Date:   Wed Feb 2 21:06:22 2011 +0000
     82 
     83     show the FULL key fingerprint, not just the first half
     84 
     85 diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
     86 index 967c09e..978e145 100644
     87 --- a/lib/sup/crypto.rb
     88 +++ b/lib/sup/crypto.rb
     89 @@ -313,7 +313,7 @@ private
     90        if signature.validity != GPGME::GPGME_VALIDITY_FULL &&
     91 signature.validity != GPGME::GPGME_VALIDITY_MARGINAL
     92          output_lines << "WARNING: This key is not certified with a
     93 trusted signature!"
     94          output_lines << "There is no indication that the signature
     95 belongs to the owner"
     96 -        output_lines << "Full fingerprint is: " + (0..9).map {|i|
     97 signature.fpr[(i*2),2]}.join(":")
     98 +        output_lines << "Full fingerprint is: " + (0..9).map {|i|
     99 signature.fpr[(i*4),4]}.join(":")
    100        else
    101          trusted = true
    102        end
    103 
    104 
    105 
    106 commit 0e1f5e56dc7063104c52f1b2d03a3fd85573bc47
    107 Author: Hamish Downer <dmishd at gmail.com>
    108 Date:   Wed Feb 2 21:02:05 2011 +0000
    109 
    110     signature summary now states "untrusted" if the signing key is not trusted
    111 
    112 diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
    113 index 5a38f27..967c09e 100644
    114 --- a/lib/sup/crypto.rb
    115 +++ b/lib/sup/crypto.rb
    116 @@ -153,16 +153,18 @@ EOS
    117        end
    118      end
    119 
    120 +    summary_line =
    121 simplify_sig_line(verify_result.signatures[0].to_s, all_trusted)
    122 +
    123      if all_output_lines.length == 0
    124        Chunk::CryptoNotice.new :valid, "Encrypted message wasn't
    125 signed", all_output_lines
    126      elsif valid
    127        if all_trusted
    128 -        Chunk::CryptoNotice.new(:valid,
    129 simplify_sig_line(verify_result.signatures[0].to_s), all_output_lines)
    130 +        Chunk::CryptoNotice.new(:valid, summary_line, all_output_lines)
    131        else
    132 -        Chunk::CryptoNotice.new(:valid_untrusted,
    133 simplify_sig_line(verify_result.signatures[0].to_s), all_output_lines)
    134 +        Chunk::CryptoNotice.new(:valid_untrusted, summary_line,
    135 all_output_lines)
    136        end
    137      elsif !unknown
    138 -      Chunk::CryptoNotice.new(:invalid,
    139 simplify_sig_line(verify_result.signatures[0].to_s), all_output_lines)
    140 +      Chunk::CryptoNotice.new(:invalid, summary_line, all_output_lines)
    141      else
    142        unknown_status all_output_lines
    143      end
    144 @@ -274,8 +276,12 @@ private
    145    end
    146 
    147    # remove the hex key_id and info in ()
    148 -  def simplify_sig_line sig_line
    149 -    sig_line.sub(/from [0-9A-F]{16} /, "from ")
    150 +  def simplify_sig_line sig_line, trusted
    151 +    sig_line.sub!(/from [0-9A-F]{16} /, "from ")
    152 +    if !trusted
    153 +      sig_line.sub!(/Good signature/, "Good (untrusted) signature")
    154 +    end
    155 +    sig_line
    156    end
    157 
    158    def sig_output_lines signature
    159 
    160 From wael.nasreddine@gmail.com  Sun Feb  6 19:10:13 2011
    161 From: wael.nasreddine@gmail.com (Wael M. Nasreddine)
    162 Date: Mon, 7 Feb 2011 01:10:13 +0100
    163 Subject: [sup-devel] Branch maildir-sync
    164 Message-ID: <AANLkTi=QOmu4ru-OiZZojk_GU2KNPtVoboEgG4RwM9J-@mail.gmail.com>
    165 
    166 Hello,
    167 
    168 I'm trying to test the Next branch but with maildir sync support, however
    169 the branch maildir-sync does not merge without conflict into either of
    170 master nor Next, Damien could you please rebase the branch on master please?
    171 
    172 Thanks
    173 
    174 -- 
    175 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    176 Wa?l Nasreddine
    177 TechnoGate www.technogate.fr
    178 mobile :  06.32.94.70.13
    179 agence : 09.70.444.236
    180 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    181 -------------- next part --------------
    182 An HTML attachment was scrubbed...
    183 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110207/e4c76009/attachment.html>
    184 
    185 From eg@gaute.vetsj.com  Tue Feb  8 03:01:44 2011
    186 From: eg@gaute.vetsj.com (Gaute Hope)
    187 Date: Tue, 08 Feb 2011 09:01:44 +0100
    188 Subject: [sup-devel] new branch: keybindings
    189 In-Reply-To: <1296187729-sup-7405@zyrg.net>
    190 References: <1296187729-sup-7405@zyrg.net>
    191 Message-ID: <1297152028-sup-5512@qwerzila>
    192 
    193 Excerpts from Rich Lane's message of 2011-01-28 05:26:38 +0100:
    194 > This branch makes the keybindings hook more useful. It moves the global
    195 > keymap into a new GlobalMode that all others inherit from. This lets
    196 > you write the same code to make a global keybinding as for a
    197 > mode-specific one:
    198 > 
    199 > class Redwood::GlobalMode
    200 >   keymap.add! :list_starred, "List all starred threads", "s"
    201 > 
    202 >   def list_starred
    203 >     SearchResultsMode.spawn_from_query "is:starred"
    204 >   end
    205 > end
    206 > 
    207 > I got rid of the "modes" local since I think it's better to just reopen
    208 > the class with normal Ruby syntax. The keybindings hook is now exactly
    209 > like the startup hook but with the O-k keybinding to reload it.
    210 > 
    211 > This branch also makes it easier to write keybindings by catching and
    212 > displaying exceptions from any keybinding, including builtin Sup ones.
    213 > Masking Sup bugs isn't the goal (there's still a backtrace and bug
    214 > report instructions) but the user experience is much better than losing
    215 > a half-composed email.
    216 > 
    217 > I've added some of my own keybindings (not using GlobalMode yet) to the
    218 > wiki: http://sup.rubyforge.org/wiki/wiki.pl?CustomizingKeys
    219 
    220 Could it be that this broke continue buffer search key 'n' ?
    221 
    222 lib/sup/buffer.rb:171
    223 
    224 This doesn't work for me anymore, could anyone confirm that?
    225 
    226 Best regards,
    227 Gaute Hope
    228 
    229 From eg@gaute.vetsj.com  Tue Feb  8 03:07:31 2011
    230 From: eg@gaute.vetsj.com (Gaute Hope)
    231 Date: Tue, 08 Feb 2011 09:07:31 +0100
    232 Subject: [sup-devel] new branch: keybindings
    233 In-Reply-To: <1297152028-sup-5512@qwerzila>
    234 References: <1296187729-sup-7405@zyrg.net> <1297152028-sup-5512@qwerzila>
    235 Message-ID: <1297152370-sup-4647@qwerzila>
    236 
    237 Excerpts from Gaute Hope's message of 2011-02-08 09:01:44 +0100:
    238 > Excerpts from Rich Lane's message of 2011-01-28 05:26:38 +0100:
    239 > Could it be that this broke continue buffer search key 'n' ?
    240 > 
    241 > lib/sup/buffer.rb:171
    242 > 
    243 > This doesn't work for me anymore, could anyone confirm that?
    244 
    245 Ah - I just noticed that I have to move down one line before I can hit
    246 'n' to search for the next occurrence. I don't think this was the
    247 original, or desired, behaviour?
    248 
    249 - Gaute
    250 
    251 From wmorgan-sup@masanjin.net  Wed Feb  9 01:14:52 2011
    252 From: wmorgan-sup@masanjin.net (William Morgan)
    253 Date: Wed, 09 Feb 2011 06:14:52 +0000
    254 Subject: [sup-devel] whistlepig
    255 Message-ID: <1297231668-sup-8433@masanjin.net>
    256 
    257 Today I've released something that I've been working on for many many months
    258 now, which I hope will form the basis of the mythical Sup 2.0. It's a tiny
    259 full-text search engine called Whistlepig.
    260 
    261 http://masanjin.net/whistlepig
    262 
    263 For a quick demo, if you clone it and check out the ruby/ directory, you can run:
    264 
    265   ruby -Ilib bin/email-indexer <mbox name>
    266   ruby -Ilib bin/email-searcher <mbox name>
    267 
    268 (You will also need to install the oklahoma_mixer, console and trollop gems.)
    269 
    270 This is a super simple non-threaded non-curses email browser. The email parsing
    271 code is much of the Sup email parsing code, but I think I've ironed out all the
    272 Ruby 1.9 encoding-related bugs through a very laborious process of trial and
    273 error.
    274 
    275 For my next trick, I am going to start writing a server version of this.
    276 Believe it or not, I'm thinking HTTP.
    277 -- 
    278 William <wmorgan-sup at masanjin.net>
    279 
    280 From john.wyzer@gmx.de  Wed Feb  9 07:59:50 2011
    281 From: john.wyzer@gmx.de (John Wyzer)
    282 Date: Wed, 09 Feb 2011 13:59:50 +0100
    283 Subject: [sup-devel] bug report / trace, exiting message search buffer
    284 Message-ID: <1297256387-sup-1667@localhost>
    285 
    286 Hi.
    287 
    288 sup v0.12.1:
    289 
    290 I experienced this a few times. Sup crashes sometimes when I hit "x" in a
    291 buffer with message search results.
    292 Submitting it here since the bugtracker is down.
    293 
    294 --- NoMethodError from thread: poll after loading inbox
    295 undefined method `content_width' for nil:NilClass
    296 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:921:in `from_width'
    297 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:840:in `block in text_for_thread_at'
    298 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:839:in `each'
    299 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:839:in `each_with_index'
    300 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:839:in `text_for_thread_at'
    301 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:781:in `block in regen_text'
    302 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/util.rb:444:in `block in map_with_index'
    303 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/util.rb:444:in `each'
    304 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/util.rb:444:in `each_with_index'
    305 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/util.rb:444:in `map_with_index'
    306 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:781:in `regen_text'
    307 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:242:in `update'
    308 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:717:in `add_or_unhide'
    309 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:196:in `handle_added_update'
    310 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/update.rb:26:in `block in relay'
    311 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/update.rb:26:in `each'
    312 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/update.rb:26:in `relay'
    313 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/util.rb:609:in `method_missing'
    314 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/poll.rb:175:in `block in poll_from'
    315 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/maildir.rb:106:in `block (2 levels) in poll'
    316 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/maildir.rb:105:in `each'
    317 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/maildir.rb:105:in `each_with_index'
    318 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/maildir.rb:105:in `block in poll'
    319 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/maildir.rb:90:in `each'
    320 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/maildir.rb:90:in `poll'
    321 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/poll.rb:155:in `poll_from'
    322 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/poll.rb:113:in `block (2 levels) in do_poll'
    323 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/poll.rb:103:in `each'
    324 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/poll.rb:103:in `block in do_poll'
    325 <internal:prelude>:10:in `synchronize'
    326 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/poll.rb:102:in `do_poll'
    327 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/util.rb:609:in `method_missing'
    328 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/poll-mode.rb:15:in `poll'
    329 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/poll.rb:49:in `poll_with_sources'
    330 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/poll.rb:68:in `poll'
    331 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/util.rb:609:in `method_missing'
    332 /var/lib/gems/1.9.1/gems/sup-0.12.1/bin/sup:212:in `block (2 levels) in <module:Redwood>'
    333 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup.rb:78:in `block in reporting_thread'
    334 
    335 From gaudenz@soziologie.ch  Wed Feb  9 16:27:13 2011
    336 From: gaudenz@soziologie.ch (Gaudenz Steinlin)
    337 Date: Wed, 09 Feb 2011 22:27:13 +0100
    338 Subject: [sup-devel] Encoding of message snippet in xapian
    339 Message-ID: <1297286134-sup-7498@meteor.durcheinandertal.local>
    340 
    341 Hi 
    342 
    343 While debuging the trackeback posted below I discovered that my xapian
    344 index contains some of the message snippets in ASCII-8BIT and others
    345 in UTF-8. This leads to probelems when building the thread-view for
    346 collapsed messages for messages wich have non 7-bit ASCII characters
    347 in their snippet. message_patina_lines combines the snippet which
    348 comes from the xapian index and is (sometimes) in ASCII-8BIT with
    349 other parts of the message which are in UTF-8.
    350 
    351 I don't know exactly how I ended up with a xapian index which has some
    352 strings in ASCII-8BIT and others in UTF-8. I guess it's because I
    353 first used sup with Ruby 1.8 and only recently switched to Ruby 1.9.1.
    354 What's the expected encoding of things coming from the xapian index?
    355 Is there a way to fix the index? Or is a fix in sup needed for this?
    356 Or should I just recreate my index from scratch?
    357 
    358 Running sup with Ruby 1.8 avoids the problem. But I guess it only
    359 masks it because 1.8 is not encoding aware.
    360 
    361 Gaudenz
    362 
    363 --- Encoding::CompatibilityError from thread: load messages for thread-view-mode
    364 incompatible character encodings: UTF-8 and ASCII-8BIT
    365 /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:792:in `message_patina_lines'
    366 /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:853:in `chunk_to_lines'
    367 /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:724:in `block in regen_text'
    368 /home/gaudenz/projects/sup/lib/sup/thread.rb:68:in `block in each'
    369 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
    370 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
    371 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
    372 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
    373 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
    374 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
    375 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
    376 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
    377 /home/gaudenz/projects/sup/lib/sup/thread.rb:174:in `each_with_stuff'
    378 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
    379 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
    380 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
    381 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
    382 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
    383 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
    384 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
    385 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
    386 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
    387 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
    388 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
    389 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
    390 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
    391 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
    392 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
    393 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
    394 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
    395 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
    396 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
    397 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
    398 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
    399 /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
    400 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
    401 /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
    402 /home/gaudenz/projects/sup/lib/sup/thread.rb:67:in `each'
    403 /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:713:in `regen_text'
    404 /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:175:in `buffer='
    405 /home/gaudenz/projects/sup/lib/sup/buffer.rb:387:in `spawn'
    406 (eval):1:in `spawn'
    407 /home/gaudenz/projects/sup/lib/sup/modes/thread-index-mode.rb:120:in `block in select'
    408 /home/gaudenz/projects/sup/lib/sup.rb:78:in `block in reporting_thread'
    409 -- 
    410 Ever tried. Ever failed. No matter.
    411 Try again. Fail again. Fail better.
    412 ~ Samuel Beckett ~
    413 
    414 From dmishd@gmail.com  Wed Feb  9 17:03:55 2011
    415 From: dmishd@gmail.com (Hamish D)
    416 Date: Wed, 9 Feb 2011 22:03:55 +0000
    417 Subject: [sup-devel] BRANCH: rerun_crypto_selector
    418 Message-ID: <AANLkTinU=eJ4B0d97T-GfX82mQrQPEpyv-37tUQuogfW@mail.gmail.com>
    419 
    420 I noticed that if I changed the reply-to selector that my
    421 crypto-selector hook wasn't getting called, so I've made a branch
    422 called rerun_crypto_selector (and merged it to next). From the main
    423 commit message in the branch:
    424 
    425     Re-run the crypto selector hook after message changes.
    426 
    427     The crypto-selector hook will be re-run after the message is edited,
    428     or after the recipients change due to changing the "Reply to"
    429     selector in reply-mode. So when the recipients change, the default
    430     selector will also change.
    431 
    432     However, if the user has manually changed the crypto selector then the
    433     hook will not be re-run, so as to avoid over-riding the user's choice.
    434 
    435 I've also updated the wiki as the headers["to"] bit is sometimes an
    436 array. Working much nicer now. I've pasted in the two patches at the
    437 end for those who like to review them in the email.
    438 
    439 Hamish Downer
    440 
    441 
    442 
    443 
    444 commit f111201a469fd1c1dccb143e089cc623ce35025d
    445 Author: Hamish Downer <dmishd at gmail.com>
    446 Date:   Tue Feb 8 23:53:13 2011 +0000
    447 
    448     added @changed_by_user to HorizontalSelector
    449 
    450 diff --git a/lib/sup/horizontal-selector.rb b/lib/sup/horizontal-selector.rb
    451 index 35a028e..e6ec6dc 100644
    452 --- a/lib/sup/horizontal-selector.rb
    453 +++ b/lib/sup/horizontal-selector.rb
    454 @@ -1,7 +1,7 @@
    455  module Redwood
    456 
    457  class HorizontalSelector
    458 -  attr_accessor :label
    459 +  attr_accessor :label, :changed_by_user
    460 
    461    def initialize label, vals, labels,
    462 base_color=:horizontal_selector_unselected_color,
    463 selected_color=:horizontal_selector_selected_color
    464      @label = label
    465 @@ -10,6 +10,7 @@ class HorizontalSelector
    466      @base_color = base_color
    467      @selected_color = selected_color
    468      @selection = 0
    469 +    @changed_by_user = false
    470    end
    471 
    472    def set_to val; @selection = @vals.index(val) end
    473 @@ -37,10 +38,12 @@ class HorizontalSelector
    474 
    475    def roll_left
    476      @selection = (@selection - 1) % @labels.length
    477 +    @changed_by_user = true
    478    end
    479 
    480    def roll_right
    481      @selection = (@selection + 1) % @labels.length
    482 +    @changed_by_user = true
    483    end
    484  end
    485 
    486 
    487 
    488 
    489 
    490 
    491 commit 3cbccb471fc73b1593374ef8efea1a22ba237d89
    492 Author: Hamish Downer <dmishd at gmail.com>
    493 Date:   Wed Feb 9 18:58:30 2011 +0000
    494 
    495     Re-run the crypto selector hook after message changes.
    496 
    497     The crypto-selector hook will be re-run after the message is edited,
    498     or after the recipients change due to changing the "Reply to"
    499     selector in reply-mode. So when the recipients change, the default
    500     selector will also change.
    501 
    502     However, if the user has manually changed the crypto selector then the
    503     hook will not be re-run, so as to avoid over-riding the user's choice.
    504 
    505 diff --git a/lib/sup/modes/edit-message-mode.rb
    506 b/lib/sup/modes/edit-message-mode.rb
    507 index 734a879..6c2d61c 100644
    508 --- a/lib/sup/modes/edit-message-mode.rb
    509 +++ b/lib/sup/modes/edit-message-mode.rb
    510 @@ -179,6 +179,7 @@ EOS
    511      header, @body = parse_file @file.path
    512      @header = header - NON_EDITABLE_HEADERS
    513      handle_new_text @header, @body
    514 +    rerun_crypto_selector_hook
    515      update
    516 
    517      @edited
    518 @@ -215,6 +216,12 @@ EOS
    519 
    520  protected
    521 
    522 +  def rerun_crypto_selector_hook
    523 +    if @crypto_selector && !@crypto_selector.changed_by_user
    524 +      HookManager.run "crypto-mode", :header => @header, :body =>
    525 @body, :crypto_selector => @crypto_selector
    526 +    end
    527 +  end
    528 +
    529    def mime_encode string
    530      string = [string].pack('M') # basic quoted-printable
    531      string.gsub!(/=\n/,'')      # .. remove trailing newline
    532 diff --git a/lib/sup/modes/reply-mode.rb b/lib/sup/modes/reply-mode.rb
    533 index 079e4de..ccdf371 100644
    534 --- a/lib/sup/modes/reply-mode.rb
    535 +++ b/lib/sup/modes/reply-mode.rb
    536 @@ -165,6 +165,7 @@ protected
    537      if @headers[@type_selector.val] != self.header
    538        self.header = @headers[@type_selector.val]
    539        self.body = @bodies[@type_selector.val] unless @edited
    540 +      rerun_crypto_selector_hook
    541        update
    542      end
    543    end
    544 @@ -174,6 +175,7 @@ protected
    545      if @headers[@type_selector.val] != self.header
    546        self.header = @headers[@type_selector.val]
    547        self.body = @bodies[@type_selector.val] unless @edited
    548 +      rerun_crypto_selector_hook
    549        update
    550      end
    551    end
    552 
    553 From dmishd@gmail.com  Wed Feb  9 19:57:55 2011
    554 From: dmishd@gmail.com (Hamish D)
    555 Date: Thu, 10 Feb 2011 00:57:55 +0000
    556 Subject: [sup-devel] Improved GPG start up checks
    557 Message-ID: <AANLkTins1JXJbrOca0EL7AyYBCt3rXm6TumbMNOdSk8p@mail.gmail.com>
    558 
    559     Better gpg error checking.
    560 
    561     The crypto initialize code now checks for a number of common reasons
    562     for GPG not working, all related to the gpg-agent side of things. It
    563     will then give a reasonably friendly error message, helping diagnose
    564     why GPG is not working for you.
    565 
    566     In particular it will check whether the environment variable is set,
    567     whether the environment variable points to a file, and whether that
    568     file is a socket.
    569 
    570 
    571 On branch gpgme and next. Though this change also merged the improved
    572 rescue of NameError from the master branch to the gpgme branch, and
    573 the improved rescue was already on the next branch, so a quick manual
    574 merge was required to merge into next, and will presumably also be
    575 required to merge the gpgme stuff into master. I should probably start
    576 a new branch for further gpg improvements to save trouble down the
    577 road.
    578 
    579 Let me know if you want me to pick out commits for cherry-pick to get past this.
    580 
    581 Hamish Downer
    582 
    583 From dmishd@gmail.com  Thu Feb 10 18:26:29 2011
    584 From: dmishd@gmail.com (Hamish)
    585 Date: Thu, 10 Feb 2011 23:26:29 +0000
    586 Subject: [sup-devel] branching and merging
    587 Message-ID: <1297380057-sup-9005@whisper>
    588 
    589 Hello
    590 
    591 I'm wondering if there are preferred strategies for the feature branches. 
    592 I'm aware that new branches should be branched off master, and merged into
    593 next when the author thinks they're ready. But I'm wondering when a merge has 
    594 been done from a branch, should development continue on that branch?
    595 
    596 I've been working on the gpgme branch, even though a number of the earlier 
    597 commits on that branch have been merged into master. So I've been using git
    598 cherry-pick to merge later commits into next. Is that a reasonable way to go
    599 or should I be starting lots of little branches, or merging into next less
    600 often? Or does it just not make much difference to the maintainers and I 
    601 should do what works for me?
    602 
    603 Any opinions?
    604 
    605 Hamish
    606 
    607 From wmorgan-sup@masanjin.net  Thu Feb 10 19:01:17 2011
    608 From: wmorgan-sup@masanjin.net (William Morgan)
    609 Date: Fri, 11 Feb 2011 00:01:17 +0000
    610 Subject: [sup-devel] branching and merging
    611 In-Reply-To: <1297380057-sup-9005@whisper>
    612 References: <1297380057-sup-9005@whisper>
    613 Message-ID: <1297381879-sup-6069@masanjin.net>
    614 
    615 Reformatted excerpts from Hamish's message of 2011-02-10:
    616 > But I'm wondering when a merge has been done from a branch, should
    617 > development continue on that branch?
    618 
    619 If it's essentially more work on the same feature, then yes, continue on that
    620 branch. Otherwise, no. Branches are cheap.
    621 
    622 The point of a feature branch is that you can merge or not merge or revert it
    623 without touching other features. So that should be the deciding factor on
    624 whether to start a new feature branch: if I have to throw away, or if I have to
    625 revert this whole branch, will I be losing extra stuff?
    626 
    627 The other option is that if it's a long-running set of related and dependent
    628 features, you can also call it an integration branch, merge individual feature
    629 branches into it as necessary, and finally merge the whole thing into master in
    630 one go. I haven't been following the gpgme changes, but it sounds like maybe
    631 this is the case.
    632 -- 
    633 William <wmorgan-sup at masanjin.net>
    634 
    635 From sascha-pgp@silbe.org  Fri Feb 11 09:30:15 2011
    636 From: sascha-pgp@silbe.org (Sascha Silbe)
    637 Date: Fri, 11 Feb 2011 15:30:15 +0100
    638 Subject: [sup-devel] [PATCH] Delete messages from index if there is no
    639 	location left
    640 In-Reply-To: <1297428180-sup-8381@mail.univers-libre.net>
    641 References: <1297428180-sup-8381@mail.univers-libre.net>
    642 Message-ID: <1297434615-5101-1-git-send-email-sascha-pgp@silbe.org>
    643 
    644 If messages don't have any location, we cannot access their body and are also
    645 unable to restore them from a message state dump (written by sup-dump). So
    646 it's more consistent to the user if we remove them completely. This is
    647 most likely what the user expects anyway: why else would they delete the
    648 message from all locations?
    649 
    650 The drawback is that messages that were moved between sources need to be
    651 either scanned in a single sup-sync run or the new location must be scanned
    652 first. But that isn't a regression from behaviour before the maildir branch
    653 was merged.
    654 
    655 Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
    656 ---
    657 
    658 I've had this in my branch for quite some time now, but didn't have a
    659 a chance yet to thoroughly test it after rebasing on top of next (which
    660 made changes in the same area of the code, causing conflicts). Feel
    661 free to push to next and/or master once you verified it doesn't cause
    662 you to loose mails.
    663 
    664  bin/sup-sync     |    9 +++++++++
    665  lib/sup/index.rb |    9 +++++++++
    666  lib/sup/poll.rb  |    9 +++++++++
    667  3 files changed, 27 insertions(+), 0 deletions(-)
    668 
    669 diff --git a/bin/sup-sync b/bin/sup-sync
    670 index b4d5cba..c54359d 100755
    671 --- a/bin/sup-sync
    672 +++ b/bin/sup-sync
    673 @@ -115,6 +115,7 @@ def time
    674      end
    675    end
    676 
    677 +  deleted_message_ids = Set.new
    678    sources.each do |source|
    679      puts "Scanning #{source}..."
    680      num_added = num_updated = num_deleted = num_scanned = num_restored = 0
    681 @@ -124,9 +125,11 @@ def time
    682        num_scanned += 1
    683        if action == :delete
    684          num_deleted += 1
    685 +        deleted_message_ids.add m.id if m.locations.empty?
    686          puts "Deleting #{m.id}" if opts[:verbose]
    687        elsif action == :add
    688          seen[m.id] = true
    689 +        deleted_message_ids.delete(m.id)
    690 
    691          ## tweak source labels according to commandline arguments if necessary
    692          m.labels.delete :inbox if opts[:archive]
    693 @@ -190,6 +193,12 @@ def time
    694      puts "Restored state on #{num_restored} (#{100.0 * num_restored / num_scanned}%) messages." if num_restored > 0
    695    end
    696 
    697 +  puts "Deleting #{deleted_message_ids.size} messages from index."
    698 +  deleted_message_ids.each do |id|
    699 +    debug "Removing #{id} from index"
    700 +    index.remove_message_by_id id
    701 +  end
    702 +
    703    index.save
    704 
    705    if opts[:optimize]
    706 diff --git a/lib/sup/index.rb b/lib/sup/index.rb
    707 index 4ad91e7..7dcc7f9 100644
    708 --- a/lib/sup/index.rb
    709 +++ b/lib/sup/index.rb
    710 @@ -129,6 +129,7 @@ def load_index
    711    def add_message m; sync_message m, true end
    712    def update_message m; sync_message m, true end
    713    def update_message_state m; sync_message m, false end
    714 +  def remove_message_by_id id; delete_message id end
    715 
    716    def save_index
    717      info "Flushing Xapian updates to disk. This may take a while..."
    718 @@ -627,6 +628,14 @@ def build_xapian_query opts
    719      end
    720    end
    721 
    722 +  def delete_message id
    723 +    doc = synchronize { find_doc(id) }
    724 +    fail unless doc
    725 +    doc.clear_terms
    726 +    doc.clear_values
    727 +    synchronize { @xapian.delete_document doc.docid }
    728 +  end
    729 +
    730    def sync_message m, overwrite
    731      doc = synchronize { find_doc(m.id) }
    732      existed = doc != nil
    733 diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb
    734 index 7e05292..46ad441 100644
    735 --- a/lib/sup/poll.rb
    736 +++ b/lib/sup/poll.rb
    737 @@ -98,6 +98,7 @@ def do_poll
    738      from_and_subj = []
    739      from_and_subj_inbox = []
    740      loaded_labels = Set.new
    741 +    deleted_message_ids = Set.new
    742 
    743      @mutex.synchronize do
    744        @poll_sources.each do |source|
    745 @@ -112,9 +113,11 @@ def do_poll
    746          numi = 0
    747          poll_from source do |action,m,old_m,progress|
    748            if action == :delete
    749 +            deleted_message_ids.add m.id if m.locations.empty?
    750              yield "Deleting #{m.id}"
    751            elsif action == :add
    752              if old_m
    753 +              deleted_message_ids.delete(m.id)
    754                new_locations = (m.locations - old_m.locations)
    755                if not new_locations.empty?
    756                  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 * ','}"
    757 @@ -139,6 +142,12 @@ def do_poll
    758          total_numi += numi
    759        end
    760 
    761 +      yield "Deleting #{deleted_message_ids.size} messages from index."
    762 +      deleted_message_ids.each do |id|
    763 +        debug "Removing #{id} from index"
    764 +        Index.remove_message_by_id id
    765 +      end
    766 +
    767        loaded_labels = loaded_labels - LabelManager::HIDDEN_RESERVED_LABELS - [:inbox, :killed]
    768        yield "Done polling; loaded #{total_num} new messages total"
    769        @last_poll = Time.now
    770 --
    771 1.7.2.3
    772 
    773 
    774 From romain@univers-libre.net  Fri Feb 11 13:18:31 2011
    775 From: romain@univers-libre.net (Romain Dessort)
    776 Date: Fri, 11 Feb 2011 19:18:31 +0100
    777 Subject: [sup-devel] [PATCH] Delete messages from index if there is no
    778 	location left
    779 In-Reply-To: <1297434615-5101-1-git-send-email-sascha-pgp@silbe.org>
    780 References: <1297428180-sup-8381@mail.univers-libre.net>
    781 	<1297434615-5101-1-git-send-email-sascha-pgp@silbe.org>
    782 Message-ID: <1297447700-sup-8352@mail.univers-libre.net>
    783 
    784 Excerpts from Sascha Silbe's message of ven f?v 11 15:30:15 +0100 2011:
    785 > If messages don't have any location, we cannot access their body and are also
    786 > unable to restore them from a message state dump (written by sup-dump). So
    787 > it's more consistent to the user if we remove them completely. This is
    788 > most likely what the user expects anyway: why else would they delete the
    789 > message from all locations?
    790 
    791 Yes, I agree with you, this should be the normal behaviour.
    792 
    793 > I've had this in my branch for quite some time now, but didn't have a
    794 > a chance yet to thoroughly test it after rebasing on top of next (which
    795 > made changes in the same area of the code, causing conflicts). Feel
    796 > free to push to next and/or master once you verified it doesn't cause
    797 > you to loose mails.
    798 > 
    799 >  bin/sup-sync     |    9 +++++++++
    800 >  lib/sup/index.rb |    9 +++++++++
    801 >  lib/sup/poll.rb  |    9 +++++++++
    802 >  3 files changed, 27 insertions(+), 0 deletions(-)
    803 > [...]
    804 
    805 Thanks for this patch !
    806 I going to try to merge it with my current Sup version.
    807 -- 
    808 Romain Dessort
    809 Jabber ID : romain at univers-libre.net
    810 GnuPG : 3072D/724BC532
    811 
    812 From john.wyzer@gmx.de  Sat Feb 12 09:07:05 2011
    813 From: john.wyzer@gmx.de (John Wyzer)
    814 Date: Sat, 12 Feb 2011 15:07:05 +0100
    815 Subject: [sup-devel] [bug] trace: undefined method `mark_dirty' for
    816 	nil:NilClass
    817 Message-ID: <1297519607-sup-128@localhost>
    818 
    819 
    820 Hi.
    821 
    822 sup v0.12.1:
    823 Submitting it here since the bugtracker is down.
    824 
    825 I got this when I hit the "u" key after killing a thread.
    826 
    827 
    828 --- NoMethodError from thread: main
    829 undefined method `mark_dirty' for nil:NilClass
    830 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/line-cursor-mode.rb:68:in `set_cursor_pos'
    831 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:240:in `update'
    832 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:717:in `add_or_unhide'
    833 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:479:in `block (2 levels) in multi_kill'
    834 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:477:in `each'
    835 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:477:in `block in multi_kill'
    836 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/undo.rb:27:in `call'
    837 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/undo.rb:27:in `block in undo'
    838 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/undo.rb:27:in `each'
    839 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/undo.rb:27:in `undo'
    840 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/util.rb:609:in `method_missing'
    841 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:227:in `undo'
    842 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/mode.rb:59:in `handle_input'
    843 /var/lib/gems/1.9.1/gems/sup-0.12.1/lib/sup/buffer.rb:277:in `handle_input'
    844 /var/lib/gems/1.9.1/gems/sup-0.12.1/bin/sup:260:in `<module:Redwood>'
    845 /var/lib/gems/1.9.1/gems/sup-0.12.1/bin/sup:69:in `<top (required)>'
    846 /var/lib/gems/1.9.1/bin/sup:19:in `load'
    847 /var/lib/gems/1.9.1/bin/sup:19:in `<main>'
    848 -- 
    849 
    850 From john.wyzer@gmx.de  Sun Feb 13 07:08:50 2011
    851 From: john.wyzer@gmx.de (John Wyzer)
    852 Date: Sun, 13 Feb 2011 13:08:50 +0100
    853 Subject: [sup-devel] [bug] two more different traces: RuntimeError from
    854 	thread: poll after loading inbox
    855 Message-ID: <1297598759-sup-2911@localhost>
    856 
    857 sup 0.12.1. I experienced two more different exceptions while indexing was
    858 running in the background:
    859 
    860 
    861 ----------------------------------------------------------------
    862 --- NoMethodError from thread: poll after loading inbox
    863 undefined method `content_width' for nil:NilClass
    864 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:921:in `from_width'
    865 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:840:in `text_for_thread_at'
    866 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/index.rb:537:in `each_with_index'
    867 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:839:in `each'
    868 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:839:in `each_with_index'
    869 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:839:in `text_for_thread_at'
    870 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:781:in `regen_text'
    871 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:444:in `map_with_index'
    872 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/index.rb:537:in `each_with_index'
    873 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:444:in `each'
    874 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:444:in `each_with_index'
    875 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:444:in `map_with_index'
    876 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:781:in `regen_text'
    877 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:242:in `update'
    878 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:717:in `add_or_unhide'
    879 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:196:in `handle_added_update'
    880 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/update.rb:26:in `send'
    881 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/update.rb:26:in `relay'
    882 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/update.rb:26:in `each'
    883 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/update.rb:26:in `relay'
    884 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `send'
    885 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `method_missing'
    886 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:175:in `poll_from'
    887 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:106:in `poll'
    888 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/hook.rb:128:in `each_with_index'
    889 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:105:in `each'
    890 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:105:in `each_with_index'
    891 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:105:in `poll'
    892 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:90:in `each'
    893 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:90:in `poll'
    894 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:155:in `poll_from'
    895 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:113:in `do_poll'
    896 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:103:in `each'
    897 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:103:in `do_poll'
    898 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:102:in `synchronize'
    899 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb
    900 
    901 :102:in `do_poll'
    902 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `send'
    903 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `method_missing'
    904 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/poll-mode.rb:15:in `poll'
    905 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:49:in `poll_with_sources'
    906 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:68:in `poll'
    907 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `send'
    908 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `method_missing'
    909 /var/lib/gems/1.8/gems/sup-0.12.1/bin/sup:212
    910 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:78:in `reporting_thread'
    911 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:76:in `initialize'
    912 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:76:in `new'
    913 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:76:in `reporting_thread'
    914 /var/lib/gems/1.8/gems/sup-0.12.1/bin/sup:212
    915 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:684:in `call'
    916 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:684
    917 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:625:in `call'
    918 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:625:in `load_n_threads_background'
    919 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:78:in `reporting_thread'
    920 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:76:in `initialize'
    921 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:76:in `new'
    922 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:76:in `reporting_thread'
    923 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:623:in `load_n_threads_background'
    924 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:694:in `__unprotected_load_threads'
    925 (eval):12:in `load_threads'
    926 /var/lib/gems/1.8/gems/sup-0.12.1/bin/sup:212
    927 /var/lib/gems/1.8/bin/sup:19:in `load'
    928 /var/lib/gems/1.8/bin/sup:19
    929 
    930 
    931 
    932 --- RuntimeError from thread: poll after loading inbox
    933 unknown drawable object: nil in #<Redwood::InboxMode:0xf673c764> for line 37
    934 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/scroll-mode.rb:200:in `draw_line'
    935 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/line-cursor-mode.rb:52:in `draw_line'
    936 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/scroll-mode.rb:48:in `draw'
    937 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/scroll-mode.rb:48:in `each'
    938 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/scroll-mode.rb:48:in `draw'
    939 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/line-cursor-mode.rb:37:in `draw'
    940 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/buffer.rb:119:in `draw'
    941 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/buffer.rb:103:in `redraw'
    942 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/buffer.rb:339:in `draw_screen'
    943 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `send'
    944 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `method_missing'
    945 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:197:in `handle_added_update'
    946 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/update.rb:26:in `send'
    947 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/update.rb:26:in `relay'
    948 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/update.rb:26:in `each'
    949 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/update.rb:26:in `relay'
    950 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `send'
    951 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `method_missing'
    952 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:175:in `poll_from'
    953 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:106:in `poll'
    954 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/hook.rb:128:in `each_with_index'
    955 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:105:in `each'
    956 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:105:in `each_with_index'
    957 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:105:in `poll'
    958 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:90:in `each'
    959 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/maildir.rb:90:in `poll'
    960 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:155:in `poll_from'
    961 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:113:in `do_poll'
    962 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:103:in `each'
    963 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:103:in `do_poll'
    964 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:102:in `synchronize'
    965 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:102:in `do_poll'
    966 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `send'
    967 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `method_missing'
    968 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/poll-mode.rb:15:in `poll'
    969 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:49:in `poll_with_sources'
    970 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/poll.rb:68:in `poll'
    971 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `send'
    972 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/util.rb:609:in `method_missing'
    973 /var/lib/gems/1.8/gems/sup-0.12.1/bin/sup:212
    974 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:78:in `reporting_thread'
    975 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:76:in `initialize'
    976 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:76:in `new'
    977 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:76:in `reporting_thread'
    978 /var/lib/gems/1.8/gems/sup-0.12.1/bin/sup:212
    979 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:684:in `call'
    980 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:684
    981 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:625:in `call'
    982 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:625:in `load_n_threads_background'
    983 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:78:in `reporting_thread'
    984 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:76:in `initialize'
    985 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:76:in `new'
    986 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup.rb:76:in `reporting_thread'
    987 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:623:in `load_n_threads_background'
    988 /var/lib/gems/1.8/gems/sup-0.12.1/lib/sup/modes/thread-index-mode.rb:694:in `__unprotected_load_threads'
    989 (eval):12:in `load_threads'
    990 /var/lib/gems/1.8/gems/sup-0.12.1/bin/sup:212
    991 /var/lib/gems/1.8/bin/sup:19:in `load'
    992 /var/lib/gems/1.8/bin/sup:19
    993 
    994 
    995 -- 
    996 
    997 From rlane@club.cc.cmu.edu  Sun Feb 13 13:05:40 2011
    998 From: rlane@club.cc.cmu.edu (Rich Lane)
    999 Date: Sun, 13 Feb 2011 13:05:40 -0500
   1000 Subject: [sup-devel] new branch: keybindings
   1001 In-Reply-To: <1297152370-sup-4647@qwerzila>
   1002 References: <1296187729-sup-7405@zyrg.net> <1297152028-sup-5512@qwerzila>
   1003 	<1297152370-sup-4647@qwerzila>
   1004 Message-ID: <1297620229-sup-1485@zyrg.net>
   1005 
   1006 Excerpts from Gaute Hope's message of 2011-02-08 03:07:31 -0500:
   1007 > Excerpts from Gaute Hope's message of 2011-02-08 09:01:44 +0100:
   1008 > > Excerpts from Rich Lane's message of 2011-01-28 05:26:38 +0100:
   1009 > > Could it be that this broke continue buffer search key 'n' ?
   1010 > > 
   1011 > > lib/sup/buffer.rb:171
   1012 > > 
   1013 > > This doesn't work for me anymore, could anyone confirm that?
   1014 > 
   1015 > Ah - I just noticed that I have to move down one line before I can hit
   1016 > 'n' to search for the next occurrence. I don't think this was the
   1017 > original, or desired, behaviour?
   1018 
   1019 I did a git bisect and had to stop at the last index format change in
   1020 May 2010. It looks like 'n' has been broken for a long time.
   1021 
   1022 From sup@zevv.nl  Sun Feb 13 14:13:10 2011
   1023 From: sup@zevv.nl (Ico Doornekamp)
   1024 Date: Sun, 13 Feb 2011 20:13:10 +0100
   1025 Subject: [sup-devel] Sup crash when trying to view full headers on deleted
   1026 	message.
   1027 Message-ID: <1297624152-sup-1543@pruts.nl>
   1028 
   1029 The patch below avoids a crash when opening a full header view on deleted messages.
   1030 
   1031 ---
   1032  lib/sup/message.rb |    6 +++++-
   1033  1 files changed, 5 insertions(+), 1 deletions(-)
   1034 
   1035 diff --git a/lib/sup/message.rb b/lib/sup/message.rb
   1036 index 832716e..b8d066d 100644
   1037 --- a/lib/sup/message.rb
   1038 +++ b/lib/sup/message.rb
   1039 @@ -274,7 +274,11 @@ EOS
   1040    end
   1041 
   1042    def raw_header
   1043 -    location.raw_header
   1044 +    begin
   1045 +      location.raw_header
   1046 +    rescue OutOfSyncSourceError => e
   1047 +      error_message
   1048 +    end
   1049    end
   1050 
   1051    def raw_message
   1052 --
   1053 1.7.0.4
   1054 
   1055 
   1056 -- 
   1057 :wq
   1058 ^X^Cy^K^X^C^C^C^C
   1059 
   1060 From gaudenz@soziologie.ch  Thu Feb 17 09:42:58 2011
   1061 From: gaudenz@soziologie.ch (Gaudenz Steinlin)
   1062 Date: Thu, 17 Feb 2011 15:42:58 +0100
   1063 Subject: [sup-devel] Encoding of message snippet in xapian
   1064 In-Reply-To: <1297286134-sup-7498@meteor.durcheinandertal.local>
   1065 References: <1297286134-sup-7498@meteor.durcheinandertal.local>
   1066 Message-ID: <1297953544-sup-6116@meteor.durcheinandertal.local>
   1067 
   1068 HI
   1069 
   1070 Excerpts from Gaudenz Steinlin's message of 2011-02-09 22:27:13 +0100:
   1071 > Hi 
   1072 > 
   1073 > While debuging the trackeback posted below I discovered that my xapian
   1074 > index contains some of the message snippets in ASCII-8BIT and others
   1075 > in UTF-8. This leads to probelems when building the thread-view for
   1076 > collapsed messages for messages wich have non 7-bit ASCII characters
   1077 > in their snippet. message_patina_lines combines the snippet which
   1078 > comes from the xapian index and is (sometimes) in ASCII-8BIT with
   1079 > other parts of the message which are in UTF-8.
   1080 > 
   1081 > I don't know exactly how I ended up with a xapian index which has some
   1082 > strings in ASCII-8BIT and others in UTF-8. I guess it's because I
   1083 > first used sup with Ruby 1.8 and only recently switched to Ruby 1.9.1.
   1084 > What's the expected encoding of things coming from the xapian index?
   1085 > Is there a way to fix the index? Or is a fix in sup needed for this?
   1086 > Or should I just recreate my index from scratch?
   1087 > 
   1088 > Running sup with Ruby 1.8 avoids the problem. But I guess it only
   1089 > masks it because 1.8 is not encoding aware.
   1090 
   1091 Just for the record. I solved the issue by dumping all labels and
   1092 recreating the index with ruby 1.9. That's what I did:
   1093 sup-dump > label-dump.txt
   1094 rm -r ~/.sup/xapian
   1095 sup-sync --restore label-dump.txt --all-sources
   1096 
   1097 While reimporting all my messages I discovered a few message parsing
   1098 bugs and some bugs related to GPGME. I created patches for all these
   1099 problems and will submit these in separate mails.
   1100 
   1101 Gaudenz
   1102 
   1103 > 
   1104 > Gaudenz
   1105 > 
   1106 > --- Encoding::CompatibilityError from thread: load messages for thread-view-mode
   1107 > incompatible character encodings: UTF-8 and ASCII-8BIT
   1108 > /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:792:in `message_patina_lines'
   1109 > /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:853:in `chunk_to_lines'
   1110 > /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:724:in `block in regen_text'
   1111 > /home/gaudenz/projects/sup/lib/sup/thread.rb:68:in `block in each'
   1112 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
   1113 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
   1114 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
   1115 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
   1116 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
   1117 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
   1118 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
   1119 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
   1120 > /home/gaudenz/projects/sup/lib/sup/thread.rb:174:in `each_with_stuff'
   1121 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
   1122 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
   1123 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
   1124 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
   1125 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
   1126 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
   1127 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
   1128 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
   1129 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
   1130 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
   1131 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
   1132 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
   1133 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
   1134 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
   1135 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
   1136 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
   1137 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
   1138 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
   1139 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
   1140 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
   1141 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
   1142 > /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
   1143 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
   1144 > /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
   1145 > /home/gaudenz/projects/sup/lib/sup/thread.rb:67:in `each'
   1146 > /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:713:in `regen_text'
   1147 > /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:175:in `buffer='
   1148 > /home/gaudenz/projects/sup/lib/sup/buffer.rb:387:in `spawn'
   1149 > (eval):1:in `spawn'
   1150 > /home/gaudenz/projects/sup/lib/sup/modes/thread-index-mode.rb:120:in `block in select'
   1151 > /home/gaudenz/projects/sup/lib/sup.rb:78:in `block in reporting_thread'
   1152 -- 
   1153 Ever tried. Ever failed. No matter.
   1154 Try again. Fail again. Fail better.
   1155 ~ Samuel Beckett ~
   1156 -------------- next part --------------
   1157 A non-text attachment was scrubbed...
   1158 Name: signature.asc
   1159 Type: application/pgp-signature
   1160 Size: 482 bytes
   1161 Desc: not available
   1162 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110217/24cbc4cf/attachment.bin>
   1163 
   1164 From gaudenz@soziologie.ch  Thu Feb 17 09:44:49 2011
   1165 From: gaudenz@soziologie.ch (Gaudenz Steinlin)
   1166 Date: Thu, 17 Feb 2011 15:44:49 +0100
   1167 Subject: [sup-devel] Message parsing fixes
   1168 Message-ID: <1297953809-sup-575@meteor.durcheinandertal.local>
   1169 
   1170 Hi
   1171 
   1172 While reimporting all my messages to recreate the index I fixed a few
   1173 message parsing issues. Please consider the attached patches against
   1174 master.
   1175 
   1176 Gaudenz
   1177 
   1178 -- 
   1179 Ever tried. Ever failed. No matter.
   1180 Try again. Fail again. Fail better.
   1181 ~ Samuel Beckett ~
   1182 -------------- next part --------------
   1183 A non-text attachment was scrubbed...
   1184 Name: 0001-Don-t-normalize_whitespace-message-rfc822-parts.patch
   1185 Type: application/octet-stream
   1186 Size: 1132 bytes
   1187 Desc: not available
   1188 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110217/8e544a76/attachment.obj>
   1189 -------------- next part --------------
   1190 A non-text attachment was scrubbed...
   1191 Name: 0002-Be-more-cautious-about-invalid-content-type-headers.patch
   1192 Type: application/octet-stream
   1193 Size: 1526 bytes
   1194 Desc: not available
   1195 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110217/8e544a76/attachment-0001.obj>
   1196 -------------- next part --------------
   1197 A non-text attachment was scrubbed...
   1198 Name: signature.asc
   1199 Type: application/pgp-signature
   1200 Size: 482 bytes
   1201 Desc: not available
   1202 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110217/8e544a76/attachment.bin>
   1203 
   1204 From gaudenz@soziologie.ch  Thu Feb 17 09:49:01 2011
   1205 From: gaudenz@soziologie.ch (Gaudenz Steinlin)
   1206 Date: Thu, 17 Feb 2011 15:49:01 +0100
   1207 Subject: [sup-devel] GPGME fixes
   1208 Message-ID: <1297953902-sup-8049@meteor.durcheinandertal.local>
   1209 
   1210 Hi
   1211 
   1212 While reimporting all my messages I encountered a few problemes with
   1213 the GPGME code. Please consider the attached fixes.
   1214 
   1215 The second patch depends on the first (error message unification). But
   1216 if you don't like the first I can easily produce a standalone version.
   1217 
   1218 Gaudenz
   1219 
   1220 -- 
   1221 Ever tried. Ever failed. No matter.
   1222 Try again. Fail again. Fail better.
   1223 ~ Samuel Beckett ~
   1224 -------------- next part --------------
   1225 A non-text attachment was scrubbed...
   1226 Name: 0001-Encode-multipart-messages-for-crypt-operations.patch
   1227 Type: application/octet-stream
   1228 Size: 2180 bytes
   1229 Desc: not available
   1230 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110217/ce79eb0a/attachment-0004.obj>
   1231 -------------- next part --------------
   1232 A non-text attachment was scrubbed...
   1233 Name: 0001-Unify-formatting-of-GPGME-error-messages.patch
   1234 Type: application/octet-stream
   1235 Size: 2413 bytes
   1236 Desc: not available
   1237 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110217/ce79eb0a/attachment-0005.obj>
   1238 -------------- next part --------------
   1239 A non-text attachment was scrubbed...
   1240 Name: 0002-Check-for-ArgumentError-on-signature-verification.patch
   1241 Type: application/octet-stream
   1242 Size: 1614 bytes
   1243 Desc: not available
   1244 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110217/ce79eb0a/attachment-0006.obj>
   1245 -------------- next part --------------
   1246 A non-text attachment was scrubbed...
   1247 Name: 0003-Check-for-valid-signature-before-signature.to_s.patch
   1248 Type: application/octet-stream
   1249 Size: 1290 bytes
   1250 Desc: not available
   1251 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110217/ce79eb0a/attachment-0007.obj>
   1252 -------------- next part --------------
   1253 A non-text attachment was scrubbed...
   1254 Name: signature.asc
   1255 Type: application/pgp-signature
   1256 Size: 482 bytes
   1257 Desc: not available
   1258 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110217/ce79eb0a/attachment-0001.bin>
   1259 
   1260 From dmishd@gmail.com  Thu Feb 17 13:45:20 2011
   1261 From: dmishd@gmail.com (Hamish D)
   1262 Date: Thu, 17 Feb 2011 18:45:20 +0000
   1263 Subject: [sup-devel] GPGME fixes
   1264 In-Reply-To: <1297953902-sup-8049@meteor.durcheinandertal.local>
   1265 References: <1297953902-sup-8049@meteor.durcheinandertal.local>
   1266 Message-ID: <AANLkTin_eTz=qprMhm3v4nfpuhSk55VmCgmeHKht4EAH@mail.gmail.com>
   1267 
   1268 > While reimporting all my messages I encountered a few problemes with
   1269 > the GPGME code. Please consider the attached fixes.
   1270 
   1271 0001-Encode-multipart-messages-for-crypt-operations.patch already
   1272 appears to be in master ...
   1273 
   1274 I like the others though, though in applying them I ran into some
   1275 trouble, partly through my adding lines near the top of the file that
   1276 change line numbers and seemed to confuse git. So they are now applied
   1277 to a local copy, but in my name (but with your commit messages).
   1278 
   1279 I imagine you would like them to be in your name, so I have not pushed
   1280 them yet. If anyone could tell me how I should be applying them
   1281 properly then I will do. And maybe it might be necessary to format the
   1282 patches with options that give more context.
   1283 
   1284 I'm hoping someone with more git knowledge than me can help ...
   1285 
   1286 Hamish
   1287 
   1288 From gaudenz@soziologie.ch  Thu Feb 17 15:44:08 2011
   1289 From: gaudenz@soziologie.ch (Gaudenz Steinlin)
   1290 Date: Thu, 17 Feb 2011 21:44:08 +0100
   1291 Subject: [sup-devel] GPGME fixes
   1292 In-Reply-To: <AANLkTin_eTz=qprMhm3v4nfpuhSk55VmCgmeHKht4EAH@mail.gmail.com>
   1293 References: <1297953902-sup-8049@meteor.durcheinandertal.local>
   1294 	<AANLkTin_eTz=qprMhm3v4nfpuhSk55VmCgmeHKht4EAH@mail.gmail.com>
   1295 Message-ID: <1297974845-sup-4146@meteor.durcheinandertal.local>
   1296 
   1297 Excerpts from Hamish D's message of 2011-02-17 19:45:20 +0100:
   1298 > > While reimporting all my messages I encountered a few problemes with
   1299 > > the GPGME code. Please consider the attached fixes.
   1300 > 
   1301 > 0001-Encode-multipart-messages-for-crypt-operations.patch already
   1302 > appears to be in master ...
   1303 
   1304 Yes this one belongs to another patch serie already submitted earlier.
   1305 Sorry.
   1306 
   1307 > 
   1308 > I like the others though, though in applying them I ran into some
   1309 > trouble, partly through my adding lines near the top of the file that
   1310 > change line numbers and seemed to confuse git. So they are now applied
   1311 > to a local copy, but in my name (but with your commit messages).
   1312 > 
   1313 > I imagine you would like them to be in your name, so I have not pushed
   1314 > them yet. If anyone could tell me how I should be applying them
   1315 > properly then I will do. And maybe it might be necessary to format the
   1316 > patches with options that give more context.
   1317 > 
   1318 > I'm hoping someone with more git knowledge than me can help ...
   1319 
   1320 What command do you use to apply the patches? If I can fetch your
   1321 changes somewhere I can also rebase my patches on top of them.
   1322 
   1323 Gaudenz
   1324 -- 
   1325 Ever tried. Ever failed. No matter.
   1326 Try again. Fail again. Fail better.
   1327 ~ Samuel Beckett ~
   1328 -------------- next part --------------
   1329 A non-text attachment was scrubbed...
   1330 Name: signature.asc
   1331 Type: application/pgp-signature
   1332 Size: 482 bytes
   1333 Desc: not available
   1334 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110217/a3fd1817/attachment.bin>
   1335 
   1336 From dmishd@gmail.com  Thu Feb 17 17:57:42 2011
   1337 From: dmishd@gmail.com (Hamish D)
   1338 Date: Thu, 17 Feb 2011 22:57:42 +0000
   1339 Subject: [sup-devel] GPGME fixes
   1340 In-Reply-To: <1297974845-sup-4146@meteor.durcheinandertal.local>
   1341 References: <1297953902-sup-8049@meteor.durcheinandertal.local>
   1342 	<AANLkTin_eTz=qprMhm3v4nfpuhSk55VmCgmeHKht4EAH@mail.gmail.com>
   1343 	<1297974845-sup-4146@meteor.durcheinandertal.local>
   1344 Message-ID: <AANLkTikdMASiPmP6DFBpdAFNzK+w11Wf0Qq07MK1FsL8@mail.gmail.com>
   1345 
   1346 >> I like the others though, though in applying them I ran into some
   1347 >> trouble, partly through my adding lines near the top of the file that
   1348 >> change line numbers and seemed to confuse git. So they are now applied
   1349 >> to a local copy, but in my name (but with your commit messages).
   1350 >
   1351 > What command do you use to apply the patches? If I can fetch your
   1352 > changes somewhere I can also rebase my patches on top of them.
   1353 
   1354 My changes are on the gpgme branch on gitorious. I used the git apply
   1355 command. I also tried git am but that did't work at all.
   1356 
   1357 Hamish
   1358 
   1359 From dmishd@gmail.com  Sun Feb 20 14:19:17 2011
   1360 From: dmishd@gmail.com (Hamish)
   1361 Date: Sun, 20 Feb 2011 19:19:17 +0000
   1362 Subject: [sup-devel] Need help applying patches
   1363 Message-ID: <1298228733-sup-6115@whisper>
   1364 
   1365 Gaudenz has submitted a few useful patches which I want to commit to the
   1366 gpgme branch, but git apply seems to fail. I've forwarded the message
   1367 text below, and attached the patches. When I apply it gpgme, I get:
   1368 
   1369 
   1370 $ git apply --check --verbose ../patches2merge/0001-Unify-formatting-of-GPGME-error-messages.patch
   1371 Checking patch lib/sup/crypto.rb...
   1372 error: while searching for:
   1373     begin
   1374       sig = GPGME.detach_sign(format_payload(payload), gpg_opts)
   1375     rescue GPGME::Error => exc
   1376       info "Error while running gpg: #{exc.message}"
   1377       raise Error, "GPG command failed. See log for details."
   1378     end
   1379 
   1380     envelope = RMail::Message.new
   1381 
   1382 error: patch failed: lib/sup/crypto.rb:75
   1383 error: lib/sup/crypto.rb: patch does not apply
   1384 
   1385 
   1386 But I can't see why it could not find it. The code quoted above has
   1387 moved down by 31 lines, but is otherwise unchanged, but I thought git
   1388 could cope with that :/
   1389 
   1390 I tried hand-editing the patch to change the line numbers, but I still
   1391 get the same error. Am I missing a trick? I've checked the file formats
   1392 and both have unix-style line endings.
   1393 
   1394 I have tried and I can apply these patches by hand, but then they will
   1395 appear as committed by me, rather than giving Gaudenz his due.
   1396 
   1397 Do others have the same problem? You could try by checking out the gpgme
   1398 branch and trying git apply.
   1399 
   1400 I've also tried git am on a directory with these 3 attachments in:
   1401 
   1402 
   1403 $ git am -s ../patches2merge/
   1404 Nothing to do.
   1405 
   1406 
   1407 Not very helpful. Any help appreciated.
   1408 
   1409 Hamish Downer
   1410 
   1411 
   1412 PS I am using git 1.7.1 on Ubuntu 10.10 x86_64 
   1413 
   1414 
   1415 --- Begin forwarded message from Gaudenz Steinlin ---
   1416 From: Gaudenz Steinlin <gaudenz at soziologie.ch>
   1417 To: sup-devel <sup-devel at rubyforge.org>
   1418 Date: Thu, 17 Feb 2011 14:49:01 +0000
   1419 Subject: [sup-devel] GPGME fixes
   1420 
   1421 Hi
   1422 
   1423 While reimporting all my messages I encountered a few problemes with
   1424 the GPGME code. Please consider the attached fixes.
   1425 
   1426 The second patch depends on the first (error message unification). But
   1427 if you don't like the first I can easily produce a standalone version.
   1428 
   1429 Gaudenz
   1430 
   1431 --- End forwarded message ---
   1432 -------------- next part --------------
   1433 A non-text attachment was scrubbed...
   1434 Name: 0003-Check-for-valid-signature-before-signature.to_s.patch
   1435 Type: application/octet-stream
   1436 Size: 1290 bytes
   1437 Desc: not available
   1438 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110220/c1b71b53/attachment.obj>
   1439 -------------- next part --------------
   1440 A non-text attachment was scrubbed...
   1441 Name: 0002-Check-for-ArgumentError-on-signature-verification.patch
   1442 Type: application/octet-stream
   1443 Size: 1614 bytes
   1444 Desc: not available
   1445 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110220/c1b71b53/attachment-0001.obj>
   1446 -------------- next part --------------
   1447 A non-text attachment was scrubbed...
   1448 Name: 0001-Unify-formatting-of-GPGME-error-messages.patch
   1449 Type: application/octet-stream
   1450 Size: 2413 bytes
   1451 Desc: not available
   1452 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110220/c1b71b53/attachment-0002.obj>
   1453 
   1454 From dmishd@gmail.com  Sun Feb 20 14:55:33 2011
   1455 From: dmishd@gmail.com (Hamish)
   1456 Date: Sun, 20 Feb 2011 19:55:33 +0000
   1457 Subject: [sup-devel] Need help applying patches
   1458 In-Reply-To: <1298228733-sup-6115@whisper>
   1459 References: <1298228733-sup-6115@whisper>
   1460 Message-ID: <1298230750-sup-6418@whisper>
   1461 
   1462 Excerpts from Hamish's message of Sun Feb 20 19:19:17 +0000 2011:
   1463 > Gaudenz has submitted a few useful patches which I want to commit to the
   1464 > gpgme branch, but git apply seems to fail. I've forwarded the message
   1465 > text below, and attached the patches. When I apply it gpgme, I get:
   1466 
   1467 Of course, having just written an email describing my problem, I do a
   1468 little more playing about and manage to find a way through. To record
   1469 what I did:
   1470 
   1471 $ cat ../patches2merge/0001-Unify-formatting-of-GPGME-error-messages.patch | git am -s -3
   1472 $ vim lib/sup/crypto.rb
   1473 $ git add lib/sup/crypto.rb
   1474 $ git am -3 --resolved
   1475 
   1476 Rinse and repeat for the other 2 patches. And now the log looks like I
   1477 expect it to. 
   1478 
   1479 I ran into some more issues merging this into next - my usual
   1480 cherry-pick method led to the same problems as originally, and led to me
   1481 being listed as the committer, but I managed to do a git merge which 
   1482 preserved the commit messages from Gaudenz (although a couple of mine
   1483 appear to be repeated).
   1484 
   1485 If there is some better way to do this in future, please tell me.
   1486 
   1487 Hamish
   1488 
   1489 From michael@content-space.de  Sun Feb 20 15:12:50 2011
   1490 From: michael@content-space.de (Michael Hamann)
   1491 Date: Sun, 20 Feb 2011 21:12:50 +0100
   1492 Subject: [sup-devel] Need help applying patches
   1493 In-Reply-To: <1298228733-sup-6115@whisper>
   1494 References: <1298228733-sup-6115@whisper>
   1495 Message-ID: <1298232315-sup-3221@mithink>
   1496 
   1497 Hi,
   1498 
   1499 Excerpts from Hamish's message of 2011-02-20 20:19:17 +0100:
   1500 [...]
   1501 > I have tried and I can apply these patches by hand, but then they will
   1502 > appear as committed by me, rather than giving Gaudenz his due.
   1503 
   1504 You can use git commit --author="Name <example at example.com>", then you
   1505 are recorded as committer and the author you supply is recorded as
   1506 author of the change.
   1507 
   1508 Michael Hamann
   1509 
   1510 From wmorgan-sup@masanjin.net  Sun Feb 20 16:58:13 2011
   1511 From: wmorgan-sup@masanjin.net (William Morgan)
   1512 Date: Sun, 20 Feb 2011 21:58:13 +0000
   1513 Subject: [sup-devel] Need help applying patches
   1514 In-Reply-To: <1298228733-sup-6115@whisper>
   1515 References: <1298228733-sup-6115@whisper>
   1516 Message-ID: <1298238906-sup-3941@masanjin.net>
   1517 
   1518 Reformatted excerpts from Hamish's message of 2011-02-20:
   1519 > But I can't see why it could not find it. The code quoted above has
   1520 > moved down by 31 lines, but is otherwise unchanged, but I thought git
   1521 > could cope with that :/
   1522 
   1523 Git apply is a pretty low-level command and I believe it acts basically like
   1524 the patch command, i.e. fails fast if things aren't perfectly in tune.
   1525 
   1526 To pull in the git merge logic on patch files, use `git am -3`.
   1527 
   1528 > $ git am -s ../patches2merge/
   1529 > Nothing to do.
   1530 
   1531 I think it's trying to interpret that directory as a maildir. Give it the
   1532 individual files.
   1533 -- 
   1534 William <wmorgan-sup at masanjin.net>
   1535 
   1536 From dmishd@gmail.com  Sun Feb 20 17:02:54 2011
   1537 From: dmishd@gmail.com (Hamish)
   1538 Date: Sun, 20 Feb 2011 22:02:54 +0000
   1539 Subject: [sup-devel] editing messages outside of sup
   1540 Message-ID: <1298239068-sup-6985@whisper>
   1541 
   1542 Hello
   1543 
   1544 It is often useful to be able to look at messages while writing a message.
   1545 While I can exit my editor and look at other messages, and then come back to 
   1546 my editor, it would be nice to have both open at the same time. So I've
   1547 written some code that allows you to do that. When you are in
   1548 compose-mode/reply-mode/etc you can press 'E' and it will transform into
   1549 a buffer showing a file path of the file to edit, and a key to press ('E'
   1550 again) to say you've finished.
   1551 
   1552 So you can open the file in another editor, whether on your desktop, in 
   1553 another terminal, in a screen session split so you can see both, or whatever.
   1554 While editing you can still navigate around sup's buffers and copy text,
   1555 email addresses etc into your editor and so on.
   1556 
   1557 Then when you're done, you can exit the editor, navigate back to the edit
   1558 buffer and press 'E' to go back to normal edit-message-mode and carry on as
   1559 normal. 
   1560 
   1561 As part of this, I've created a way to hide the original buffer. I think
   1562 I handle buffer killing properly in the various states (file still being
   1563 edited, file saved etc), but someone will doubtless find an edge case
   1564 ...
   1565 
   1566 For the moment this work is in the async_message_edit branch. If no one
   1567 shouts about this being a terrible idea then I'll merge it into next
   1568 within a week.
   1569 
   1570 Hamish Downer
   1571 
   1572 From dmishd@gmail.com  Sun Feb 20 20:22:41 2011
   1573 From: dmishd@gmail.com (Hamish)
   1574 Date: Mon, 21 Feb 2011 01:22:41 +0000
   1575 Subject: [sup-devel] [sup-talk] Label Display; Sorting Alphabetically
   1576 In-Reply-To: <1297863023-sup-4209@plc.intranet.plecavalier.com>
   1577 References: <1297784079-sup-7440@plc.intranet.plecavalier.com>
   1578 	<1297847031-sup-6835@tilus.net>
   1579 	<1297863023-sup-4209@plc.intranet.plecavalier.com>
   1580 Message-ID: <1298250926-sup-5020@whisper>
   1581 
   1582 Excerpts from Philippe LeCavalier's message of Wed Feb 16 13:33:32 +0000 2011:
   1583 > > Philippe LeCavalier, 2011-02-15 17:37:
   1584 > > > Hi All. Just wondering if there has ever been any consideration to
   1585 > > > sorting labels alphabetically. I'm assuming the way sup displays the
   1586 > > > labels is purely esthetic's?
   1587 > > 
   1588 > > I assume you are talking about thread index mode.
   1589 > No. Any mode really. Even in search mode they're random.
   1590 
   1591 No longer! I've published a branch called order_labels that will fix
   1592 this, both in the various thread index modes, and when editing the
   1593 labels for a message. Diffs at the end of the email for your viewing
   1594 pleasure ...
   1595 
   1596 I'll merge this into next when I'm a bit more awake - been up a bit long
   1597 ...
   1598 
   1599 Hamish Downer
   1600 
   1601 
   1602 
   1603 commit 1ae7c0a1e5b20681ea6ecb9a6bf15fffa5f4c0e3
   1604 Author: Hamish Downer <dmishd at gmail.com>
   1605 Date:   Sun Feb 20 22:57:47 2011 +0000
   1606 
   1607     Order labels alphabetically in thread index mode
   1608 
   1609 diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
   1610 index 11548c7..36d6db3 100644
   1611 --- a/lib/sup/modes/thread-index-mode.rb
   1612 +++ b/lib/sup/modes/thread-index-mode.rb
   1613 @@ -893,7 +893,7 @@ protected
   1614        [:to_me_color, t.labels.member?(:attachment) ? "@" : " "],
   1615        [:to_me_color, dp ? ">" : (p ? '+' : " ")],
   1616      ] +
   1617 -      (t.labels - @hidden_labels).map { |label| [:label_color, "#{label} "] } +
   1618 +      (t.labels - @hidden_labels).sort_by {|x| x.to_s}.map { |label| [:label_color, "#{label} "] } +
   1619        [
   1620        [subj_color, t.subj + (t.subj.empty? ? "" : " ")],
   1621        [:snippet_color, t.snippet],
   1622 
   1623 
   1624 
   1625 
   1626 commit 490e57254c5ee493e8acf4b8358b54e7eb3ab698
   1627 Author: Hamish Downer <dmishd at gmail.com>
   1628 Date:   Sun Feb 20 23:22:05 2011 +0000
   1629 
   1630     When editing labels, they are presented in alphabetical order
   1631 
   1632 diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
   1633 index 36d6db3..613aa61 100644
   1634 --- a/lib/sup/modes/thread-index-mode.rb
   1635 +++ b/lib/sup/modes/thread-index-mode.rb
   1636 @@ -542,7 +542,7 @@ EOS
   1637  
   1638      keepl, modifyl = thread.labels.partition { |t| speciall.member? t }
   1639  
   1640 -    user_labels = BufferManager.ask_for_labels :label, "Labels for thread: ", modifyl, @hidden_labels
   1641 +    user_labels = BufferManager.ask_for_labels :label, "Labels for thread: ", modifyl.sort_by {|x| x.to_s}, @hidden_labels
   1642      return unless user_labels
   1643  
   1644      thread.labels = Set.new(keepl) + user_labels
   1645 diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
   1646 index 59705bc..e69de57 100644
   1647 --- a/lib/sup/modes/thread-view-mode.rb
   1648 +++ b/lib/sup/modes/thread-view-mode.rb
   1649 @@ -282,7 +282,7 @@ EOS
   1650    def edit_labels
   1651      old_labels = @thread.labels
   1652      reserved_labels = old_labels.select { |l| LabelManager::RESERVED_LABELS.include? l }
   1653 -    new_labels = BufferManager.ask_for_labels :label, "Labels for thread: ", @thread.labels
   1654 +    new_labels = BufferManager.ask_for_labels :label, "Labels for thread: ", @thread.labels.sort_by {|x| x.to_s}
   1655  
   1656      return unless new_labels
   1657      @thread.labels = Set.new(reserved_labels) + new_labels
   1658 
   1659 From dmishd@gmail.com  Sun Feb 20 20:29:20 2011
   1660 From: dmishd@gmail.com (Hamish)
   1661 Date: Mon, 21 Feb 2011 01:29:20 +0000
   1662 Subject: [sup-devel] [BRANCH] Ctrl-W behaviour
   1663 Message-ID: <1298251460-sup-4333@whisper>
   1664 
   1665 I use Ctrl-W when deleting labels from a thread, and it's been a minor
   1666 annoyance that this is slightly broken - when there is a space before
   1667 the cursor, Ctrl-W will just delete the space, and you need to press
   1668 Ctrl-W a second time to delete the word aswell. This is not how I'm used
   1669 to it working in vim or on the command line.
   1670 
   1671 So I've now had a go at fixing it, in the branch called ctrl_w - just
   1672 one commit so far, and it took quite a bit of farting around to get this
   1673 far. I'll review it when it's not the early hours of the morning and
   1674 merge it into next at that point.
   1675 
   1676 Please have a go and see if you can get any strange behaviour - I had
   1677 some strange behaviour with single-letter labels, but I seem to have
   1678 fixed that ...
   1679 
   1680 Hamish Downer
   1681 
   1682 From wmorgan-sup@masanjin.net  Mon Feb 21 16:02:28 2011
   1683 From: wmorgan-sup@masanjin.net (William Morgan)
   1684 Date: Mon, 21 Feb 2011 21:02:28 +0000
   1685 Subject: [sup-devel] sup-server revisited
   1686 Message-ID: <1298320404-sup-5972@masanjin.net>
   1687 
   1688 Hello Sup fans,
   1689 
   1690 As I alluded to in an earlier email to sup-devel, I have been working recently
   1691 on the ancient goal of splitting Sup functionality out into separate client and
   1692 server programs. This will have many advantages; in particular it will remove
   1693 email lock-in by making it possible to have non-Sup clients interact with Sup.
   1694 
   1695 I've tried various approaches to this goal at various times, without much
   1696 success. But with the release of Whistlepig, I have been making a lot of
   1697 progress in a short amount of time.
   1698 
   1699 I wanted to lay out my general plan in this email, so that everyone can follow
   1700 along and try things out if they feel inclined.
   1701 
   1702 I'm focusing on the server component first. My specific goals are:
   1703 
   1704 - Encapsulate all storage and indexing logic.
   1705 - Formalize the notion of labels and state, and the relationship between them,
   1706   messages, and threads. Currently these relationships are fuzzy in Sup, and
   1707   things suffer for it.
   1708 - Precompute threads, so that search requires only moderate effort, instead of
   1709   the large effort it does now. This will make search much, much faster, at the
   1710   expense of a little more effort at index time.
   1711 - Allow concurrent access from multiple clients.
   1712 - Provide something that is transparent and easy to modify without having to go
   1713   through an ncurses client.
   1714 
   1715 You can find the work in progress here: https://github.com/wmorgan/heliotrope
   1716 Currently it is not actually a server, but accomplishes many of the goals
   1717 above. Run bin/email-indexer and then bin/email-searcher to play around with
   1718 a simple preview of things to come. Stay tuned for more on this.
   1719 
   1720 Once the server is in a reasonable state, my goals for the curses client reboot
   1721 are:
   1722 
   1723 - Move to an event-based model rather than the polling + many threads +
   1724   observable model we have now. Dump all events into one big queue,
   1725   and block on it.
   1726 - Have one, and only one, non-main thread, which it to communicate with the
   1727   server. No more mutex insanity.
   1728 - Work from the ground up with Ruby 1.9, which means finding the many sources
   1729   of encoding errors and punishing them.
   1730 - Require the console and ncurses gems so that i18n works out of the box.
   1731 - Borrow as much code as possible from the current Sup, because I sure as shit
   1732   don't want to have to rewrite it all.
   1733 
   1734 I haven't started on this at all.
   1735 
   1736 So stay tuned, and check out heliotrope if you are so inclined.
   1737 
   1738 -- 
   1739 William <wmorgan-sup at masanjin.net>
   1740 
   1741 From roni@cs.utah.edu  Mon Feb 21 16:17:04 2011
   1742 From: roni@cs.utah.edu (Roni Choudhury)
   1743 Date: Mon, 21 Feb 2011 14:17:04 -0700
   1744 Subject: [sup-devel] [PATCH] eliminated nil-to-integer error when standard
   1745 	library ruby code calls make_tmpname with n=nil
   1746 Message-ID: <1298322910-sup-1012@medusa>
   1747 
   1748 I was getting an error from monkeypatched code that didn't seem to
   1749 call into the standard library properly... this patch seemed to fix
   1750 things for me, but I didn't fully understand what was going on here.
   1751 
   1752 roni
   1753 
   1754 ---
   1755  lib/sup/message-chunks.rb |    6 +++++-
   1756  1 files changed, 5 insertions(+), 1 deletions(-)
   1757 
   1758 diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
   1759 index c275f41..90137da 100644
   1760 --- a/lib/sup/message-chunks.rb
   1761 +++ b/lib/sup/message-chunks.rb
   1762 @@ -34,7 +34,11 @@ require 'tempfile'
   1763  ## monkey-patch time: make temp files have the right extension
   1764  class Tempfile
   1765    def make_tmpname basename, n
   1766 -    sprintf '%d-%d-%s', $$, n, basename
   1767 +    if n == nil
   1768 +      sprintf '%d-nil-%s', $$, basename
   1769 +    else
   1770 +      sprintf '%d-%d-%s', $$, n, basename
   1771 +    end
   1772    end
   1773  end
   1774  
   1775 -- 
   1776 1.7.3.2
   1777 
   1778 From alvherre@alvh.no-ip.org  Mon Feb 21 18:26:07 2011
   1779 From: alvherre@alvh.no-ip.org (Alvaro Herrera)
   1780 Date: Mon, 21 Feb 2011 20:26:07 -0300
   1781 Subject: [sup-devel] [PATCH] eliminated nil-to-integer error when
   1782 	standard library ruby code calls make_tmpname with n=nil
   1783 In-Reply-To: <1298322910-sup-1012@medusa>
   1784 References: <1298322910-sup-1012@medusa>
   1785 Message-ID: <1298330683-sup-2583@alvh.no-ip.org>
   1786 
   1787 Excerpts from Roni Choudhury's message of lun feb 21 18:17:04 -0300 2011:
   1788 > I was getting an error from monkeypatched code that didn't seem to
   1789 > call into the standard library properly... this patch seemed to fix
   1790 > things for me, but I didn't fully understand what was going on here.
   1791 
   1792 Seems like the way to really solve the problem would be to figure out
   1793 what's calling make_tmpname with a nil n, and fix that instead.  Is it
   1794 possible for you to figure that out from the trace?
   1795 
   1796 -- 
   1797 ?lvaro Herrera <alvherre at alvh.no-ip.org>
   1798 
   1799 From roni@cs.utah.edu  Mon Feb 21 18:54:28 2011
   1800 From: roni@cs.utah.edu (Roni Choudhury)
   1801 Date: Mon, 21 Feb 2011 16:54:28 -0700
   1802 Subject: [sup-devel] [PATCH] eliminated nil-to-integer error when
   1803 	standard library ruby code calls make_tmpname with n=nil
   1804 In-Reply-To: <1298330683-sup-2583@alvh.no-ip.org>
   1805 References: <1298322910-sup-1012@medusa> <1298330683-sup-2583@alvh.no-ip.org>
   1806 Message-ID: <1298332384-sup-5832@medusa>
   1807 
   1808 Excerpts from Alvaro Herrera's message of 2011-02-21 16:26:07 -0700:
   1809 > Excerpts from Roni Choudhury's message of lun feb 21 18:17:04 -0300 2011:
   1810 > > I was getting an error from monkeypatched code that didn't seem to
   1811 > > call into the standard library properly... this patch seemed to fix
   1812 > > things for me, but I didn't fully understand what was going on here.
   1813 > 
   1814 > Seems like the way to really solve the problem would be to figure out
   1815 > what's calling make_tmpname with a nil n, and fix that instead.  Is it
   1816 > possible for you to figure that out from the trace?
   1817 > 
   1818 
   1819 I believe I did track it down, and it looked like a custom use for
   1820 make_tmpname somewhere... I could figure it out again, but I was also
   1821 informed in the IRC channel that this fix has already been applied to
   1822 master under different circumstances.
   1823 
   1824 roni
   1825 
   1826 From gaudenz@soziologie.ch  Tue Feb 22 08:14:38 2011
   1827 From: gaudenz@soziologie.ch (Gaudenz Steinlin)
   1828 Date: Tue, 22 Feb 2011 14:14:38 +0100
   1829 Subject: [sup-devel] Need help applying patches
   1830 In-Reply-To: <1298230750-sup-6418@whisper>
   1831 References: <1298228733-sup-6115@whisper> <1298230750-sup-6418@whisper>
   1832 Message-ID: <1298379918-sup-5032@meteor.durcheinandertal.local>
   1833 
   1834 Hi
   1835 
   1836 Excerpts from Hamish's message of 2011-02-20 20:55:33 +0100:
   1837 > Excerpts from Hamish's message of Sun Feb 20 19:19:17 +0000 2011:
   1838 > I ran into some more issues merging this into next - my usual
   1839 > cherry-pick method led to the same problems as originally, and led to me
   1840 > being listed as the committer, but I managed to do a git merge which 
   1841 > preserved the commit messages from Gaudenz (although a couple of mine
   1842 > appear to be repeated).
   1843 
   1844 Cherrypicking has basically the same disadvantages as rebasing as it
   1845 changes the commit ID. So don't cherry pick commits from one branch
   1846 (e.g. next) into another branch (e.g. gpgme) if you want to merge that
   1847 branch back into the branch from which you cherry-picked (e.g. you
   1848 want to merge gpgme back into next). 
   1849 
   1850 Also don't rebase a branch as soon as you published it somwhere for
   1851 other to pull from. 
   1852 
   1853 > 
   1854 > If there is some better way to do this in future, please tell me.
   1855 
   1856 I think the correct thing to do is to rebase your development branches
   1857 against the branch they will eventually be merged into as long as you
   1858 did not publish them. Rebasing has the nice effect of not complicating
   1859 the history to much.
   1860 
   1861 If you can't rebase then merge, either merge your feature branch into
   1862 the target branch and then you are free recreate your feature branch
   1863 and rebase while you are doing development. 
   1864 
   1865 Or if your changes are not ready yet for merging, you can also merge
   1866 the target branch into your feature branch to get the latest changes
   1867 into your feature branch.
   1868 
   1869 For testing and day to day usage I usually create a sepeparate branch
   1870 based of next and merge all my development branches into this branch.
   1871 This branch is then never published and frequently recreated if
   1872 something fails...
   1873 
   1874 Gaudenz
   1875 -- 
   1876 Ever tried. Ever failed. No matter.
   1877 Try again. Fail again. Fail better.
   1878 ~ Samuel Beckett ~
   1879 -------------- next part --------------
   1880 A non-text attachment was scrubbed...
   1881 Name: signature.asc
   1882 Type: application/pgp-signature
   1883 Size: 828 bytes
   1884 Desc: not available
   1885 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110222/ed8fe28b/attachment.bin>
   1886 
   1887 From marka@pobox.com  Tue Feb 22 08:46:56 2011
   1888 From: marka@pobox.com (Mark Alexander)
   1889 Date: Tue, 22 Feb 2011 08:46:56 -0500
   1890 Subject: [sup-devel] sup-server revisited
   1891 In-Reply-To: <1298320404-sup-5972@masanjin.net>
   1892 References: <1298320404-sup-5972@masanjin.net>
   1893 Message-ID: <1298382339-sup-4016@bloovis.org>
   1894 
   1895 Excerpts from William Morgan's message of Mon Feb 21 16:02:28 -0500 2011:
   1896 > You can find the work in progress here: https://github.com/wmorgan/heliotrope
   1897 
   1898 I took a very quick look, and it appears to support mbox only at the moment.
   1899 Presumably maildir will be supported eventually?
   1900 
   1901 From nicolas.pouillard@gmail.com  Tue Feb 22 09:09:43 2011
   1902 From: nicolas.pouillard@gmail.com (Nicolas Pouillard)
   1903 Date: Tue, 22 Feb 2011 06:09:43 -0800 (PST)
   1904 Subject: [sup-devel] sup-server revisited
   1905 In-Reply-To: <1298320404-sup-5972@masanjin.net>
   1906 References: <1298320404-sup-5972@masanjin.net>
   1907 Message-ID: <4d63c3a7.8389cc0a.52c5.7a5c@mx.google.com>
   1908 
   1909 On Mon, 21 Feb 2011 21:02:28 +0000, William Morgan <wmorgan-sup at masanjin.net> wrote:
   1910 > Hello Sup fans,
   1911 
   1912 [...]
   1913 
   1914 > I'm focusing on the server component first. My specific goals are:
   1915 > 
   1916 > - Encapsulate all storage and indexing logic.
   1917 > - Formalize the notion of labels and state, and the relationship between them,
   1918 >   messages, and threads. Currently these relationships are fuzzy in Sup, and
   1919 >   things suffer for it.
   1920 > - Precompute threads, so that search requires only moderate effort, instead of
   1921 >   the large effort it does now. This will make search much, much faster, at the
   1922 >   expense of a little more effort at index time.
   1923 > - Allow concurrent access from multiple clients.
   1924 > - Provide something that is transparent and easy to modify without having to go
   1925 >   through an ncurses client.
   1926 
   1927 On the server side, and more precisely on the interaction between the two,
   1928 I would love to see a simple Unix/command/CLI defined for the server. To make
   1929 myself clear, a bit like the notmuch CLI. This would allow for a greater
   1930 modularity and reusablity between components. For instance I would like to
   1931 index my mails with differents backends (disk is cheap), to get a way to
   1932 compare different tools on real data, when searching emails, and thus allow
   1933 to debug the different tools.
   1934 
   1935 -- 
   1936 Nicolas Pouillard
   1937 http://nicolaspouillard.fr
   1938 
   1939 From dmishd@gmail.com  Tue Feb 22 12:01:29 2011
   1940 From: dmishd@gmail.com (Hamish)
   1941 Date: Tue, 22 Feb 2011 17:01:29 +0000
   1942 Subject: [sup-devel] [BRANCH] Ctrl-W behaviour
   1943 In-Reply-To: <1298251460-sup-4333@whisper>
   1944 References: <1298251460-sup-4333@whisper>
   1945 Message-ID: <1298393768-sup-7839@whisper>
   1946 
   1947 Excerpts from Hamish's message of Mon Feb 21 01:29:20 +0000 2011:
   1948 > I use Ctrl-W when deleting labels from a thread, and it's been a minor
   1949 > annoyance that this is slightly broken - when there is a space before
   1950 > the cursor, Ctrl-W will just delete the space, and you need to press
   1951 > Ctrl-W a second time to delete the word aswell. This is not how I'm used
   1952 > to it working in vim or on the command line.
   1953 
   1954 I've now merged this into next. I forgot to put the patches in email
   1955 last night, so I've put the branch diff at the end of this email.
   1956 
   1957 Hamish Downer
   1958 
   1959 
   1960 
   1961 diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb
   1962 index a3d002a..343e450 100644
   1963 --- a/lib/sup/textfield.rb
   1964 +++ b/lib/sup/textfield.rb
   1965 @@ -120,6 +120,9 @@ class TextField
   1966          nop
   1967          Ncurses::Form::REQ_BEG_FIELD
   1968        when ?\C-w.ord
   1969 +        while action = remove_extra_space
   1970 +          Ncurses::Form.form_driver @form, action
   1971 +        end
   1972          Ncurses::Form.form_driver @form, Ncurses::Form::REQ_PREV_CHAR
   1973          Ncurses::Form.form_driver @form, Ncurses::Form::REQ_DEL_WORD
   1974        when Ncurses::KEY_UP, Ncurses::KEY_DOWN
   1975 @@ -167,6 +170,40 @@ private
   1976      end
   1977    end
   1978  
   1979 +  def remove_extra_space
   1980 +    return nil unless @field
   1981 +
   1982 +    Ncurses::Form.form_driver @form, Ncurses::Form::REQ_VALIDATION
   1983 +    x = Ncurses.curx
   1984 +    v = @field.field_buffer(0).gsub(/^\s+|\s+$/, "")
   1985 +    v_index = x - @question.length
   1986 +
   1987 +    # at start of line
   1988 +    if v_index < 1
   1989 +      nil
   1990 +    ## cursor <= end of text
   1991 +    elsif v_index < v.length
   1992 +      # is the character before the cursor a space?
   1993 +      if v[v_index-1] == ?\s
   1994 +        # if there is a non-space char under cursor then go back
   1995 +        if v[v_index] != ?\s
   1996 +          Ncurses::Form::REQ_PREV_CHAR
   1997 +        # otherwise delete the space
   1998 +        else
   1999 +          Ncurses::Form::REQ_DEL_PREV
   2000 +        end
   2001 +      else
   2002 +        nil
   2003 +      end
   2004 +    elsif v_index == v.length
   2005 +      # at end of string, with non-space before us
   2006 +      nil
   2007 +    else
   2008 +      # trailing spaces
   2009 +      Ncurses::Form::REQ_PREV_CHAR
   2010 +    end
   2011 +  end
   2012 +
   2013    def set_cursed_value v
   2014      @field.set_field_buffer 0, v
   2015    end
   2016 
   2017 From wmorgan-sup@masanjin.net  Tue Feb 22 12:55:23 2011
   2018 From: wmorgan-sup@masanjin.net (William Morgan)
   2019 Date: Tue, 22 Feb 2011 17:55:23 +0000
   2020 Subject: [sup-devel] sup-server revisited
   2021 In-Reply-To: <1298382339-sup-4016@bloovis.org>
   2022 References: <1298320404-sup-5972@masanjin.net>
   2023 	<1298382339-sup-4016@bloovis.org>
   2024 Message-ID: <1298397161-sup-9723@masanjin.net>
   2025 
   2026 Reformatted excerpts from Mark Alexander's message of 2011-02-22:
   2027 > I took a very quick look, and it appears to support mbox only at the moment.
   2028 > Presumably maildir will be supported eventually?
   2029 
   2030 It's more like: you will give new emails to the server using some tool, and it
   2031 will store them some way that you don't care about, and you can then use a sup
   2032 client to view them, or (eventually) an IMAP client, or you can export them
   2033 from the server and leave Sup entirely.
   2034 -- 
   2035 William <wmorgan-sup at masanjin.net>
   2036 
   2037 From tero@tilus.net  Tue Feb 22 13:44:28 2011
   2038 From: tero@tilus.net (Tero Tilus)
   2039 Date: Tue, 22 Feb 2011 20:44:28 +0200
   2040 Subject: [sup-devel] sup-server revisited
   2041 In-Reply-To: <1298397161-sup-9723@masanjin.net>
   2042 References: <1298320404-sup-5972@masanjin.net>
   2043 	<1298382339-sup-4016@bloovis.org>
   2044 	<1298397161-sup-9723@masanjin.net>
   2045 Message-ID: <1298399731-sup-2646@tilus.net>
   2046 
   2047 William Morgan, 2011-02-22 19:55:
   2048 > It's more like: you will give new emails to the server using some
   2049 > tool
   2050 
   2051 You mean something like configuring your MDA to do a pipe-deliver to
   2052 "sup-indexer"?
   2053 
   2054 > you can then use a sup client to view them, or (eventually) an IMAP
   2055 > client
   2056 
   2057 Does this mean you intend to implement IMAP capability to sup-server?
   2058 
   2059 -- 
   2060 Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
   2061 
   2062 From wmorgan-sup@masanjin.net  Tue Feb 22 14:00:01 2011
   2063 From: wmorgan-sup@masanjin.net (William Morgan)
   2064 Date: Tue, 22 Feb 2011 19:00:01 +0000
   2065 Subject: [sup-devel] sup-server revisited
   2066 In-Reply-To: <1298399731-sup-2646@tilus.net>
   2067 References: <1298320404-sup-5972@masanjin.net>
   2068 	<1298382339-sup-4016@bloovis.org>
   2069 	<1298397161-sup-9723@masanjin.net> <1298399731-sup-2646@tilus.net>
   2070 Message-ID: <1298401081-sup-6560@masanjin.net>
   2071 
   2072 Reformatted excerpts from Tero Tilus's message of 2011-02-22:
   2073 > You mean something like configuring your MDA to do a pipe-deliver to
   2074 > "sup-indexer"?
   2075 
   2076 Yes.
   2077 
   2078 > Does this mean you intend to implement IMAP capability to sup-server?
   2079 
   2080 Yeah. I'm not really looking forward to actually doing it, but I would like to
   2081 have an IMAP compatibility layer on the server. That goes a long way to
   2082 eliminating what I think is the biggest blocker for Sup adoption, which is
   2083 lockin.
   2084 -- 
   2085 William <wmorgan-sup at masanjin.net>
   2086 
   2087 From tero@tilus.net  Tue Feb 22 15:17:04 2011
   2088 From: tero@tilus.net (Tero Tilus)
   2089 Date: Tue, 22 Feb 2011 22:17:04 +0200
   2090 Subject: [sup-devel] sup-server revisited
   2091 In-Reply-To: <1298320404-sup-5972@masanjin.net>
   2092 References: <1298320404-sup-5972@masanjin.net>
   2093 Message-ID: <1298400274-sup-4941@tilus.net>
   2094 
   2095 William Morgan, 2011-02-21 23:02:
   2096 > I have been making a lot of
   2097 > progress in a short amount of time.
   2098 
   2099 Cool!  I'm thrilled.  \o/
   2100 
   2101 > - Precompute threads, so that search requires only moderate effort,
   2102 >   instead of the large effort it does now. This will make search
   2103 >   much, much faster, at the expense of a little more effort at index
   2104 >   time.
   2105 
   2106 I guess this offers the possibility to add threading to "external
   2107 state" of messages, together with labels.  I'd do a whole a lot of
   2108 more prune'n'crafting with my threads if there only was more
   2109 comfortable interface to doing it (admit it, been too lazy to
   2110 implement it in sup).
   2111 
   2112 Do you have considerations wrt to programmatical thread browsing and
   2113 editing API?  Something I've thought of, on the top of my head.
   2114 
   2115 first_msg
   2116 |-- second_msg
   2117 |-- third_msg
   2118 |   `-- fifth_msg
   2119 `-- fourth_msg
   2120 
   2121 sixth_msg
   2122 `-- seventh_msg
   2123 
   2124 thread = Thread.find :second
   2125 subthread = thread.find { |msg| msg == :third_msg }.prune!
   2126 Message.find(:sixth_msg).craft! subthread
   2127 
   2128 first
   2129 |-- second
   2130 `-- fourth
   2131 
   2132 sixth
   2133 |-- third
   2134 |   `-- fifth
   2135 `-- seventh
   2136 
   2137 > - Allow concurrent access from multiple clients.
   2138 
   2139 Since the first post on sup-server I've been nurturing the idea of
   2140 "fat" sup-client for maemo/meego.
   2141 
   2142 > - Borrow as much code as possible from the current Sup, because I
   2143 >   sure as shit don't want to have to rewrite it all.
   2144 
   2145 Would it be time to go for https://github.com/mikel/mail now?  It
   2146 would be supported and actively developed and I really like the API.
   2147 As a downside, depending on activesupport pulls in a whole a lot of
   2148 fluff and using treetop may suggest that parsing might hog a little
   2149 more cpu and memory than is absolutely necessary.
   2150 
   2151 Who would give us bindings to GMime and wrap it inside Mail API...
   2152 
   2153 -- 
   2154 Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
   2155 
   2156 From wmorgan-sup@masanjin.net  Tue Feb 22 16:29:07 2011
   2157 From: wmorgan-sup@masanjin.net (William Morgan)
   2158 Date: Tue, 22 Feb 2011 21:29:07 +0000
   2159 Subject: [sup-devel] sup-server revisited
   2160 In-Reply-To: <1298400274-sup-4941@tilus.net>
   2161 References: <1298320404-sup-5972@masanjin.net> <1298400274-sup-4941@tilus.net>
   2162 Message-ID: <1298409714-sup-1926@masanjin.net>
   2163 
   2164 Reformatted excerpts from Tero Tilus's message of 2011-02-22:
   2165 > I guess this offers the possibility to add threading to "external state"
   2166 > of messages, together with labels.  I'd do a whole a lot of more
   2167 > prune'n'crafting with my threads if there only was more comfortable
   2168 > interface to doing it (admit it, been too lazy to implement it in sup).
   2169 
   2170 Not quite sure I follow, but the intention is certainly to allow clients to
   2171 create and break threads and to present labels as per-thread, rather than
   2172 per-message, data.
   2173 
   2174 > Do you have considerations wrt to programmatical thread browsing and
   2175 > editing API?
   2176 
   2177 I suspect won't get into that level of detail. The API will be more along
   2178 the lines of "give me thread 6" and you'll get a tree of message ids back,
   2179 and on the client side you can represent that however you like. Unless
   2180 there's a compelling case for handling portions of threads at the API level.
   2181 
   2182 > > - Allow concurrent access from multiple clients.
   2183 > 
   2184 > Since the first post on sup-server I've been nurturing the idea of "fat"
   2185 > sup-client for maemo/meego.
   2186 
   2187 That would be great. I would like an Android client while you're at it. :)
   2188 
   2189 > Would it be time to go for https://github.com/mikel/mail now?  It would be
   2190 > supported and actively developed and I really like the API.  As a
   2191 > downside, depending on activesupport pulls in a whole a lot of fluff and
   2192 > using treetop may suggest that parsing might hog a little more cpu and
   2193 > memory than is absolutely necessary.
   2194 
   2195 I looked at it, but the dependency on activesupport is a dealbreaker for me.
   2196 There's no way I would pull that pile of Rails shit into Sup.
   2197 
   2198 RMail is not great and I don't like using it, but it really is the best
   2199 thing I've found so far. I think I have whipped it into shape pretty well in
   2200 heliotrope.
   2201 
   2202 > Who would give us bindings to GMime and wrap it inside Mail API...
   2203 
   2204 I would use GMime bindings in a heartbeat.
   2205 -- 
   2206 William <wmorgan-sup at masanjin.net>
   2207 
   2208 From nicolas.pouillard@gmail.com  Wed Feb 23 04:48:12 2011
   2209 From: nicolas.pouillard@gmail.com (Nicolas Pouillard)
   2210 Date: Wed, 23 Feb 2011 01:48:12 -0800 (PST)
   2211 Subject: [sup-devel] sup-server revisited
   2212 In-Reply-To: <1298409714-sup-1926@masanjin.net>
   2213 References: <1298320404-sup-5972@masanjin.net> <1298400274-sup-4941@tilus.net>
   2214 	<1298409714-sup-1926@masanjin.net>
   2215 Message-ID: <4d64d7dc.5989cc0a.4550.ffffb543@mx.google.com>
   2216 
   2217 On Tue, 22 Feb 2011 21:29:07 +0000, William Morgan <wmorgan-sup at masanjin.net> wrote:
   2218 > Reformatted excerpts from Tero Tilus's message of 2011-02-22:
   2219 > > I guess this offers the possibility to add threading to "external state"
   2220 > > of messages, together with labels.  I'd do a whole a lot of more
   2221 > > prune'n'crafting with my threads if there only was more comfortable
   2222 > > interface to doing it (admit it, been too lazy to implement it in sup).
   2223 > 
   2224 > Not quite sure I follow, but the intention is certainly to allow clients to
   2225 > create and break threads and to present labels as per-thread, rather than
   2226 > per-message, data.
   2227 
   2228 I would not go for "labels on threads" only, here is a list of labels that are
   2229 more message based than thread based: unread, starred, draft, sent,
   2230 attachment. And while it would make sense to have special cases for those this
   2231 also prevents from user defined per message labels.
   2232 
   2233 -- 
   2234 Nicolas Pouillard
   2235 http://nicolaspouillard.fr
   2236 
   2237 From alvherre@alvh.no-ip.org  Wed Feb 23 08:19:15 2011
   2238 From: alvherre@alvh.no-ip.org (Alvaro Herrera)
   2239 Date: Wed, 23 Feb 2011 10:19:15 -0300
   2240 Subject: [sup-devel] [BRANCH] Ctrl-W behaviour
   2241 In-Reply-To: <1298393768-sup-7839@whisper>
   2242 References: <1298251460-sup-4333@whisper> <1298393768-sup-7839@whisper>
   2243 Message-ID: <1298467110-sup-4536@alvh.no-ip.org>
   2244 
   2245 Excerpts from Hamish's message of mar feb 22 14:01:29 -0300 2011:
   2246 > Excerpts from Hamish's message of Mon Feb 21 01:29:20 +0000 2011:
   2247 > > I use Ctrl-W when deleting labels from a thread, and it's been a minor
   2248 > > annoyance that this is slightly broken - when there is a space before
   2249 > > the cursor, Ctrl-W will just delete the space, and you need to press
   2250 > > Ctrl-W a second time to delete the word aswell. This is not how I'm used
   2251 > > to it working in vim or on the command line.
   2252 > 
   2253 > I've now merged this into next. I forgot to put the patches in email
   2254 > last night, so I've put the branch diff at the end of this email.
   2255 
   2256 I've been using this and it works great.  I was annoyed by the original
   2257 behavior too.
   2258 
   2259 -- 
   2260 ?lvaro Herrera <alvherre at alvh.no-ip.org>
   2261 
   2262 From wmorgan-sup@masanjin.net  Wed Feb 23 13:43:34 2011
   2263 From: wmorgan-sup@masanjin.net (William Morgan)
   2264 Date: Wed, 23 Feb 2011 18:43:34 +0000
   2265 Subject: [sup-devel] sup-server revisited
   2266 In-Reply-To: <4d64d7dc.5989cc0a.4550.ffffb543@mx.google.com>
   2267 References: <1298320404-sup-5972@masanjin.net> <1298400274-sup-4941@tilus.net>
   2268 	<1298409714-sup-1926@masanjin.net>
   2269 	<4d64d7dc.5989cc0a.4550.ffffb543@mx.google.com>
   2270 Message-ID: <1298485426-sup-5530@masanjin.net>
   2271 
   2272 Reformatted excerpts from Nicolas Pouillard's message of 2011-02-23:
   2273 > I would not go for "labels on threads" only, here is a list of labels that
   2274 > are more message based than thread based: unread, starred, draft, sent,
   2275 > attachment. And while it would make sense to have special cases for those
   2276 > this also prevents from user defined per message labels.
   2277 
   2278 One of the major goals of Heliotrope is to formalize this type of thing and to
   2279 implement it correctly. Here's the model:
   2280 
   2281 - Individual messages have "state", including unread, starred, and all the
   2282   other things you've mentioned.
   2283 - Threads have "labels", which are user-defined.
   2284 - Message state is mapped onto thread labels by taking the union of the states
   2285   of all the messages in a thread. E.g. if one message is unread, the entire
   2286   thread has the unread label.
   2287 - Sup maintains that mapping for you.
   2288 - The user can set (some of) the state of a particular message.
   2289 - The user can set the labels for a thread, but can't create labels that have
   2290   the same name as a message state.
   2291 - The labels of a thread match all messages in a thread at search time.
   2292 
   2293 Sup conflates these things, maintains labels on messages only, and does some UI
   2294 stuff to make it seem like they apply to threads. It's easy to find corner
   2295 cases where you get weird behavior.
   2296 -- 
   2297 William <wmorgan-sup at masanjin.net>
   2298 
   2299 From alvherre@alvh.no-ip.org  Wed Feb 23 13:53:23 2011
   2300 From: alvherre@alvh.no-ip.org (Alvaro Herrera)
   2301 Date: Wed, 23 Feb 2011 15:53:23 -0300
   2302 Subject: [sup-devel] sup-server revisited
   2303 In-Reply-To: <1298485426-sup-5530@masanjin.net>
   2304 References: <1298320404-sup-5972@masanjin.net> <1298400274-sup-4941@tilus.net>
   2305 	<1298409714-sup-1926@masanjin.net>
   2306 	<4d64d7dc.5989cc0a.4550.ffffb543@mx.google.com>
   2307 	<1298485426-sup-5530@masanjin.net>
   2308 Message-ID: <1298486753-sup-2845@alvh.no-ip.org>
   2309 
   2310 Excerpts from William Morgan's message of mi? feb 23 15:43:34 -0300 2011:
   2311 
   2312 > One of the major goals of Heliotrope is to formalize this type of thing and to
   2313 > implement it correctly. Here's the model:
   2314 > 
   2315 > - Individual messages have "state", including unread, starred, and all the
   2316 >   other things you've mentioned.
   2317 > - Threads have "labels", which are user-defined.
   2318 > - Message state is mapped onto thread labels by taking the union of the states
   2319 >   of all the messages in a thread. E.g. if one message is unread, the entire
   2320 >   thread has the unread label.
   2321 > - Sup maintains that mapping for you.
   2322 > - The user can set (some of) the state of a particular message.
   2323 > - The user can set the labels for a thread, but can't create labels that have
   2324 >   the same name as a message state.
   2325 > - The labels of a thread match all messages in a thread at search time.
   2326 
   2327 I like this, except the part that thread_labels = union(states).  It
   2328 doesn't work correctly for "attachment" for example: it makes it look
   2329 like the whole thread "has attachments" which doesn't make sense.  The
   2330 user really needs to have a way of telling messages that really have
   2331 attachments from ones that don't.
   2332 
   2333 Also, you said upthread that Heliotrope was going to provide ways to
   2334 break threads and form new ones from pieces.  I badly want this feature
   2335 :-)  (I haven't checked Heliotrope out yet).
   2336 
   2337 > Sup conflates these things, maintains labels on messages only, and does some UI
   2338 > stuff to make it seem like they apply to threads. It's easy to find corner
   2339 > cases where you get weird behavior.
   2340 
   2341 Agreed.  Someone mentioned some weeks ago that "undo" badly messed up
   2342 labels that you're now separating as "state" (again, attachment).  Seems
   2343 like the current proposal fixes that problem.
   2344 
   2345 -- 
   2346 ?lvaro Herrera <alvherre at alvh.no-ip.org>
   2347 
   2348 From wmorgan-sup@masanjin.net  Wed Feb 23 16:08:07 2011
   2349 From: wmorgan-sup@masanjin.net (William Morgan)
   2350 Date: Wed, 23 Feb 2011 21:08:07 +0000
   2351 Subject: [sup-devel] sup-server revisited
   2352 In-Reply-To: <1298486753-sup-2845@alvh.no-ip.org>
   2353 References: <1298320404-sup-5972@masanjin.net> <1298400274-sup-4941@tilus.net>
   2354 	<1298409714-sup-1926@masanjin.net>
   2355 	<4d64d7dc.5989cc0a.4550.ffffb543@mx.google.com>
   2356 	<1298485426-sup-5530@masanjin.net>
   2357 	<1298486753-sup-2845@alvh.no-ip.org>
   2358 Message-ID: <1298495002-sup-1617@masanjin.net>
   2359 
   2360 Reformatted excerpts from Alvaro Herrera's message of 2011-02-23:
   2361 > I like this, except the part that thread_labels = union(states).  It
   2362 > doesn't work correctly for "attachment" for example: it makes it look
   2363 > like the whole thread "has attachments" which doesn't make sense.
   2364 
   2365 The thread has the label "attachment", but when you look at the
   2366 individual messages inside of it, you see which ones actually have the
   2367 attachment state. I think this makes sense.
   2368 
   2369 > Also, you said upthread that Heliotrope was going to provide ways to
   2370 > break threads and form new ones from pieces.  I badly want this
   2371 > feature :-)  (I haven't checked Heliotrope out yet).
   2372 
   2373 Yes, this will definitely be there.
   2374 -- 
   2375 William <wmorgan-sup at masanjin.net>
   2376 
   2377 From alvherre@alvh.no-ip.org  Wed Feb 23 16:30:26 2011
   2378 From: alvherre@alvh.no-ip.org (Alvaro Herrera)
   2379 Date: Wed, 23 Feb 2011 18:30:26 -0300
   2380 Subject: [sup-devel] sup-server revisited
   2381 In-Reply-To: <1298495002-sup-1617@masanjin.net>
   2382 References: <1298320404-sup-5972@masanjin.net> <1298400274-sup-4941@tilus.net>
   2383 	<1298409714-sup-1926@masanjin.net>
   2384 	<4d64d7dc.5989cc0a.4550.ffffb543@mx.google.com>
   2385 	<1298485426-sup-5530@masanjin.net>
   2386 	<1298486753-sup-2845@alvh.no-ip.org>
   2387 	<1298495002-sup-1617@masanjin.net>
   2388 Message-ID: <1298496576-sup-8044@alvh.no-ip.org>
   2389 
   2390 Excerpts from William Morgan's message of mi? feb 23 18:08:07 -0300 2011:
   2391 > Reformatted excerpts from Alvaro Herrera's message of 2011-02-23:
   2392 > > I like this, except the part that thread_labels = union(states).  It
   2393 > > doesn't work correctly for "attachment" for example: it makes it look
   2394 > > like the whole thread "has attachments" which doesn't make sense.
   2395 > 
   2396 > The thread has the label "attachment", but when you look at the
   2397 > individual messages inside of it, you see which ones actually have the
   2398 > attachment state. I think this makes sense.
   2399 
   2400 Yes, this sounds good to me.
   2401 
   2402 > > Also, you said upthread that Heliotrope was going to provide ways to
   2403 > > break threads and form new ones from pieces.  I badly want this
   2404 > > feature :-)  (I haven't checked Heliotrope out yet).
   2405 > 
   2406 > Yes, this will definitely be there.
   2407 
   2408 Great.
   2409 
   2410 -- 
   2411 ?lvaro Herrera <alvherre at alvh.no-ip.org>
   2412 
   2413 From dmishd@gmail.com  Sat Feb 26 14:15:40 2011
   2414 From: dmishd@gmail.com (Hamish)
   2415 Date: Sat, 26 Feb 2011 19:15:40 +0000
   2416 Subject: [sup-devel] sup-server revisited
   2417 In-Reply-To: <1298320404-sup-5972@masanjin.net>
   2418 References: <1298320404-sup-5972@masanjin.net>
   2419 Message-ID: <1298744738-sup-631@whisper>
   2420 
   2421 Excerpts from William Morgan's message of Mon Feb 21 21:02:28 +0000 2011:
   2422 > As I alluded to in an earlier email to sup-devel, I have been working recently
   2423 > on the ancient goal of splitting Sup functionality out into separate client and
   2424 > server programs. This will have many advantages; in particular it will remove
   2425 > email lock-in by making it possible to have non-Sup clients interact with Sup.
   2426 
   2427 Excellent :) I look forward to an android client. I will definitely
   2428 contribute to it, and I *might* even get it started. Or might not ...
   2429 
   2430 > You can find the work in progress here: https://github.com/wmorgan/heliotrope
   2431 > Currently it is not actually a server, but accomplishes many of the goals
   2432 > above. Run bin/email-indexer and then bin/email-searcher to play around with
   2433 > a simple preview of things to come. Stay tuned for more on this.
   2434 
   2435 I've had a quick look at heliotrope (and whistlepig) and not got very
   2436 far:
   2437 
   2438 
   2439 $ ruby -I lib bin/email-indexer ~/path/to/mbox
   2440 /var/lib/gems/1.8/gems/ffi-1.0.6/lib/ffi/library.rb:93:in `ffi_libraries': no library specified (LoadError)
   2441         from /var/lib/gems/1.8/gems/ffi-1.0.6/lib/ffi/library.rb:129:in `attach_function'
   2442         from /var/lib/gems/1.8/gems/oklahoma_mixer-0.4.0/lib/oklahoma_mixer/utilities.rb:39:in `func'
   2443         from /var/lib/gems/1.8/gems/oklahoma_mixer-0.4.0/lib/oklahoma_mixer/utilities.rb:214
   2444         from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   2445         from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
   2446         from /var/lib/gems/1.8/gems/oklahoma_mixer-0.4.0/lib/oklahoma_mixer/extensible_string/c.rb:1
   2447         from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   2448         from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
   2449         from /var/lib/gems/1.8/gems/oklahoma_mixer-0.4.0/lib/oklahoma_mixer/extensible_string.rb:1
   2450         from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
   2451         from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
   2452         from /var/lib/gems/1.8/gems/oklahoma_mixer-0.4.0/lib/oklahoma_mixer/hash_database.rb:2
   2453         from /var/lib/gems/1.8/gems/oklahoma_mixer-0.4.0/lib/oklahoma_mixer.rb:11:in `open'
   2454         from ./lib/heliotrope/store.rb:40:in `initialize'
   2455         from bin/email-indexer:20:in `new'
   2456         from bin/email-indexer:20
   2457 
   2458 $ ruby --version
   2459 ruby 1.8.7 (2010-06-23 patchlevel 299) [x86_64-linux]
   2460 
   2461 
   2462 Am I missing something? It appears that the oklahoma_mixer gem is
   2463 broken. I installed it though rubygems. Any ideas?
   2464 
   2465 
   2466 I also wasn't sure how to build and run whistlepig from source. I'm not
   2467 familiar with the extconf stuff. I can type make happily enough, but it
   2468 appears more steps are required. If someone shows me the way I'll
   2469 happily contribute an improved README for anyone else who wants to use
   2470 it. (I installed whistlepig from the gem in order to try out heliotrope,
   2471 in case you're wondering).
   2472 
   2473 Hamish
   2474 
   2475 From dmishd@gmail.com  Sat Feb 26 14:23:13 2011
   2476 From: dmishd@gmail.com (Hamish)
   2477 Date: Sat, 26 Feb 2011 19:23:13 +0000
   2478 Subject: [sup-devel] editing messages outside of sup
   2479 In-Reply-To: <1298239068-sup-6985@whisper>
   2480 References: <1298239068-sup-6985@whisper>
   2481 Message-ID: <1298747943-sup-9749@whisper>
   2482 
   2483 Excerpts from Hamish's message of Sun Feb 20 22:02:54 +0000 2011:
   2484 > For the moment this work is in the async_message_edit branch. If no one
   2485 > shouts about this being a terrible idea then I'll merge it into next
   2486 > within a week.
   2487 
   2488 No one shouted, so I've merged it into next. At the end of the email is
   2489 the diff of the async_message_edit branch against where I started it.
   2490 
   2491 Hamish Downer
   2492 
   2493 
   2494 
   2495 
   2496 diff --git a/lib/sup.rb b/lib/sup.rb
   2497 index 74eb950..213823c 100644
   2498 --- a/lib/sup.rb
   2499 +++ b/lib/sup.rb
   2500 @@ -370,6 +370,7 @@ require "sup/horizontal-selector"
   2501  require "sup/modes/line-cursor-mode"
   2502  require "sup/modes/help-mode"
   2503  require "sup/modes/edit-message-mode"
   2504 +require "sup/modes/edit-message-async-mode"
   2505  require "sup/modes/compose-mode"
   2506  require "sup/modes/resume-mode"
   2507  require "sup/modes/forward-mode"
   2508 diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
   2509 index 25ea132..444589a 100644
   2510 --- a/lib/sup/buffer.rb
   2511 +++ b/lib/sup/buffer.rb
   2512 @@ -73,7 +73,7 @@ class InputSequenceAborted < StandardError; end
   2513  class Buffer
   2514    attr_reader :mode, :x, :y, :width, :height, :title, :atime
   2515    bool_reader :dirty, :system
   2516 -  bool_accessor :force_to_top
   2517 +  bool_accessor :force_to_top, :hidden
   2518  
   2519    def initialize window, mode, width, height, opts={}
   2520      @w = window
   2521 @@ -82,6 +82,7 @@ class Buffer
   2522      @focus = false
   2523      @title = opts[:title] || ""
   2524      @force_to_top = opts[:force_to_top] || false
   2525 +    @hidden = opts[:hidden] || false
   2526      @x, @y, @width, @height = 0, 0, width, height
   2527      @atime = Time.at 0
   2528      @system = opts[:system] || false
   2529 @@ -265,7 +266,7 @@ EOS
   2530    end
   2531  
   2532    def rollable_buffers
   2533 -    @buffers.select { |b| !b.system? || @buffers.last == b }
   2534 +    @buffers.select { |b| !(b.system? || b.hidden?) || @buffers.last == b }
   2535    end
   2536  
   2537    def handle_input c
   2538 diff --git a/lib/sup/modes/buffer-list-mode.rb b/lib/sup/modes/buffer-list-mode.rb
   2539 index 40f2e76..08bb604 100644
   2540 --- a/lib/sup/modes/buffer-list-mode.rb
   2541 +++ b/lib/sup/modes/buffer-list-mode.rb
   2542 @@ -28,7 +28,7 @@ protected
   2543    end
   2544  
   2545    def regen_text
   2546 -    @bufs = BufferManager.buffers.reject { |name, buf| buf.mode == self }.sort_by { |name, buf| buf.atime }.reverse
   2547 +    @bufs = BufferManager.buffers.reject { |name, buf| buf.mode == self || buf.hidden? }.sort_by { |name, buf| buf.atime }.reverse
   2548      width = @bufs.max_of { |name, buf| buf.mode.name.length }
   2549      @text = @bufs.map do |name, buf|
   2550        base_color = buf.system? ? :system_buf_color : :regular_buf_color
   2551 diff --git a/lib/sup/modes/edit-message-async-mode.rb b/lib/sup/modes/edit-message-async-mode.rb
   2552 new file mode 100644
   2553 index 0000000..385ba6a
   2554 --- /dev/null
   2555 +++ b/lib/sup/modes/edit-message-async-mode.rb
   2556 @@ -0,0 +1,89 @@
   2557 +module Redwood
   2558 +
   2559 +class EditMessageAsyncMode < LineCursorMode
   2560 +
   2561 +  register_keymap do |k|
   2562 +    k.add :edit_finished, "Finished editing message", 'E'
   2563 +    k.add :path_to_clipboard, "Copy file path to the clipboard", :enter
   2564 +  end
   2565 +
   2566 +  def initialize parent_edit_mode, file_path, msg_subject
   2567 +    @parent_edit_mode = parent_edit_mode
   2568 +    @file_path = file_path
   2569 +    @orig_mtime = File.mtime @file_path
   2570 +
   2571 +    @text = ["ASYNC MESSAGE EDIT",
   2572 +             "", "Your message with subject:",  msg_subject, "is saved in a file:", "", @file_path, "", 
   2573 +             "You can edit your message in the editor of your choice and continue to",
   2574 +             "use sup while you edit your message.", "",
   2575 +             "Press <Enter> to have the file path copied to the clipboard.", "",
   2576 +             "When you have finished editing, select this buffer and press 'E'.",]
   2577 +    super()
   2578 +  end
   2579 +
   2580 +  def lines; @text.length end
   2581 +
   2582 +  def [] i
   2583 +    @text[i]
   2584 +  end
   2585 +
   2586 +  def killable?
   2587 +    if file_being_edited?
   2588 +      if !BufferManager.ask_yes_or_no("It appears the file is still being edited. Are you sure?")
   2589 +        return false
   2590 +      end
   2591 +    end
   2592 +
   2593 +    @parent_edit_mode.edit_message_async_resume true
   2594 +    true
   2595 +  end
   2596 +
   2597 +  def unsaved?
   2598 +    !file_being_edited? && !file_has_been_edited?
   2599 +  end
   2600 +
   2601 +protected
   2602 +
   2603 +  def edit_finished
   2604 +    if file_being_edited?
   2605 +      if !BufferManager.ask_yes_or_no("It appears the file is still being edited. Are you sure?")
   2606 +        return false
   2607 +      end
   2608 +    end
   2609 +
   2610 +    @parent_edit_mode.edit_message_async_resume
   2611 +    BufferManager.kill_buffer buffer
   2612 +    true
   2613 +  end
   2614 +
   2615 +  def path_to_clipboard
   2616 +    if system("which xsel > /dev/null 2>&1")
   2617 +      # linux/unix path
   2618 +      IO.popen('xsel --clipboard --input', 'r+') { |clipboard| clipboard.puts(@file_path) }
   2619 +      BufferManager.flash "Copied file path to clipboard."
   2620 +    elsif system("which pbcopy > /dev/null 2>&1")
   2621 +      # mac path
   2622 +      IO.popen('pbcopy', 'r+') { |clipboard| clipboard.puts(@file_path) }
   2623 +      BufferManager.flash "Copied file path to clipboard."
   2624 +    else
   2625 +      BufferManager.flash "No way to copy text to clipboard - try installing xsel."
   2626 +    end
   2627 +  end
   2628 +
   2629 +  def file_being_edited?
   2630 +    # check for common editor lock files
   2631 +    vim_lock_file = File.join(File.dirname(@file_path), '.'+File.basename(@file_path)+'.swp')
   2632 +    emacs_lock_file = File.join(File.dirname(@file_path), '.#'+File.basename(@file_path))
   2633 +
   2634 +    return true if File.exist?(vim_lock_file) || File.exist?(emacs_lock_file)
   2635 +
   2636 +    false
   2637 +  end
   2638 +
   2639 +  def file_has_been_edited?
   2640 +    File.mtime(@file_path) > @orig_mtime
   2641 +  end
   2642 +
   2643 +end
   2644 +
   2645 +end
   2646 diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
   2647 index 734a879..01f3653 100644
   2648 --- a/lib/sup/modes/edit-message-mode.rb
   2649 +++ b/lib/sup/modes/edit-message-mode.rb
   2650 @@ -80,6 +80,7 @@ EOS
   2651      k.add :edit_cc, "Edit Cc:", 'c'
   2652      k.add :edit_subject, "Edit Subject", 's'
   2653      k.add :edit_message, "Edit message", :enter
   2654 +    k.add :edit_message_async, "Edit message asynchronously", 'E'
   2655      k.add :save_as_draft, "Save as draft", 'P'
   2656      k.add :attach_file, "Attach a file", 'a'
   2657      k.add :delete_attachment, "Delete an attachment", 'd'
   2658 @@ -184,7 +185,51 @@ EOS
   2659      @edited
   2660    end
   2661  
   2662 +  def edit_message_async
   2663 +    @file = Tempfile.new ["sup.#{self.class.name.gsub(/.*::/, '').camel_to_hyphy}", ".eml"]
   2664 +    @file.puts format_headers(@header - NON_EDITABLE_HEADERS).first
   2665 +    @file.puts
   2666 +    @file.puts @body.join("\n")
   2667 +    @file.close
   2668 +
   2669 +    @mtime = File.mtime @file.path
   2670 +
   2671 +    # put up buffer saying you can now edit the message in another
   2672 +    # terminal or app, and continue to use sup in the meantime.
   2673 +    subject = @header["Subject"] || ""
   2674 +    @async_mode = EditMessageAsyncMode.new self, @file.path, subject
   2675 +    BufferManager.spawn "Waiting for message \"#{subject}\" to be finished", @async_mode
   2676 +
   2677 +    # hide ourselves, and wait for signal to resume from async mode ...
   2678 +    buffer.hidden = true
   2679 +  end
   2680 +
   2681 +  def edit_message_async_resume being_killed=false
   2682 +    buffer.hidden = false
   2683 +    @async_mode = nil
   2684 +    BufferManager.raise_to_front buffer if !being_killed
   2685 +
   2686 +    @edited = true if File.mtime(@file.path) > @mtime
   2687 +
   2688 +    header, @body = parse_file @file.path
   2689 +    @header = header - NON_EDITABLE_HEADERS
   2690 +    handle_new_text @header, @body
   2691 +    update
   2692 +
   2693 +    true
   2694 +  end
   2695 +
   2696    def killable?
   2697 +    if !@async_mode.nil?
   2698 +      return false if !@async_mode.killable?
   2699 +      if File.mtime(@file.path) > @mtime
   2700 +        @edited = true
   2701 +        header, @body = parse_file @file.path
   2702 +        @header = header - NON_EDITABLE_HEADERS
   2703 +        handle_new_text @header, @body
   2704 +        update
   2705 +      end
   2706 +    end
   2707      !edited? || BufferManager.ask_yes_or_no("Discard message?")
   2708    end
   2709 
   2710 From wmorgan-sup@masanjin.net  Sat Feb 26 17:04:13 2011
   2711 From: wmorgan-sup@masanjin.net (William Morgan)
   2712 Date: Sat, 26 Feb 2011 22:04:13 +0000
   2713 Subject: [sup-devel] sup-server revisited
   2714 In-Reply-To: <1298744738-sup-631@whisper>
   2715 References: <1298320404-sup-5972@masanjin.net> <1298744738-sup-631@whisper>
   2716 Message-ID: <1298757625-sup-9756@masanjin.net>
   2717 
   2718 Reformatted excerpts from Hamish's message of 2011-02-26:
   2719 > /var/lib/gems/1.8/gems/ffi-1.0.6/lib/ffi/library.rb:93:in `ffi_libraries': no library specified (LoadError)
   2720 >         from /var/lib/gems/1.8/gems/ffi-1.0.6/lib/ffi/library.rb:129:in `attach_function'
   2721 
   2722 You need to install your system's TokyoTyrant / TokyoCabinet libraries. The
   2723 OklahomaMixer gem is a ffi wrapper on those. Then it should work.
   2724 
   2725 > I also wasn't sure how to build and run whistlepig from source.
   2726 
   2727 `make rubygem` and then `gem install ruby/pkg/*.gem` will do it, but installing the public gem should be sufficient.
   2728 
   2729 I'm about to push some changes to Heliotrope that should make it easy to get
   2730 started with. I will announce here.
   2731 -- 
   2732 William <wmorgan-sup at masanjin.net>
   2733 
   2734 From wmorgan-sup@masanjin.net  Sat Feb 26 18:15:50 2011
   2735 From: wmorgan-sup@masanjin.net (William Morgan)
   2736 Date: Sat, 26 Feb 2011 23:15:50 +0000
   2737 Subject: [sup-devel] sup-server revisited
   2738 In-Reply-To: <1298757625-sup-9756@masanjin.net>
   2739 References: <1298320404-sup-5972@masanjin.net> <1298744738-sup-631@whisper>
   2740 	<1298757625-sup-9756@masanjin.net>
   2741 Message-ID: <1298762120-sup-1118@masanjin.net>
   2742 
   2743 Reformatted excerpts from William Morgan's message of 2011-02-26:
   2744 > I'm about to push some changes to Heliotrope that should make it easy to get
   2745 > started with. I will announce here.
   2746 
   2747 Check out the README and see if the instructions work for you.
   2748 -- 
   2749 William <wmorgan-sup at masanjin.net>
   2750 
   2751 From alvherre@alvh.no-ip.org  Sat Feb 26 20:15:31 2011
   2752 From: alvherre@alvh.no-ip.org (Alvaro Herrera)
   2753 Date: Sat, 26 Feb 2011 22:15:31 -0300
   2754 Subject: [sup-devel] editing messages outside of sup
   2755 In-Reply-To: <1298747943-sup-9749@whisper>
   2756 References: <1298239068-sup-6985@whisper> <1298747943-sup-9749@whisper>
   2757 Message-ID: <1298768518-sup-4041@alvh.no-ip.org>
   2758 
   2759 Excerpts from Hamish's message of s?b feb 26 16:23:13 -0300 2011:
   2760 > Excerpts from Hamish's message of Sun Feb 20 22:02:54 +0000 2011:
   2761 > > For the moment this work is in the async_message_edit branch. If no one
   2762 > > shouts about this being a terrible idea then I'll merge it into next
   2763 > > within a week.
   2764 > 
   2765 > No one shouted, so I've merged it into next. At the end of the email is
   2766 > the diff of the async_message_edit branch against where I started it.
   2767 
   2768 I like this general idea very much.  The bit about having to copy/paste
   2769 the file name is a bit of a pain, though.  I gave it a spin, and
   2770 excepting that one infelicity, I found it pretty neat.  I noticed no
   2771 problems at all.
   2772 
   2773 The way I envision this working is with a "vim --servername foo" window
   2774 being open at the time sup starts, and then "vim --remote" would open
   2775 the file in that server each time I edit an email.  Most likely, the
   2776 command to edit a file should be specified via a hook.
   2777 
   2778 Thanks for your work on this.
   2779 
   2780 -- 
   2781 ?lvaro Herrera <alvherre at alvh.no-ip.org>
   2782 
   2783 From roni@cs.utah.edu  Sat Feb 26 21:51:05 2011
   2784 From: roni@cs.utah.edu (Roni Choudhury)
   2785 Date: Sat, 26 Feb 2011 19:51:05 -0700
   2786 Subject: [sup-devel] editing messages outside of sup
   2787 In-Reply-To: <1298768518-sup-4041@alvh.no-ip.org>
   2788 References: <1298239068-sup-6985@whisper> <1298747943-sup-9749@whisper>
   2789 	<1298768518-sup-4041@alvh.no-ip.org>
   2790 Message-ID: <1298774629-sup-4062@medusa>
   2791 
   2792 Excerpts from Alvaro Herrera's message of 2011-02-26 18:15:31 -0700:
   2793 > Excerpts from Hamish's message of s?b feb 26 16:23:13 -0300 2011:
   2794 > > Excerpts from Hamish's message of Sun Feb 20 22:02:54 +0000 2011:
   2795 > > > For the moment this work is in the async_message_edit branch. If no one
   2796 > > > shouts about this being a terrible idea then I'll merge it into next
   2797 > > > within a week.
   2798 > > 
   2799 > > No one shouted, so I've merged it into next. At the end of the email is
   2800 > > the diff of the async_message_edit branch against where I started it.
   2801 > 
   2802 > I like this general idea very much.  The bit about having to copy/paste
   2803 > the file name is a bit of a pain, though.  I gave it a spin, and
   2804 > excepting that one infelicity, I found it pretty neat.  I noticed no
   2805 > problems at all.
   2806 > 
   2807 > The way I envision this working is with a "vim --servername foo" window
   2808 > being open at the time sup starts, and then "vim --remote" would open
   2809 > the file in that server each time I edit an email.  Most likely, the
   2810 > command to edit a file should be specified via a hook.
   2811 > 
   2812 > Thanks for your work on this.
   2813 > 
   2814 
   2815 Hamish, definitely thank you for doing something about this.  I
   2816 actually had a general question about this problem a while back - if
   2817 it is possible to edit the message independently via the approach you
   2818 took in this patch, why can't the editor be fired up in a
   2819 "nonblocking" kind of mode in the first place?  Something like a
   2820 fork()/exec() to start the editor, and then handling SIGCHLD rather
   2821 than calling a variant of wait() immediately.  The SIGCHLD handling
   2822 could check the return code from the editor, and then update the
   2823 message sending buffer appropriately.
   2824 
   2825 I promise, this is not to denigrate on your work at all... I have just
   2826 always been confused what would be wrong with the general approach I
   2827 just described.
   2828 
   2829 roni
   2830 
   2831 From sup@zevv.nl  Sun Feb 27 10:31:14 2011
   2832 From: sup@zevv.nl (Ico Doornekamp)
   2833 Date: Sun, 27 Feb 2011 16:31:14 +0100
   2834 Subject: [sup-devel] editing messages outside of sup
   2835 In-Reply-To: <1298774629-sup-4062@medusa>
   2836 References: <1298239068-sup-6985@whisper> <1298747943-sup-9749@whisper>
   2837 	<1298768518-sup-4041@alvh.no-ip.org> <1298774629-sup-4062@medusa>
   2838 Message-ID: <1298819507-sup-8138@pruts.nl>
   2839 
   2840 * On Sun Feb 27 03:51:05 +0100 2011, Roni Choudhury wrote:
   2841  
   2842 > Excerpts from Alvaro Herrera's message of 2011-02-26 18:15:31 -0700:
   2843 > > Excerpts from Hamish's message of s?b feb 26 16:23:13 -0300 2011:
   2844 > > > Excerpts from Hamish's message of Sun Feb 20 22:02:54 +0000 2011:
   2845 > > > > For the moment this work is in the async_message_edit branch. If no one
   2846 > > > > shouts about this being a terrible idea then I'll merge it into next
   2847 > > > > within a week.
   2848 > > > 
   2849 > > > No one shouted, so I've merged it into next. At the end of the email is
   2850 > > > the diff of the async_message_edit branch against where I started it.
   2851 > 
   2852 > Hamish, definitely thank you for doing something about this.  I
   2853 > actually had a general question about this problem a while back - if
   2854 > it is possible to edit the message independently via the approach you
   2855 > took in this patch, why can't the editor be fired up in a
   2856 > "nonblocking" kind of mode in the first place?  Something like a
   2857 > fork()/exec() to start the editor, and then handling SIGCHLD rather
   2858 > than calling a variant of wait() immediately.  The SIGCHLD handling
   2859 > could check the return code from the editor, and then update the
   2860 > message sending buffer appropriately.
   2861 
   2862 But in what tty should the forked editor run then? I guess the above
   2863 idea would work for spawning an editor under X, but can not be used when
   2864 running on a (remote) console. I guess the 'vim --remote' solution would
   2865 be feasable, bug I guess this is not simple enough to add as an
   2866 out-of-the-box solution.
   2867 
   2868 I guess one solution could be to add master/slave pty support to sup,
   2869 allowing one or more regular console based editors instances (vim, nano,
   2870 joe, etc) inside sup, passing all keyboard input to the slave process
   2871 except for a few (configurable) keystrokes for switching sup buffers.
   2872 
   2873 (I'd make an exception for running emacs inside sup, because emacs users
   2874 would probably prefer running their own lisp version of sup inside emacs
   2875 instead of emacs in sup)
   2876 
   2877 A quick proto would probably be not very hard to do, it is mostly a
   2878 matter of passing keyboard commands from the master sup to the editor
   2879 running in the slave pty, passing pty output back to the terminal and
   2880 handling the proper signals and ioctls() for keeping track of the window
   2881 size. This will work as long as all terminal control characters are
   2882 simple passed transparantly from the slave editor to the terminal, but
   2883 things quickly get nasty when you would want to do the terminal
   2884 emulation inside sup, and this is probably necessary for properly
   2885 handling screen redrawing and resizing.
   2886 
   2887 It's hard to guess how much work this would really be. Part of me says
   2888 it should not be too hard to find a simple terminal emulation
   2889 implentation in another piece of (L)GPL software and simply steal as
   2890 much as possible. Another part of my fears one would likely end up
   2891 reimplementing at least half of GNU screen, which is probably not a very
   2892 pleasant adventure.
   2893 
   2894 Ico
   2895 
   2896 -- 
   2897 :wq
   2898 ^X^Cy^K^X^C^C^C^C
   2899 
   2900 From damien.leone@fensalir.fr  Sun Feb 27 11:58:46 2011
   2901 From: damien.leone@fensalir.fr (Damien Leone)
   2902 Date: Sun, 27 Feb 2011 17:58:46 +0100
   2903 Subject: [sup-devel] [PATCH] line-cursor-mode: Add an option to disable
   2904 	automatic threads loading when scrolling down for slow CPUs
   2905 Message-ID: <1298825716-sup-3818@mailer>
   2906 
   2907 Sup guys,
   2908 
   2909 I run Sup on a Pogoplug-like device which has a slow CPU and I'm
   2910 always annoyed when I scroll down to reach an entry and then
   2911 everything stalls because some more threads are loading.
   2912 
   2913 This patch adds an option to disable this behavior.
   2914 
   2915 Cheers,
   2916 
   2917 -- 
   2918 Damien Leone <damien.leone at fensalir.fr>
   2919 
   2920 Web: http://dleone.fensalir.fr/
   2921 GPG: 0x82EB4DDF
   2922 -------------- next part --------------
   2923 A non-text attachment was scrubbed...
   2924 Name: 0001-line-cursor-mode-Add-an-option-to-disable-automatic-.patch
   2925 Type: application/octet-stream
   2926 Size: 1249 bytes
   2927 Desc: not available
   2928 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110227/233d4904/attachment.obj>
   2929 -------------- next part --------------
   2930 A non-text attachment was scrubbed...
   2931 Name: signature.asc
   2932 Type: application/pgp-signature
   2933 Size: 198 bytes
   2934 Desc: not available
   2935 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110227/233d4904/attachment.bin>
   2936 
   2937 From damien.leone@fensalir.fr  Sun Feb 27 12:09:43 2011
   2938 From: damien.leone@fensalir.fr (Damien Leone)
   2939 Date: Sun, 27 Feb 2011 18:09:43 +0100
   2940 Subject: [sup-devel] [PATCH] Mark the thread as read after the
   2941 	ThreadViewMode has been instancied and displayed
   2942 Message-ID: <1298826320-sup-8596@mailer>
   2943 
   2944 Sup guys,
   2945 
   2946 The current behavior is that when opening an unread thread, the unread
   2947 label is removed at the instanciation of the ThreadViewMode, thus it
   2948 makes the 'N' indicator useless.
   2949 
   2950 Even if new messages are automatically expanded it can be confusing
   2951 when you open some old message in the same thread, at the end you
   2952 might not remember which ones are new.
   2953 
   2954 This patch delays the moment when the unread label is removed so when
   2955 opening a thread you know exactly what are the new messages thanks to
   2956 that 'N' indicator.
   2957 
   2958 Cheers,
   2959 
   2960 -- 
   2961 Damien Leone <damien.leone at fensalir.fr>
   2962 
   2963 Web: http://dleone.fensalir.fr/
   2964 GPG: 0x82EB4DDF
   2965 -------------- next part --------------
   2966 A non-text attachment was scrubbed...
   2967 Name: 0001-Mark-the-thread-as-read-after-the-ThreadViewMode-has.patch
   2968 Type: application/octet-stream
   2969 Size: 1432 bytes
   2970 Desc: not available
   2971 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110227/dcf9a2b1/attachment.obj>
   2972 -------------- next part --------------
   2973 A non-text attachment was scrubbed...
   2974 Name: signature.asc
   2975 Type: application/pgp-signature
   2976 Size: 198 bytes
   2977 Desc: not available
   2978 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20110227/dcf9a2b1/attachment.bin>
   2979 
   2980 From dmishd@gmail.com  Sun Feb 27 12:20:55 2011
   2981 From: dmishd@gmail.com (Hamish)
   2982 Date: Sun, 27 Feb 2011 17:20:55 +0000
   2983 Subject: [sup-devel] editing messages outside of sup
   2984 In-Reply-To: <1298819507-sup-8138@pruts.nl>
   2985 References: <1298239068-sup-6985@whisper> <1298747943-sup-9749@whisper>
   2986 	<1298768518-sup-4041@alvh.no-ip.org>
   2987 	<1298774629-sup-4062@medusa> <1298819507-sup-8138@pruts.nl>
   2988 Message-ID: <1298826314-sup-276@whisper>
   2989 
   2990 Excerpts from Ico Doornekamp's message of Sun Feb 27 15:31:14 +0000 2011:
   2991 > > Hamish, definitely thank you for doing something about this.  I
   2992 > > actually had a general question about this problem a while back - if
   2993 > > it is possible to edit the message independently via the approach you
   2994 > > took in this patch, why can't the editor be fired up in a
   2995 > > "nonblocking" kind of mode in the first place?  Something like a
   2996 > > fork()/exec() to start the editor, and then handling SIGCHLD rather
   2997 > > than calling a variant of wait() immediately.  The SIGCHLD handling
   2998 > > could check the return code from the editor, and then update the
   2999 > > message sending buffer appropriately.
   3000 > 
   3001 > But in what tty should the forked editor run then? I guess the above
   3002 > idea would work for spawning an editor under X, but can not be used when
   3003 > running on a (remote) console. I guess the 'vim --remote' solution would
   3004 > be feasable, bug I guess this is not simple enough to add as an
   3005 > out-of-the-box solution.
   3006 
   3007 Now I've got the basic stuff working, I'd be up for adding to it.
   3008 Probably the best way would be to use a hook that could fire up
   3009 something using a fork()/exec().
   3010 
   3011 The way I'd see this working is that it would only be useful on a
   3012 machine running X (or Wayland, or whatever the Mac GUI is called).
   3013 
   3014 If you have ssh'ed to a remote machine then I don't think there is a
   3015 good way to manage this automatically without turning sup into screen
   3016 (which I think would be a bad idea), though I wouldn't want to get in
   3017 the way of imaginative hooks of course.
   3018 
   3019 Basically I would say that if you want to edit your message outside of
   3020 sup on a remote machine (via ssh) you should use screen/tmux in split
   3021 mode, or have 2 terminals that ssh to the same server, or something like
   3022 that. Opening the file tends to involve typing:
   3023 
   3024 $ vim /tmp/sup
   3025 
   3026 and then pressing tab, so I don't think it's too onerous. And if you
   3027 turned on X forwarding and had xsel installed you could just press
   3028 <Enter> (to copy the path to the clipboard) and then paste that into the
   3029 other terminal.
   3030 
   3031 Anyway, I'll have a think about how best to do a hook for this. I might
   3032 end up doing a blocking and a non-blocking variant - the blocking
   3033 variant could drop you straight back to reply-mode when it detects the
   3034 editor has exited, while the non-blocking mode would make it simpler to
   3035 write a hook, but you would have to manually exit async mode once
   3036 editing was done.
   3037 
   3038 Hamish
   3039 
   3040 From sup@zevv.nl  Sun Feb 27 14:44:15 2011
   3041 From: sup@zevv.nl (Ico Doornekamp)
   3042 Date: Sun, 27 Feb 2011 20:44:15 +0100
   3043 Subject: [sup-devel] editing messages outside of sup
   3044 In-Reply-To: <1298826314-sup-276@whisper>
   3045 References: <1298239068-sup-6985@whisper> <1298747943-sup-9749@whisper>
   3046 	<1298768518-sup-4041@alvh.no-ip.org>
   3047 	<1298774629-sup-4062@medusa> <1298819507-sup-8138@pruts.nl>
   3048 	<1298826314-sup-276@whisper>
   3049 Message-ID: <1298833983-sup-4830@pruts.nl>
   3050 
   3051 * On Sun Feb 27 18:20:55 +0100 2011, Hamish wrote:
   3052  
   3053 > Excerpts from Ico Doornekamp's message of Sun Feb 27 15:31:14 +0000 2011:
   3054 > > > Hamish, definitely thank you for doing something about this.  I
   3055 > > > actually had a general question about this problem a while back - if
   3056 > > > it is possible to edit the message independently via the approach you
   3057 > > > took in this patch, why can't the editor be fired up in a
   3058 > > > "nonblocking" kind of mode in the first place?  Something like a
   3059 > > > fork()/exec() to start the editor, and then handling SIGCHLD rather
   3060 > > > than calling a variant of wait() immediately.  The SIGCHLD handling
   3061 > > > could check the return code from the editor, and then update the
   3062 > > > message sending buffer appropriately.
   3063 > > 
   3064 > > But in what tty should the forked editor run then? I guess the above
   3065 > > idea would work for spawning an editor under X, but can not be used when
   3066 > > running on a (remote) console. I guess the 'vim --remote' solution would
   3067 > > be feasable, bug I guess this is not simple enough to add as an
   3068 > > out-of-the-box solution.
   3069 > 
   3070 > If you have ssh'ed to a remote machine then I don't think there is a
   3071 > good way to manage this automatically without turning sup into screen
   3072 > (which I think would be a bad idea), though I wouldn't want to get in
   3073 > the way of imaginative hooks of course.
   3074 
   3075 I've just hooked up a few lines of code (standalone, not part of sup)
   3076 that forks two editors (one joe, one vim) in ptys and handling both
   3077 terminal outputs with select(), allowing me to 'switch' between
   3078 processes on-the-fly using a magic keystroke. Redrawing is forced before
   3079 'switching' to a process by doing a TIOCSWINSZ ioctl and sending a
   3080 SIGWINCH twice, first with a fake, then with the true window size. This
   3081 is not quite a complete rewrite of screen, but seems to work quite well.
   3082 (Although I'm sure there are plenty of cases not covered by this crude
   3083 method of switching)
   3084 
   3085 When the infrastructure for background-editor hooks is there, I'm ready
   3086 to try to make the hook!
   3087 
   3088 -- 
   3089 :wq
   3090 ^X^Cy^K^X^C^C^C^C
   3091