summaryrefslogtreecommitdiffstats
path: root/hdrline.c
diff options
context:
space:
mode:
authorMichael Elkins <me@sigpipe.org>2007-04-15 15:43:57 -0700
committerMichael Elkins <me@sigpipe.org>2007-04-15 15:43:57 -0700
commit033f117de34cfdddf05f7072bb8a99ac1f491cc9 (patch)
treed2857e3eb12afc17883c847506b2c1523465b6d4 /hdrline.c
parent3cf507eb92e10a409040d1742a40d895310079b0 (diff)
Removed hardcoded pager progress indicator and add %P format code to $pager_status which contains the same information.
Append "%> -- (%P)" to $pager_status to emulate old behavior. Closes #2087.
Diffstat (limited to 'hdrline.c')
-rw-r--r--hdrline.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/hdrline.c b/hdrline.c
index 43bb679b..a4cfb263 100644
--- a/hdrline.c
+++ b/hdrline.c
@@ -216,6 +216,7 @@ int mutt_user_is_recipient (HEADER *h)
* %n = name of author
* %N = score
* %O = like %L, except using address instead of name
+ * %P = progress indicator for builtin pager
* %s = subject
* %S = short message status (e.g., N/O/D/!/r/-)
* %t = `to:' field (recipients)
@@ -227,12 +228,6 @@ int mutt_user_is_recipient (HEADER *h)
* %Y = `x-label:' field (if present, tree unfolded, and != parent's x-label)
* %Z = status flags */
-struct hdr_format_info
-{
- CONTEXT *ctx;
- HEADER *hdr;
-};
-
static const char *
hdr_format_str (char *dest,
size_t destlen,
@@ -547,6 +542,10 @@ hdr_format_str (char *dest,
}
break;
+ case 'P':
+ strfcpy(dest, NONULL(hfi->pager_progress), destlen);
+ break;
+
case 's':
if (flags & M_FORMAT_TREE && !hdr->collapsed)
@@ -732,6 +731,13 @@ _mutt_make_string (char *dest, size_t destlen, const char *s, CONTEXT *ctx, HEAD
hfi.hdr = hdr;
hfi.ctx = ctx;
+ hfi.pager_progress = 0;
mutt_FormatString (dest, destlen, 0, s, hdr_format_str, (unsigned long) &hfi, flags);
}
+
+void
+mutt_make_string_info (char *dst, size_t dstlen, const char *s, struct hdr_format_info *hfi, format_flag flags)
+{
+ mutt_FormatString (dst, dstlen, 0, s, hdr_format_str, (unsigned long) hfi, flags);
+}