nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] [PATCH] Test that show always shows message numbers.


From: Paul Fox
Subject: Re: [Nmh-workers] [PATCH] Test that show always shows message numbers.
Date: Fri, 06 Feb 2015 16:21:57 -0500

paul wrote:
 > eric wrote:
 >  > show shows message numbers in two different formats when showing one
 >  > non-MIME, multiple non-MIME messages, or one MIME message.
 >  > 
 >  > show does not show any message numbers when showing multiple messages
 >  > any of which is MIME.
 >  > 
 >  > This is not a new bug, just one that has bothered me since I started
 >  > using mhshow with 1.6.
 > 
 > mhl shows message numbers.

these are the ">>> inbox:10" headers.

 > mhshow doesn't.

i've fixed this, so the mhshow's markform is now printed at the start
of a message, with a non-zero %(msg) so mh-format can tell the
difference between message headers and part headers.  this lets
the user customize better/worse/no headers.

 > show invokes mhshow if any messages are mime.
 > 
 > so to fix this implies adding message number output to mhshow.

but it turns out that if there's just one message, whether it's mime
or not, show itself prints a "(Message inbox:10)" header.  so in the
case of a single mime message, i now get two headers:
    (Message inbox:10)
    [ Message inbox:10 ]

sigh. :-)  and it's harder to fix than you'd think.

when are we retiring show, again?

