Larry Hynes [Sat, 31 Dec 2016 17:57:13 +0000 (17:57 +0000)]
Changes to install-mh.man
Some more simple wordsmithing...
Change instances of 'Install-mh' to 'install-mh', in line with
other pages, switch to single `' around 'Mail', in line with
other pages, option -> switch, clean up a little.
Larry Hynes [Sat, 31 Dec 2016 15:57:42 +0000 (15:57 +0000)]
A cleanup, and possibly some controversy: I've replaced
Rather than standard message skeleton
with
User message skeleton
My thinking here is that a) we can do away with the kinda weird
'Rather than', b) I find the distinction between 'default' and
'standard' to be vague and c) it only appears in a few pages
and is easily remedied. It turns up in comp(1) as "An alternative
to the standard skeleton.", where 'standard' is used in the same
way as 'default' is used in rcvdist(1), so I think it's worth
settling on something 'better' and applying it consistently.
My proposal is 'Default foo', for the foo in %nmhetcdir% and
'User foo' for the foo in the user's <mh-dir>.
Larry Hynes [Sat, 31 Dec 2016 15:54:55 +0000 (15:54 +0000)]
Fix skeletons in comp(1), forw(1) and dist(1)
While I was here, I removed two 'empty' paragraphs (.PP) in forw(1).
They may have been intended as line breaks, but I think they are
unnecessary; feel free to overrule me!
Aside: I would not be unhappy if, some day, 'skeleton' was replaced by
something utilitarian like 'template'.
Larry Hynes [Mon, 19 Dec 2016 01:17:10 +0000 (01:17 +0000)]
Changes to mh-format.man
This is a beast, and we may not tame it at the first attempt.
Mostly language simplification, some grammar and formatting, trailing
whitespace, that sort of thing. There are one or two instances where
I've taken (small) liberties with language, in favour of 'comprehension
at first glance'.
There are some commented lines hanging around in this. I've left
them in, but I think they should go at the first opportunity.
Larry Hynes [Fri, 16 Dec 2016 22:55:39 +0000 (22:55 +0000)]
Changes to comp.man
Remove the slightly legalistic 'in truth of fact', and bring the
mention of man whatnow into the preceding sentence.
The line 'If the draft already exists, comp will ask you as to the
disposition of the draft.' makes no sense to me, and I'm struggling
to make it make sense. If we put to one side the fact that I think
it's a broken sentence, I still haven't managed to get comp to
accept - or prompt me for - a 'replace' option when 'the draft
already exists', so I'm afraid I have to admit defeat here and seek
the wisdom of the elders.
David Levine [Thu, 15 Dec 2016 22:44:56 +0000 (17:44 -0500)]
Added clarifications to abbreviations.
1) N must be a positive number.
2) The + can be omitted.
3) As many of the N messages that exist.
4) Can also use - (or +) with first, prev, next, and last.
Larry Hynes [Thu, 15 Dec 2016 18:33:15 +0000 (18:33 +0000)]
Changes to nmh.man
This adds a reference to the 'COMMANDS' section, corrects - and
hopefully simplifies - a couple of things, and tries to untangle
the line beginning 'show displays...' in the seventh paragraph.
The line 'The first, previous, next or last messages, if they exist.'
doesn't seem to accurately cover the accompanying 'foo:N' listing
in the following, or am I missing something?
first:N
prev:N
next:N
last:N The first, previous, next or last messages, if they exist.
Ralph Corderoy [Sat, 10 Dec 2016 14:19:43 +0000 (14:19 +0000)]
Document that adios() does not return. abort() ensures it won't.
Discussion with David confirmed that adios()'s de facto contract with
the caller is that it won't return. Document that, and add an abort(3)
to ensure it won't occur. Better that than return and blunder on until
a SEGV or corruption later.
Ralph Corderoy [Sat, 10 Dec 2016 14:11:13 +0000 (14:11 +0000)]
mhlsbr.c: Don't hide mhladios and mhldone behind macros.
Locally defined mhladios() and mhldone() were called as adios() and
done() thanks to #defines that hid the widely-used functions with those
names. Don't bother as it confuses the reader. Just call the local
variations directly to make clear it's not the standard implementation.
David Levine [Thu, 8 Dec 2016 21:27:40 +0000 (16:27 -0500)]
Replaced !iscntrl() with isprint().
To address Ralph's FIXME comment. One example where a byte would
have been printed with !iscntrl() is 0x24 is ISO 646 BASIC (Inv),
which is undefined. Also, added test cases to cover most of
get_param_value(). Also, replaced a couple of other FIXME's with
code comments.
David Levine [Sun, 20 Nov 2016 19:25:11 +0000 (14:25 -0500)]
Open infile before fixing each message.
Though the input file won't need to be opened if everything goes
well, do it early just in case there's a failure, and that failure
is running out of file descriptors.
It was several lines repeated each time, and it saves having to check
they're all identical. The original test pressed on if the MIME
parameter's value was an empty string; preserve that as it's spotted
later on.
David Levine [Sun, 13 Nov 2016 19:50:08 +0000 (14:50 -0500)]
Replaced docs/COMPLETION-BASH with etc/bash_completions_nmh.
It's generated from man/mh-chart.man, which in turn is generated.
Automake doesn't like generated files in docs, hence the move to
etc. And the new filename better fits usage, I think.
Did not provide support for completing message numbers. It can
be fooled by programs that take multiple switches with +
arguments.
COMPLETION-BASH was broken with current bash, anyway.
Ralph Corderoy [Sat, 12 Nov 2016 18:40:46 +0000 (18:40 +0000)]
m_getfld: Shuffle `delim' assignments slightly.
Document end state of the four pointers to parts of the delimiter.
fdelimlen can be, wrongly, one less without causing problems because a
second check uses edelimlen. The only side effect is an extra iteration
through m_getfld().
Ralph Corderoy [Sat, 12 Nov 2016 00:39:23 +0000 (00:39 +0000)]
m_getfld: Replace matchc() with memmem(3).
libc is more likely to find one lump of memory inside another quicker
than a home-grown quadratic emulation of the VAX's MATCHC instruction.
memmem() isn't POSIX, but exists on Linux and FreeBSD. This will see if
the buildbot is happy.
Ralph Corderoy [Sat, 12 Nov 2016 00:31:36 +0000 (00:31 +0000)]
m_getfld: Remove never-true test in matchc().
Now the fdelimlen doesn't include the NUL it is never true. I didn't
understand how it could ever be true but gcov on the test suite was
showing 22e6 tests had three positives; that's what put me on to
fdelimlen's overshoot.
Ralph Corderoy [Fri, 11 Nov 2016 23:23:11 +0000 (23:23 +0000)]
m_getfld: Shorten fdelimlen by one; it was too long.
The fdelimlen bytes starting at fdelim included a NUL at the end, e.g. 7
for "\nFrom \0". Other code seems not to expect this and has
conditional bits to work around it, perhaps without understanding why.
All the tests still pass, including with valgrind.
Ralph Corderoy [Fri, 11 Nov 2016 00:38:29 +0000 (00:38 +0000)]
dlocaltime(): Only call tzset(3) once.
This avoids the stat(2) of /etc/localtime per message scan if TZ isn't
set in the environment; that's the default case on this Linux system.
I can't see a way the TZ environment variable is likely to change
between messages, or that it's intended an invocation of scan(1), say,
copes with the timezone shifting underneath it by /etc/localtime being
changed.