+#' stupid ruby-mode
+ end
+ end
+
+ desynced_sources = Index.sources.select { |s| s.error.is_a? OutOfSyncSourceError }
+ unless desynced_sources.empty?
+ BufferManager.spawn_unless_exists("Out-of-sync source notification for #{broken_sources.join(',')}", opts) do
+ TextMode.new(<<EOM)
+Out-of-sync source notification
+-------------------------------
+
+Hi there. It looks like one or more sources has fallen out of sync
+with my index. This can happen when you modify these sources with
+other email clients. (Sorry, I don't play well with others.)
+
+Until this is corrected, messages from these sources cannot be viewed,
+and new messages will not be detected. Luckily, this is easy to correct!
+
+#{desynced_sources.map do |s|
+ "Source: " + s.to_s +
+ "\n Error: " + s.error.message.wrap(70).join("\n ") +
+ "\n Fix: sup-sync --changed #{s.to_s}"
+ end}
+EOM
+#' stupid ruby-mode
+ end