paul

 > 
 > rather than hard-coding show's message number format logic (i.e., ">>>
 > folder:msg" vs.  "Message:  folder:msg", based on criteria i don't
 > completely understand), i think it would make sense to augment
 > mhshow's marker format to allow it to emit a message number.
 > 
 > i'll take a look at doing that.
 > 
 > paul
 > 
 >  > ---
 >  >  Makefile.am         |   1 +
 >  >  test/show/test-show | 130 
 > ++++++++++++++++++++++++++++++++++++++++++++++++++++
 >  >  2 files changed, 131 insertions(+)
 >  >  create mode 100755 test/show/test-show
 >  > 
 >  > diff --git a/Makefile.am b/Makefile.am
 >  > index af4a2fe..dabee88 100644
 >  > --- a/Makefile.am
 >  > +++ b/Makefile.am
 >  > @@ -95,6 +95,7 @@ TESTS = test/ali/test-ali test/anno/test-anno \
 >  >   test/scan/test-scan test/scan/test-scan-multibyte \
 >  >   test/sequences/test-flist test/sequences/test-mark \
 >  >   test/sequences/test-out-of-range \
 >  > + test/show/test-show \
 >  >   test/slocal/test-slocal \
 >  >   test/whatnow/test-attach-detach test/whatnow/test-cd \
 >  >   test/whatnow/test-ls test/whom/test-whom \
 >  > diff --git a/test/show/test-show b/test/show/test-show
 >  > new file mode 100755
 >  > index 0000000..f83c1ea
 >  > --- /dev/null
 >  > +++ b/test/show/test-show
 >  > @@ -0,0 +1,130 @@
 >  > +#!/bin/sh
 >  > +
 >  > +if test -z "${MH_OBJ_DIR}"; then
 >  > +    srcdir=`dirname "$0"`/../..
 >  > +    MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
 >  > +fi
 >  > +
 >  > +. "$MH_OBJ_DIR/test/common.sh"
 >  > +
 >  > +setup_test
 >  > +
 >  > +expected=$MH_TEST_DIR/$$.expected
 >  > +actual=$MH_TEST_DIR/$$.actual
 >  > +
 >  > +# Write message with a text/plain subpart.
 >  > +msgfile=`mhpath new`
 >  > +msgnum=`basename $msgfile`
 >  > +cat > $msgfile <<EOF
 >  > +MIME-Version: 1.0
 >  > +Content-Type: multipart/mixed; boundary="NextPart_001"
 >  > +Content-class: urn:content-classes:message
 >  > +Date: Thu, 19 May 2011 00:00:00 -0000
 >  > +From: address@hidden
 >  > +To: address@hidden
 >  > +
 >  > +This is a multi-part message in MIME format.
 >  > +
 >  > +--NextPart_001
 >  > +Content-Type: multipart/related;
 >  > +    type="multipart/alternative";
 >  > +    boundary="NextPart_002"
 >  > +
 >  > +--NextPart_002
 >  > +Content-Type: text/plain;
 >  > +    charset="utf-8"
 >  > +
 >  > +This is the text/plain part.
 >  > +
 >  > +--NextPart_002--
 >  > +
 >  > +--NextPart_001--
 >  > +EOF
 >  > +
 >  > +# Test showing multiple non-MIME messages shows message numbers.
 >  > +
 >  > +cat > $expected <<EOF
 >  > +>>> inbox:1
 >  > +
 >  > +
 >  > +Date:    Fri, 29 Sep 2006 00:00:00
 >  > +To:      Some User <address@hidden>
 >  > +From:    Test1 <address@hidden>
 >  > +Subject: Testing message 1
 >  > +
 >  > +
 >  > +This is message number 1
 >  > +
 >  > +
 >  > +
 >  > +>>> inbox:2
 >  > +
 >  > +
 >  > +Date:    Fri, 29 Sep 2006 00:00:00
 >  > +To:      Some User <address@hidden>
 >  > +From:    Test2 <address@hidden>
 >  > +Subject: Testing message 2
 >  > +
 >  > +
 >  > +This is message number 2
 >  > +EOF
 >  > +
 >  > +show +inbox 1 2 > $actual || exit 1
 >  > +
 >  > +check "$expected" "$actual"
 >  > +
 >  > +# Test showing one MIME message shows message number.
 >  > +# Format is different; why?
 >  > +
 >  > +cat > $expected <<EOF
 >  > +(Message inbox:$msgnum)
 >  > +Date:    Thu, 19 May 2011 00:00:00 -0000
 >  > +To:      address@hidden
 >  > +From:    address@hidden
 >  > +
 >  > +MIME-Version: 1.0
 >  > +Content-class: urn:content-classes:message
 >  > +
 >  > +[ part 1.1 - text/plain -   29B  ]
 >  > +This is the text/plain part.
 >  > +EOF
 >  > +
 >  > +show +inbox $msgnum > $actual || exit 1
 >  > +
 >  > +check "$expected" "$actual"
 >  > +
 >  > +# Test showing multiple MIME messages shows message numbers.
 >  > +# Currently fails.
 >  > +
 >  > +cat > $expected <<EOF
 >  > +>>> inbox:1
 >  > +
 >  > +
 >  > +Date:    Fri, 29 Sep 2006 00:00:00
 >  > +To:      Some User <address@hidden>
 >  > +From:    Test1 <address@hidden>
 >  > +Subject: Testing message 1
 >  > +
 >  > +
 >  > +[ part  - text/plain -   25B  ]
 >  > +This is message number 1
 >  > +
 >  > +>>> inbox:$msgnum
 >  > +
 >  > +
 >  > +Date:    Thu, 19 May 2011 00:00:00 -0000
 >  > +To:      address@hidden
 >  > +From:    address@hidden
 >  > +
 >  > +MIME-Version: 1.0
 >  > +Content-class: urn:content-classes:message
 >  > +
 >  > +[ part 1.1 - text/plain -   29B  ]
 >  > +This is the text/plain part.
 >  > +EOF
 >  > +
 >  > +show +inbox 1 $msgnum > $actual || exit 1
 >  > +
 >  > +check "$expected" "$actual"
 >  > +
 >  > +exit $failed
 >  > -- 
 >  > 2.2.0.rc0.207.ga3a616c
 >  > 
 >  > 
 >  > _______________________________________________
 >  > Nmh-workers mailing list
 >  > address@hidden
 >  > https://lists.nongnu.org/mailman/listinfo/nmh-workers
 > 
 > =----------------------
 >  paul fox, address@hidden (arlington, ma, where it's 16.3 degrees)

=----------------------
 paul fox, address@hidden (arlington, ma, where it's 14.4 degrees)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]