nmh-workers
[Top][All Lists]
Advanced

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

Re: [Nmh-workers] new marker format broke test suite


From: Ken Hornstein
Subject: Re: [Nmh-workers] new marker format broke test suite
Date: Tue, 06 May 2014 11:23:48 -0400

>in particular, the old marker lines included the size of the part
>being shown:
>    part       text/plain                 18K
>and the new marker lines do not:
>    [ part  - text/plain -   ]
>
>as far as i can tell, the size of the part isn't currently available
>at all via mh-format, let alone in the "human friendly" format that
>comes from list_content().  (list_content() produces the format you'll
>see if you run mhlist on the message.)

So, there is a function called %(size) which means "the size of the
message".  That's also passed in to the dat[] array, just like %(unseen)
is.  Seems like you could do the same magic that mhlistsbr.c does (which
is call the size function for the part if it's available, otherwise
calculate it based on file offsets).

>i have a patch ready to push to master to make the tests match the
>current code.  what i'm wondering, though, is whether folks instead
>think that the mhshow marker format should grow the ability to produce
>the previous output exactly (and if so, that output would likely
>become the new default).

Well, you know ... actually, maybe it should get that ability.  I think
having the size is useful.  But ... do we add metric prefixes to that?
Doing that directly in mh-format looks like it's doable, but it would be
awful.  It would probably make more sense to make a new format function
that would take an integer as input and output a string that contained
the number with the appropriate metric prefix appended.  That way you
could do:

        %(metric(size))

And that could be usable in scan formats and the like.  Not in love with
the function name, so other suggestions are welcome.

If you're not up for coding that, I could get to it, but it might be
a few days before it would be done.

--Ken



reply via email to

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