sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit d0f57caaf652ffbe9ede9128c5933c65a736ecd2
parent 812baa090e0a280cac86c9a6e08e5fea3dafb020
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Wed, 23 May 2007 01:36:18 +0000

various minor bugfixes

git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@411 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M bin/sup | 2 +-
M bin/sup-sync | 2 ++
M doc/TODO | 2 +-
M lib/sup/buffer.rb | 2 ++
4 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/bin/sup b/bin/sup
@@ -204,7 +204,7 @@ begin
             BufferManager.spawn "Edit message", r
             r.edit
           else
-            b = BufferManager.spawn_unless_exists(:draft) do
+            b = BufferManager.spawn_unless_exists("All drafts") do
               mode = LabelSearchResultsMode.new [:draft]
             end
             b.mode.load_threads :num => b.content_height
diff --git a/bin/sup-sync b/bin/sup-sync
@@ -192,6 +192,8 @@ begin
     $stderr.puts "Scanned #{num_scanned}, added #{num_added}, updated #{num_updated} messages from #{source}."
     $stderr.puts "Restored state on #{num_restored} (#{100.0 * num_restored / num_scanned}%) messages." if num_restored > 0
   end
+rescue FatalSourceError => e
+  $stderr.puts "Sorry, I couldn't communicate with a source: #{e.message}"
 rescue Exception => e
   File.open("sup-exception-log.txt", "w") { |f| f.puts e.backtrace }
   raise
diff --git a/doc/TODO b/doc/TODO
@@ -7,7 +7,7 @@ _ bugfix: ferret flakiness: just added message but can't find it.
 _ bugfix: when one new message comes into an imap folder, we don't
    catch it until a reload (sometimes?)
 _ bugfix: add new message counts until keypress
-_ bugfix: readlock
+_ bugfix: deadlock
 _ split out threading & message chunk parsing to a separate library
 _ decode RFC 2047 ("encoded word") headers
   - see: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/101949, http://dev.rubyonrails.org/ticket/6807
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
@@ -196,6 +196,7 @@ class BufferManager
   def [] n; @name_map[n]; end
   def []= n, b
     raise ArgumentError, "duplicate buffer name" if b && @name_map.member?(n)
+    raise ArgumentError, "title must be a string" unless n.is_a? String
     @name_map[n] = b
   end
 
@@ -258,6 +259,7 @@ class BufferManager
   end
 
   def spawn title, mode, opts={}
+    raise ArgumentError, "title must be a string" unless title.is_a? String
     realtitle = title
     num = 2
     while @name_map.member? realtitle