From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.224.21.196 with SMTP id k4csp22994qab; Thu, 30 May 2013 15:11:58 -0700 (PDT) X-Received: by 10.60.116.164 with SMTP id jx4mr4907611oeb.29.1369951917407; Thu, 30 May 2013 15:11:57 -0700 (PDT) Return-Path: Received: from rubyforge.org ([50.56.192.79]) by mx.google.com with ESMTP id yx1si25177278obb.135.2013.05.30.15.11.57 for ; Thu, 30 May 2013 15:11:57 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 50.56.192.79 as permitted sender) client-ip=50.56.192.79; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 50.56.192.79 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 4E8662E162; Thu, 30 May 2013 22:11:58 +0000 (UTC) X-Greylist: delayed 300 seconds by postgrey-1.31 at rubyforge; Thu, 30 May 2013 22:11:47 UTC Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu [18.9.25.15]) by rubyforge.org (Postfix) with ESMTP id C878B2E14B for ; Thu, 30 May 2013 22:11:47 +0000 (UTC) X-AuditID: 1209190f-b7f256d000005616-e9-51a7cd721518 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP id E0.2A.22038.27DC7A15; Thu, 30 May 2013 18:06:42 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id r4UM6g5E017663 for ; Thu, 30 May 2013 18:06:42 -0400 Received: from localhost (DNab4046a3.Stanford.EDU [171.64.70.163]) (authenticated bits=0) (User authenticated as ezyang@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r4UM6d6j004550 for ; Thu, 30 May 2013 18:06:41 -0400 To: sup-talk From: "Edward Z. Yang" Date: Thu, 30 May 2013 15:06:35 -0700 Message-Id: <1369951537-sup-9257@javelin> User-Agent: Sup/git X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAIsWRmVeSWpSXmKPExsUixG6nolt0dnmgwb1jOhbTn7M5MHrs2zeR OYAxissmJTUnsyy1SN8ugSujramdsWA5e8WiLY/YGhj/s3YxcnJICJhIvG3/BWWLSVy4t56t i5GLQ0hgH6PE5M6JLBDOOUaJ2dtXsEI4U5kktuzsBcpwcDALqEusnycE0i0ioCqxo+slE4jN BhR+dOwp2FRhoPiu81fZQWwWILvtzWcWEJtXQFPi4I1DYHFRAWGJJ0eamUFsZgF5ieats5kn MPLOQtgwC0lmASPTKkbZlNwq3dzEzJzi1GTd4uTEvLzUIl0TvdzMEr3UlNJNjKCA4ZTk38H4 7aDSIUYBDkYlHt6MpOWBQqyJZcWVuYcYJTmYlER5f54CCvEl5adUZiQWZ8QXleakFh9ilOBg VhLhlTwKlONNSaysSi3Kh0lJc7AoifNeTbnpLySQnliSmp2aWpBaBJOV4eBQkuDddAaoUbAo NT21Ii0zpwQhzcTBCTKcB2j4bZAa3uKCxNzizHSI/ClGRSlx3jMgCQGQREZpHlwvLKJfMYoD vSLM+wGkigeYDOC6XwENZgIa/MQabHBJIkJKqoHRbdkaw90vzKtdT54SU7p/a4txbmPI1I6K yBarE9fXv5i1MWUt6/SEc+dssnUfy9irutxYNWnphBob+Yn3Vsc4JHRa9Tg9e7xky79CwYx6 sR7Pv3fvKE6Ns6q6Wyag5zCRc5XlxQprtsZW3cw35n7CRm+9JtdXne2NaOkz+DczoTPR6nZ+ ebkSS3FGoqEWc1FxIgDsTyffwwIAAA== Subject: [sup-talk] A useful contacts list trick X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org 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