From d0f57caaf652ffbe9ede9128c5933c65a736ecd2 Mon Sep 17 00:00:00 2001 From: wmorgan Date: Wed, 23 May 2007 01:36:18 +0000 Subject: [PATCH] various minor bugfixes git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@411 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- bin/sup | 2 +- bin/sup-sync | 2 ++ doc/TODO | 2 +- lib/sup/buffer.rb | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/sup b/bin/sup index e9638db..c28aba5 100644 --- 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 index 12a830a..00557a3 100644 --- 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 index d596648..9185e05 100644 --- 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 index 5642727..80eb18e 100644 --- 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 -- 2.45.2