From 0da86af19c369b20713d0cedf7b0b3319560f69e Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Sat, 14 Apr 2012 22:32:02 +0200 Subject: [PATCH] mhshow: Add header and separation when displaying multiple messages. We do it similar to the way mhl(1) does it. The -header of show(1) is not added to mhshow(1). You can though have it, by using the mhl `MessageName' pseudo-component. --- man/mhshow.man1 | 8 ++++++++ uip/mhshowsbr.c | 13 ++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/man/mhshow.man1 b/man/mhshow.man1 index ecd2e9d..d3326ac 100644 --- a/man/mhshow.man1 +++ b/man/mhshow.man1 @@ -71,6 +71,14 @@ mail drop format to a folder of messages, see .BR inc (1)). .PP +When displaying multiple messages, +.B mhshow +prepends each of them with a `>>> Message nnn' header, +and separates the messages with two lines of space. +This is similar to the way +.B mhl +acts on multiple files. +.PP A part specification consists of a series of numbers separated by dots. For example, in a multipart content containing three parts, these would be named as 1, 2, and 3, respectively. If part 2 was also a diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 4f67d32..13a65e4 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -85,9 +85,16 @@ show_all_messages(CT *cts) for (ctp = cts; *ctp; ctp++) { ct = *ctp; - /* if top-level type is ok, then display message */ - if (type_ok(ct, 1)) - show_single_message(ct, formsw); + if (!type_ok(ct, 1)) { /* top-level type */ + continue; + } + if (cts[1]) { + if (ctp != cts) { + printf("\n\n"); + } + printf(">>> Message %s\n\n", ct->c_file); + } + show_single_message(ct, formsw); } } -- 1.7.10.4