From: markus schnalke Date: Sat, 14 Apr 2012 20:32:02 +0000 (+0200) Subject: mhshow: Add header and separation when displaying multiple messages. X-Git-Tag: mmh-thesis-end~78 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=0da86af19c369b20713d0cedf7b0b3319560f69e;hp=2017eab468c8506da64eacc01d829c2b946e5faa 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. --- 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); } }