Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: "Edward Z. Yang" <ezyang@MIT.EDU>
To: sup-talk <sup-talk@rubyforge.org>
Subject: [sup-talk] A useful contacts list trick
Date: Thu, 30 May 2013 15:06:35 -0700	[thread overview]
Message-ID: <1369951537-sup-9257@javelin> (raw)

I had always been bothered by the fact that my contacts autocomplete
would never seem to work half of the time.  I finally found out how
to vastly improve my it:

diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
index 444589a..077dc94 100644
--- a/lib/sup/buffer.rb
+++ b/lib/sup/buffer.rb
@@ -553,7 +553,7 @@ EOS
     default = default_contacts.is_a?(String) ? default_contacts : default_contacts.map { |s| s.to_s }.join(", ")
     default += " " unless default.empty?
 
-    recent = Index.load_contacts(AccountManager.user_emails, :num => 10).map { |c| [c.full_address, c.email] }
+    recent = Index.load_contacts(AccountManager.user_emails, :num => 100).map { |c| [c.full_address, c.email] }
     contacts = ContactManager.contacts.map { |c| [ContactManager.alias_for(c), c.full_address, c.email] }
 
     completions = (recent + contacts).flatten.uniq

Hope this helps someone else out :)

Cheers,
Edward
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


                 reply	other threads:[~2013-05-30 22:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1369951537-sup-9257@javelin \
    --to=ezyang@mit.edu \
    --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