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

[PATCH] "unreferenced messages" pattern



Here is a simple patch that adds the pattern "~$" for unreferenced
messages (or "thread leafs"), as Bert Buchholz suggested in a usenet
post[*]. E.g., this may be useful for support lists, since you could do
stuff like "color index red default '~$ !~f support@xxxxxxx'". Like
"~=", this pattern requires threaded view, since it doesn't check the
mailbox for references itself (which would probably be overkill).

Holger

[*] <bfiqp6$f3b8e$1@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

-- 
PGP fingerprint:  F1F0 9071 8084 A426 DD59  9839 59D3 F3A1 B8B5 D3DE
diff -ru mutt-1.5.6.orig/mutt.h mutt-1.5.6/mutt.h
--- mutt-1.5.6.orig/mutt.h      Sun Feb  1 18:15:17 2004
+++ mutt-1.5.6/mutt.h   Tue Mar  9 15:58:15 2004
@@ -217,6 +217,7 @@
   M_DATE,
   M_DATE_RECEIVED,
   M_DUPLICATED,
+  M_UNREFERENCED,
   M_ID,
   M_BODY,
   M_HEADER,
diff -ru mutt-1.5.6.orig/pattern.c mutt-1.5.6/pattern.c
--- mutt-1.5.6.orig/pattern.c   Wed Nov  5 10:41:33 2003
+++ mutt-1.5.6/pattern.c        Tue Mar  9 15:59:43 2004
@@ -82,6 +82,7 @@
   { 'y', M_XLABEL,             0,              eat_regexp },
   { 'z', M_SIZE,               0,              eat_range },
   { '=', M_DUPLICATED,         0,              NULL },
+  { '$', M_UNREFERENCED,       0,              NULL },
   { 0 }
 };
 
@@ -1047,6 +1048,8 @@
       return (pat->not ^ (h->env->x_label && regexec (pat->rx, 
h->env->x_label, 0, NULL, 0) == 0));
     case M_DUPLICATED:
       return (pat->not ^ (h->thread && h->thread->duplicate_thread));
+    case M_UNREFERENCED:
+      return (pat->not ^ (h->thread && !h->thread->child));
   }
   mutt_error (_("error: unknown op %d (report this error)."), pat->op);
   return (-1);
diff -ru mutt-1.5.6.orig/doc/manual.sgml.head mutt-1.5.6/doc/manual.sgml.head
--- mutt-1.5.6.orig/doc/manual.sgml.head        Sun Feb  1 18:49:53 2004
+++ mutt-1.5.6/doc/manual.sgml.head     Tue Mar  9 15:57:39 2004
@@ -1784,6 +1784,7 @@
 ~y EXPR         messages which contain EXPR in the `X-Label' field
 ~z [MIN]-[MAX]  messages with a size in the range MIN to MAX *)
 ~=             duplicated messages (see $duplicate_threads)
+~$             unreferenced messages (requires threaded view)
 </verb></tscreen>
 
 Where EXPR, USER, ID, and SUBJECT are