- case 'P':
- if (menu->top + menu->pagelen >= menu->max)
- cp = menu->top ? "end" : "all";
- else
- {
- count = (100 * (menu->top + menu->pagelen)) / menu->max;
- snprintf (tmp, sizeof (tmp), "%d%%", count);
- cp = tmp;
- }
- snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
- snprintf (buf, buflen, fmt, cp);
- break;
+ case 'n':
+ if (!optional) {
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
+ snprintf (buf, buflen, fmt, Context ? Context->new : 0);
+ }
+ else if (!Context || Context->new <= 0)
+ optional = 0;
+ break;
+
+ case 'o':
+ if (!optional) {
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
+ snprintf (buf, buflen, fmt,
+ Context ? Context->unread - Context->new : 0);
+ }
+ else if (!Context || !(Context->unread - Context->new))
+ optional = 0;
+ break;
+
+ case 'p':
+ count = mutt_num_postponed (0);
+ if (!optional) {
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
+ snprintf (buf, buflen, fmt, count);
+ }
+ else if (!count)
+ optional = 0;
+ break;
+
+ case 'P':
+ if (menu->top + menu->pagelen >= menu->max)
+ cp = menu->top ? "end" : "all";
+ else {
+ count = (100 * (menu->top + menu->pagelen)) / menu->max;
+ snprintf (tmp, sizeof (tmp), "%d%%", count);
+ cp = tmp;
+ }
+ snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
+ snprintf (buf, buflen, fmt, cp);
+ break;