<<< Date Index >>>     <<< Thread Index >>>

Re: RFE - sort by from *address*



On Wed, Nov 19, 2003 at 07:22:32PM -0800, Will Yardley wrote:
> So, if there isn't a way to do this currently, I was wondering if people
> thought this would be a useful feature (either as a different sort key,
> or as an on/off option for various operations that sort by "from"). This
> seems more logical, since generally you're looking for emails from a
> particular person to be grouped together.

Hey look!  Only a month later :) a patch that will force sorting by email
address.  I've added a new option, ignore_realname, that, when set, causes
mutt to ignore any realname when sorting by From or To.  A side effect is
that when you sort by From or To and set this option, you'll see email
addresses (and not real names) in the index.  

This patch doesn't affect the behavior of reverse_alias - if reverse_alias
is set, mutt will still sort by alias when available.  Previously in this
thread someone was saying it doesn't work, but I think it's his specific
configuration, as clearly I'm not the only one for whom reverse_alias
affects sorting - wishlist #1576 (mentioned in this thread) shows it works.

Nathan
--- mutt.h.old  Thu Dec 25 17:02:42 2003
+++ mutt.h      Thu Dec 25 17:26:06 2003
@@ -352,6 +352,7 @@
   OPTHIDETOPLIMITED,
   OPTHIDETOPMISSING,
   OPTIGNORELISTREPLYTO,
+  OPTIGNOREREALNAME,
 #ifdef USE_IMAP
   OPTIMAPLSUB,
   OPTIMAPPASSIVE,
--- init.h.old  Thu Dec 25 16:53:52 2003
+++ init.h      Thu Dec 25 17:33:41 2003
@@ -756,6 +756,13 @@
   ** function; \fIgroup-reply\fP will reply to both the sender and the
   ** list.
   */
+  { "ignore_realname",         DT_BOOL, R_BOTH, OPTIGNOREREALNAME, 0 },
+  /*
+  ** .pp
+  ** When this variable is set and a mailbox is sorted by From or To, mutt
+  ** ignores the real name for sorting and does not display real names in 
+  ** the index.
+  */
 #ifdef USE_IMAP
   { "imap_authenticators", DT_STR, R_NONE, UL &ImapAuthenticators, UL 0 },
   /*
--- sort.c.old  Thu Dec 25 17:04:04 2003
+++ sort.c      Thu Dec 25 17:26:24 2003
@@ -94,7 +94,7 @@
   {
     if (option (OPTREVALIAS) && (ali = alias_reverse_lookup (a)) && 
ali->personal)
       return ali->personal;
-    else if (a->personal)
+    else if (a->personal  && ! option (OPTIGNOREREALNAME))
       return a->personal;
     else if (a->mailbox)
       return (mutt_addr_for_display (a));
--- PATCHES.old Thu Dec 25 17:36:49 2003
+++ PATCHES     Thu Dec 25 17:34:39 2003
@@ -0,0 +1 @@
+patch-1.5.5.1.nhd.ignorerealname.1