]> git.cworth.org Git - sup/blobdiff - lib/sup.rb
explicitly load messages in testcase
[sup] / lib / sup.rb
index 3afac5e012b0e9438434981fa2ebaae068ec9ea4..83738204ed0ba6cee8bb466b5eeb15085cc1ad09 100644 (file)
@@ -5,19 +5,10 @@ require 'thread'
 require 'fileutils'
 require 'gettext'
 require 'curses'
-
-## the following magic enables wide characters when used with a ruby
-## ncurses.so that's been compiled against libncursesw. (note the w.) why
-## this works, i have no idea. much like pretty much every aspect of
-## dealing with curses.  cargo cult programming at its best.
-
-require 'dl/import'
-module LibC
-  extend DL::Importable
-  dlload Config::CONFIG['arch'] =~ /darwin/ ? "libc.dylib" : "libc.so.6"
-  extern "void setlocale(int, const char *)"
+begin
+  require 'fastthread'
+rescue LoadError
 end
-LibC.setlocale(6, "")  # LC_ALL == 6
 
 class Object
   ## this is for debugging purposes because i keep calling #id on the
@@ -114,7 +105,7 @@ module Redwood
   end
 
   def start
-    Redwood::SentManager.new Redwood::SENT_FN
+    Redwood::SentManager.new $config[:sent_source] || 'sup://sent'
     Redwood::ContactManager.new Redwood::CONTACT_FN
     Redwood::LabelManager.new Redwood::LABEL_FN
     Redwood::AccountManager.new $config[:accounts]
@@ -123,6 +114,7 @@ module Redwood
     Redwood::PollManager.new
     Redwood::SuicideManager.new Redwood::SUICIDE_FN
     Redwood::CryptoManager.new
+    Redwood::UndoManager.new
   end
 
   def finish
@@ -219,6 +211,7 @@ else
     :confirm_top_posting => true,
     :discard_snippets_from_encrypted_messages => false,
     :default_attachment_save_dir => "",
+    :sent_source => "sup://sent"
   }
   begin
     FileUtils.mkdir_p Redwood::BASE_DIR
@@ -255,7 +248,7 @@ end
     Redwood::log "using character set encoding #{$encoding.inspect}"
   else
     Redwood::log "warning: can't find character set by using locale, defaulting to utf-8"
-    $encoding = "utf-8"
+    $encoding = "UTF-8"
   end
 
 ## now everything else (which can feel free to call Redwood::log at load time)
@@ -279,6 +272,7 @@ require "sup/tagger"
 require "sup/draft"
 require "sup/poll"
 require "sup/crypto"
+require "sup/undo"
 require "sup/horizontal-selector"
 require "sup/modes/line-cursor-mode"
 require "sup/modes/help-mode"