Re: RFE - sort by from *address*
On Thu, Nov 20, 2003 at 09:38:42AM -0500, Allister MacLeod wrote:
> On Thu, Nov 20, 2003 at 05:44:50AM -0500, David Yitzchak Cohen wrote:
> > IMHO, the best solution is to sort by name, grouping identical email
> > addresses together regardless of the names involved (possibly having that
> > last bit controlled by an option). I admit there are problems with it
> > too, though.
> Good point. As far as "ultimate correctness" I think your solution is
> indeed best (and identical to what mutt currently does, right?)
> Still, some people--e.g. Will, and, on occasion, myself--will want to
> use fanciful "realnames"* but still keep things sorted by address. In
> that case, I'd suggest a configure-time toggle as the best solution.
This is not what mutt currently does - mutt currently sorts based solely on
name, followed by email address if a real name isn't set. This means that
if you happen to correspond with someone who sometimes sets a realname and
sometimes doesn't, emails from that person will be in two separate groups
(realname and email address) when sorted by From address.
Making it sort as suggested above (by name, keeping like email addresses
together) should not be too hard. In sort.c, in compare_from(), you'd
replace mutt_strcasecmp() with some new function that looks at both email
address and realname (if available) and did an appropriate comparison.
Nathan