~U unread messages
~v message is part of a collapsed thread.
~x EXPR messages which contain EXPR in the `References' field
+~y EXPR messages which contain EXPR in the `X-Label' field
~z [MIN]-[MAX] messages with a size in the range MIN to MAX *)
</verb></tscreen>
``From'' field. When unset, the ``Reply-To'' field will be used when
present.
+The ``X-Label:'' header field can be used to further identify mailing
+lists or list subject matter (or just to annotate messages
+individually). The <ref id="index_format"
+name="$index_format"> variable's ``%y'' and
+``%Y'' escapes can be used to expand ``X-Label:'' fields in the
+index, and Mutt's pattern-matcher can match regular expressions to
+``X-Label:'' fields with the ``~y'' selector. ``X-Label:'' is not a
+standard message header field, but it can easily be inserted by procmail
+and other mail filtering agents.
+
Lastly, Mutt has the ability to <ref id="sort" name="sort"> the mailbox into
<ref id="threads" name="threads">. A thread is a group of messages which all relate to the same
subject. This is usually organized into a tree-like structure where a
* %T = $to_chars
* %u = user (login) name of author
* %v = first name of author, unless from self
+ * %y = `x-label:' field (if present)
+ * %Y = `x-label:' field (if present, tree unfolded, and != parent's x-label)
* %Z = status flags */
struct hdr_format_info
format_flag flags)
{
struct hdr_format_info *hfi = (struct hdr_format_info *) data;
- HEADER *hdr;
+ HEADER *hdr, *htmp;
CONTEXT *ctx;
char fmt[SHORT_STRING], buf2[SHORT_STRING], ch, *p;
int do_locales, i;
hdr_format_s (dest, destlen, prefix, buf2);
break;
+ case 'y':
+ if (optional)
+ optional = hdr->env->x_label ? 1 : 0;
+
+ hdr_format_s (dest, destlen, prefix, NONULL (hdr->env->x_label));
+ break;
+
+ case 'Y':
+ if (hdr->env->x_label)
+ {
+ i = 1; /* reduce reuse recycle */
+ htmp = NULL;
+ if (flags & M_FORMAT_TREE
+ && (hdr->prev && hdr->prev->env->x_label))
+ htmp = hdr->prev;
+ else if (flags & M_FORMAT_TREE
+ && (hdr->parent && hdr->parent->env->x_label))
+ htmp = hdr->parent;
+ if (htmp && mutt_strcasecmp (hdr->env->x_label,
+ htmp->env->x_label) == 0)
+ i = 0;
+ }
+ else
+ i = 0;
+
+ if (optional)
+ optional = i;
+
+ if (i)
+ hdr_format_s (dest, destlen, prefix, NONULL (hdr->env->x_label));
+ else
+ hdr_format_s (dest, destlen, prefix, "");
+
+ break;
+
default:
snprintf (dest, destlen, "%%%s%c", prefix, op);
break;
** %u user (login) name of the author
** %v first name of the author, or the
** . recipient if the message is from you
+ ** %y `x-label:' field, if present
+ ** %Y `x-label' field, if present, and
+ ** . (1) not at part of a thread tree,
+ ** . (2) at the top of a thread, or
+ ** . (3) `x-label' is different from preceding
+ ** . message's `x-label'.
** %Z message status flags
** %{fmt} the date and time of the message is
** . converted to sender's time zone, and
M_PGP_ENCRYPT,
M_PGP_KEY,
#endif
+ M_XLABEL,
/* Options for Mailcap lookup */
M_EDIT,
char *message_id;
char *supersedes;
char *date;
+ char *x_label;
LIST *references; /* message references (in reverse order) */
LIST *userhdrs; /* user defined headers */
} ENVELOPE;
}
matched = 1;
}
+ else if (mutt_strcasecmp (line+1, "-label") == 0)
+ {
+ e->x_label = safe_strdup(p);
+ matched = 1;
+ }
default:
break;
{ 'U', M_UNREAD, 0, NULL },
{ 'v', M_COLLAPSED, 0, NULL },
{ 'x', M_REFERENCE, 0, eat_regexp },
+ { 'y', M_XLABEL, 0, eat_regexp },
{ 'z', M_SIZE, 0, eat_range },
{ 0 }
};
case M_PGP_KEY:
return (pat->not ^ (h->pgp & PGPKEY));
#endif
+ case M_XLABEL:
+ return (pat->not ^ (h->env->x_label && regexec (pat->rx, h->env->x_label, 0, NULL, 0) == 0));
}
mutt_error (_("error: unknown op %d (report this error)."), pat->op);
return (-1);