Subject: Re: [sup-talk] Missing the save index option (patch attached)

From: William Morgan <[email-masked]>
Date: Sun, 17 Jan 2010 18:22:40 -0500

Reformatted excerpts from Israel Herraiz's message of 2010-01-17:
> I am sending to the list just in case the patch is useful for others
> too. If there are not strong objections to this change, I suggest to
> merge it with Sup.

Applied to insta-save and remerged into next. Thanks!
-- 
William <[email-masked]>
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Ben Walton <[email-masked]>
Date: Sun, 17 Jan 2010 11:12:24 -0500

Excerpts from William Morgan's message of Sun Jan 17 10:25:59 -0500 2010:

> (Also has the nice side-effect of making '$' not go to the bottom of the
> screen, which was driving me batty.)

Yes, that has been hard for me to unlearn too.

-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: William Morgan <[email-masked]>
Date: Sun, 17 Jan 2010 10:25:59 -0500

Reformatted excerpts from Israel Herraiz's message of 2010-01-17:
> I don't know if someone else in this list is also missing the
> possibility of flushing the index from Sup. I have done the attached
> changes to my Sup, that recovers a sort-of the old save index option.

I believe we've discussed this before and decided it would be a good
idea. Any objections to adding this to the insta-save branch?

---

From: Israel Herraiz <[email-masked]>
Date: Sun, 17 Jan 2010 13:36:16 +0100

Hi all,

since the last changes to get rid of the save option and to migrate to
the Xapian index, I am really missing the save index option.

Currently, when Sup exits, all the changes to the index are flushed,
and in my case it takes ages because I am a heavy email load user. For
me that is a problem, because my Sup is always open, and I usually
suspend my laptop. From time to time, my laptop won't wake up, and I
am forced to do an unclean reboot. When I open again Sup, all the
changes I did (archiving threads, etc) are lost because the index was
not flushed.

I know that I can use the XAPIAN_FLUSH_THRESHOLD option, but if I use
that option, when the threshold is reached it interrupts me while I am
dealing with my email, and I have to wait some seconds until the index
is flushed. This behavior is very annoying.

I don't know if someone else in this list is also missing the
possibility of flushing the index from Sup. I have done the attached
changes to my Sup, that recovers a sort-of the old save index
option. I am sending to the list just in case the patch is useful for
others too. If there are not strong objections to this change, I
suggest to merge it with Sup.

Cheers,
Israel

---
 lib/sup/modes/thread-index-mode.rb |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
index a5bd344..3a1bb76 100644
--- a/lib/sup/modes/thread-index-mode.rb
+++ b/lib/sup/modes/thread-index-mode.rb
@@ -37,6 +37,7 @@ EOS
     k.add :toggle_spam, "Mark/unmark thread as spam", 'S'
     k.add :toggle_deleted, "Delete/undelete thread", 'd'
     k.add :kill, "Kill thread (never to be seen in inbox again)", '&'
+    k.add :flush_index, "Flush all changes now", '$'
     k.add :jump_to_next_new, "Jump to next new thread", :tab
     k.add :reply, "Reply to latest message in a thread", 'r'
     k.add :reply_all, "Reply to all participants of the latest message in a thread", 'G'
@@ -449,6 +450,12 @@ EOS
     multi_kill [t]
   end
 
+  def flush_index
+    @flush_id = BufferManager.say "Flushing index..."
+    Index.save_index
+    BufferManager.clear @flush_id
+  end
+  
   ## m-m-m-m-MULTI-KILL
   def multi_kill threads
     UndoManager.register "killing #{threads.size.pluralize 'thread'}" do
-- 
1.6.6
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk