William Morgan [Mon, 4 May 2009 12:29:54 +0000 (05:29 -0700)]
make sup-sync's --start-at actually useful
Using --start-at with sup-sync will now seek forward to the next valid message
if given an offset that's not on a message boundary. This makes it possible to
use that option without going through the laborious process of finding the
exact message boundary.
Also die unless --start-at is used with only one source, since using it across
multiple sources is almost definitely an error. (And if that's really what you
want, you can just call sup-sync multiple times.)
William Morgan [Tue, 28 Apr 2009 13:34:27 +0000 (09:34 -0400)]
fix mbox splitting regexp
I dunno. This helps with the "From problem", but at the expense of being
too specific than the mbox spec really demands. I don't think there's a
really right solution, in general (due to the mbox format being a
fundamentally broken one), but I'm hoping this will work with all modern
mbox files.
William Morgan [Sun, 26 Apr 2009 22:18:26 +0000 (18:18 -0400)]
don't automatically parse header on Message#new
You must now explicitly call #parse_header (e.g. when loading
from the index) or #load_from_source! (e.g. when loading from
disk).
This prevents redundant loading from the source when adding to the
index, as #snippet must be called before adding, and that requires
loading the entire message from the source.
William Morgan [Sun, 26 Apr 2009 22:16:48 +0000 (18:16 -0400)]
make Index#sync_message take an extra speedy arg
Previously it would check the index if docid and entry were nil,
even though nil is a valid result of a previous check. Add an
extra argument controlling whether this check is performed again.
William Morgan [Sun, 26 Apr 2009 15:44:37 +0000 (11:44 -0400)]
change email header parsing. MASSIVE SPEEDUP!
restructure the email header parsing code to improve speed and to
improve API. MBox::read_header now returns a hash containing all
headers, with keys downcased but nothing else.
update Message#parse_header to accept this new format.
update unit tests to reflect new format.
The exciting news is that changes in how the parsing works have resulted
in a 480% speedup in message parsing speed (634 message/s vs 132
messages/s on my machine), across ALL source types. hell yes.
Resync listable_labels and applyable_labels with reality
The listable_labels method listed all labels except unread
which seems an unneeded complication/restriction, so it's
renamed to all_labels. The applyable_labels was in fact
user-defined labels so it's renamed to user_defined_labels.
When responding to an email with a recipient_email field (i.e. an Envelope-To
header), look up the name in the account list, but keep the original email
address.
William Morgan [Wed, 25 Mar 2009 15:49:56 +0000 (08:49 -0700)]
overwrite from and to fields in index when saving a message
See comments in the code. This allows you to forcibly update the from/to
address stored in the index for messages, which means you can correct
the bad stuff stored in there due to previous versions of Sup that
canonicalized email addresses.
William Morgan [Wed, 25 Mar 2009 13:25:48 +0000 (06:25 -0700)]
rework Rakefile for "rake gem" and "rake tarball"
Move version into sup-version.rb and filelist into sup-files.rb. Rake gem
now builds the gem; rake tarball builds the tarball. No Hoe involved.
Update release-script accordingly.
William Morgan [Wed, 25 Mar 2009 12:33:45 +0000 (05:33 -0700)]
make ThreadIndexMode#save optionally threaded
The call to #save during #cleanup needs to block because this is where
state gets saved immediately before exit. Other calls to #save, e.g.
those triggered by "$", can be backgrounded.
William Morgan [Mon, 23 Mar 2009 15:55:09 +0000 (08:55 -0700)]
don't add :unread and :inbox for dupes
Allow merging in of labels from duplicate messages, EXCEPT for
:unread and :inbox labels. (These two have special semantics
and, in contrast to the other special-semantics labels, might
appear on a new message.)
William Morgan [Mon, 23 Mar 2009 14:11:16 +0000 (10:11 -0400)]
update unit tests to reflect header parsing
Blank headers now have a value of "", not nil. Nothing wrong with that.
The test captures behavior that doesn't really matter, but I've updated
it to at least reflect reality.
Mike Stipicevic [Mon, 16 Feb 2009 05:39:50 +0000 (00:39 -0500)]
Added UndoManager class
The UndoManager keeps a list of lambdas that undo actions. It's designed to be used by keypress hooks. It is initialized in the main sup thread along with UpdateManager, etc.
Steve Goldman [Sun, 23 Nov 2008 20:59:49 +0000 (15:59 -0500)]
use offscreen lines for textfield overflow
In the To:, Cc:, Bcc:, etc., prompts, the TextField was initializing
an NCurses form with zero offscreen lines. So when the user typed too
many addresses at the prompt the cursor wrapped around and everything
they had typed was clobbered. This patch initializes the form object
to have 256 offscreen lines (I had no rationale for 256 except that it
is a nice, big power of two). Now the user can type plenty of names
and the wrap-around works as the user would expect.
Steve Goldman [Sun, 23 Nov 2008 18:53:09 +0000 (13:53 -0500)]
Display a default save path for attachments
Let the user specify a default path for saving attachments with
:default_attachment_save_dir: in config.yaml, and display this path in
front of the filename when saving an attachment in thread view mode.
Rich Lane [Tue, 11 Nov 2008 17:52:50 +0000 (12:52 -0500)]
fix class name collision in testcases
'rake test' was broken because both testcases' classes had the same name and
the setup method was overridden. This patch changes the class name in
test_mbox_parsing.