Subject: [sup-talk] [PATCH 1/2] preemptively load messages when scrolling

From: [email-masked] (Rich Lane)
Date: Sun, 23 Aug 2009 11:46:10 -0700

---
 lib/sup/modes/line-cursor-mode.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/modes/line-cursor-mode.rb b/lib/sup/modes/line-cursor-mode.rb
index 246f2b5..0b1fd1d 100644
--- a/lib/sup/modes/line-cursor-mode.rb
+++ b/lib/sup/modes/line-cursor-mode.rb
@@ -77,7 +77,7 @@ protected
   end
 
   def cursor_down
-    call_load_more_callbacks buffer.content_height if @curpos == lines - 1
+    call_load_more_callbacks buffer.content_height if @curpos >= lines - [buffer.content_height/2,1].max
     return false unless @curpos < lines - 1
 
     if @curpos >= botline - 1
-- 
1.6.4

---

From: [email-masked] (Rich Lane)
Date: Sun, 23 Aug 2009 11:46:11 -0700

---
 bin/sup                            |    1 +
 lib/sup/modes/thread-index-mode.rb |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/sup b/bin/sup
index 3d5b6c1..f3c6771 100755
--- a/bin/sup
+++ b/bin/sup
@@ -58,6 +58,7 @@ if $opts[:list_hooks]
 end
 
 Thread.abort_on_exception = true # make debugging possible
+Thread.current.priority = 1 # keep ui responsive
 
 module Redwood
 
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
index fb6b2ce..177431b 100644
--- a/lib/sup/modes/thread-index-mode.rb
+++ b/lib/sup/modes/thread-index-mode.rb
@@ -76,8 +76,7 @@ EOS
     @last_load_more_size = nil
     to_load_more do |size|
       next if @last_load_more_size == 0
-      load_threads :num => 1, :background => false
-      load_threads :num => (size - 1),
+      load_threads :num => size,
                    :when_done => lambda { |num| @last_load_more_size = num }
     end
   end
@@ -627,6 +626,7 @@ EOS
         BufferManager.draw_screen
         last_update = Time.now
       end
+      ::Thread.pass
       break if @interrupt_search
     end
     @ts.threads.each { |th| th.labels.each { |l| LabelManager << l } }
-- 
1.6.4

---

From: [email-masked] (Carl Worth)
Date: Wed, 26 Aug 2009 14:15:36 -0700

My message here really has nothing to do with Rich's patches
specifically, (so sorry about that), but his patches happened to
provide the perfect context for an issue I wanted to bring up. As is
typical of git-formatted patches, Rich's emails have subject lines
from his commit messages:

    [sup-talk] [PATCH 1/2] preemptively load messages when scrolling
    [sup-talk] [PATCH 2/2] ui responsiveness tweaks

As far as the git commits go, this subject line is one of the most
essential pieces of metadata to accompany the patch. Yet by default
sup doesn't display it at all, (requiring keypresses to display the
header and find the subject line). I think what I would like is for
sup to display the subject line everytime it changes significantly in
a thread, (specifically not regarding things like an initial "Re: "
getting added as significant).

I think I'd be willing to spend an entire line's worth of screen real
estate for this information---it's quite useful when people do
meaningful subject changes for sub-threads.

-Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090826/5b3011d5/attachment.bin>

---

From: [email-masked] (Ingmar Vanhassel)
Date: Thu, 27 Aug 2009 04:54:36 +0200

> meaningful subject changes for sub-threads.

Yeah, I completely agree. That would make sup even better for me.

Maybe this could be implemented as a 3-way toggle, toggling between
  - don't show subjects (current default?)
  - only show interesting subject changes
  - always show subject
in a threadview.

-Ingmar
-- 
Exherbo KDE, X.org maintainer

---

From: [email-masked] (Rich Lane)
Date: Tue, 01 Sep 2009 23:59:57 -0400

Just making sure these patches don't drop off your radar. I know
searching is supposed to make scrolling obsolete, but some Mutt users
asked for this. They'll see the light eventually.

---

From: [email-masked] (William Morgan)
Date: Thu, 03 Sep 2009 10:58:16 -0700

Both of these patches are on the branch preemptive-loading, merged into
next. Thanks! It's a nice touch.

I didn't really notice any differe from thread prioritization and
Thread.pass call, but maybe that's my setup. Regardless, it can't hurt.

I also reworked the load-more callback mechanism to be a little more
thread safe and a little less insane. Now it uses a queue and has a
dedicated loader thread pulling things off of it. Message thread loading
is currently configured to just drop concurrent calls, so it should work
fine.

Now, all we need is a faster cursor in thread-index-mode. I will grant a
Sup medal to anyone who can make that happen!
-- 
William <wmorgan-sup at masanjin.net>