Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: Israel Herraiz <israel.herraiz@gmail.com>
To: sup-talk <sup-talk@rubyforge.org>
Subject: [sup-talk] Missing the save index option (patch attached)
Date: Sun, 17 Jan 2010 13:36:16 +0100	[thread overview]
Message-ID: <1263731685-sup-8287@duck> (raw)

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
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


             reply	other threads:[~2010-01-17 12:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-17 12:36 Israel Herraiz [this message]
2010-01-17 15:25 ` William Morgan
2010-01-17 16:12   ` Ben Walton
2010-01-17 23:22 ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1263731685-sup-8287@duck \
    --to=israel.herraiz@gmail.com \
    --cc=sup-talk@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox