Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: wmorgan-sup@masanjin.net (William Morgan)
Subject: [sup-talk] [PATCH] show matching aliases before email addresses in auto complete
Date: Sun, 09 Nov 2008 21:11:30 -0800	[thread overview]
Message-ID: <1226293522-sup-862@entry> (raw)
In-Reply-To: <1226091602-sup-7664@sgoldmanlinux.tower-research.com>

Hi Steve,

Thanks for the patch! A couple comments:

Reformatted excerpts from Steve Goldman's message of 2008-11-07:
> Suppose I have an alias "william" for "William Morgan
> <name at domain.blah>".

It might be nice to put this helpful explanatory text in the commit
message itself, so that it gets recorded along with the patch.

> +                  sort { |x,y| x_is_c = ContactManager.contact_for(x); y_is_c
> = ContactManager.contact_for(y); x_is_c && !y_is_c ? -1 : !x_is_c && y_is_c ? 1

I think you can express this more succinctly with something like

  sort_by { |c| [ContactManager.contact_for(c) ? 1 : 0, c] }

which makes use of both sort_by (Ruby's answer to the Schwartizan
transform) and the fact that arrays are sorted element-by-element.

Other than that, looks good and I like the idea.
-- 
William <wmorgan-sup at masanjin.net>


  reply	other threads:[~2008-11-10  5:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-07 21:05 Steve Goldman
2008-11-10  5:11 ` William Morgan [this message]
2008-11-10  5:14   ` William Morgan
2008-11-10 14:55     ` Steve Goldman
2008-11-23 19:39 Steve Goldman
2008-11-27  0:29 ` 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=1226293522-sup-862@entry \
    --to=wmorgan-sup@masanjin.net \
    /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