Carl Worth [Wed, 26 Aug 2009 21:35:25 +0000 (14:35 -0700)]
make SUP_LOG_LEVEL self-documenting
The idea here is that if someone is looking at the log and not seeing
the information of interest, then the log itself should tell them
how to get more information, (by suggesting to set SUP_LOG_LEVEL
to the next lower level).
Rich Lane [Sat, 22 Aug 2009 18:28:15 +0000 (11:28 -0700)]
add Message#load_from_index! shortcut
Message#parse_header is slow, taking up to 2/3 of the time spent loading
threads in thread-index-mode. This patch adds a shortcut method that the index
can use to efficiently initialize a message.
Kevin Riggle [Fri, 21 Aug 2009 01:57:42 +0000 (21:57 -0400)]
add an after-add-message hook
I want to do some unrelated processing on each message I receive, but I
don't want to block the message being added to the index. This patch
adds a hook which runs /after/ the message is added to the index.
William Morgan [Mon, 24 Aug 2009 22:32:39 +0000 (18:32 -0400)]
fix proc locals, which must use the old method trick
For hook locals that are specified as procs (usually for performance
reasons), use methods instead of local variables. Sadly you don't get
all the regular variable semantics, but it is the only option for
delayed evaluation AFAICT.
Carl Worth [Thu, 20 Aug 2009 00:21:59 +0000 (17:21 -0700)]
convert a couple of arrays to sets for labels
This fixes some crashes when using 'l' in thread-view-mode that
have been present since commit 7aea418a8a62b7070eee764475fcfc0bdd8d58dd
("maintain labels as Sets rather than arrays").
Benoît PIERRE [Wed, 19 Aug 2009 20:56:55 +0000 (22:56 +0200)]
fix garbaged text in textfield when using ncursesw
Apparently, field_buffer content is not initialized to blanks when using
the wide-character version of ncurses. Forcing a call to
set_field_buffer fix the problem.
William Morgan [Tue, 11 Aug 2009 19:34:50 +0000 (15:34 -0400)]
refactor index access into three methods and rewrite PollManager#each_message_from
Couple big changes in this commit, but they're all tied together.
Index.sync_message is refactored into three separate methods: add_message,
update_message and update_message_state. The intention is that add_message is
called for new messages only, update_message is called for changing the method
body on disk (e.g. when we see multiple copies of the same message, or by
DraftManager when the text of a draft is changes), and update_message_state is
called when the labels on a message change. So indexes that differentiate those
operations can exhibit more natural performance characteristics.
Also, PollManager.add_messages_from has been renamed to each_message_from and
changed significantly. It now *only* yields successive messages; it does not
load the index version of the message, and it does not auto-add the message to
the index. (In fact, it ignores the result of the block.) There's also a new
method called add_new_message that calls Index.add_message and then relays the
update to other GUI elements.
There was a lot of refactoring of sup-sync that was part of this. Probably
not strictly necessary but it was too hard to untangle the changes.
William Morgan [Fri, 7 Aug 2009 01:33:19 +0000 (21:33 -0400)]
refactor index locking interaction and replace suicidemanager
Since SIGTERM now works, we have a better way of killing a remote
process than SuicideManager. So replace that with a $die global.
Also refactor the interactive locking code into a separate module
so as not to pollute index.rb with such trivial concerns.
William Morgan [Thu, 6 Aug 2009 16:21:46 +0000 (12:21 -0400)]
rewrap getch in select, handle sigwinch manually
This is necessary to operate with many versions of the ruby ncurses library,
all of which block threads when getch is being called. But this means we can't
use getch to determine a sigwich, since we won't see it until an actual key is
pressed. so we handle sigwinch ourselves.
William Morgan [Wed, 5 Aug 2009 19:40:02 +0000 (15:40 -0400)]
improve ncurses key handling for sigwinch and sigint
see comments. adding a nodelay call before each getch means we don't need a
select() call, which means that we can get sigwinch and sigint signals from
ncurses.