Package: mpack
Version: 1.6-18+b2
Severity: minor
Tags: patch

   * What led up to the situation?

     Checking for defects with a new version

test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man 
page"

  [Use "groff -e ' $' -e '\\~$' <file>" to find obvious trailing spaces.]

  ["test-groff" is a script in the repository for "groff"; is not shipped]
(local copy and "troff" slightly changed by me).

  [The fate of "test-nroff" was decided in groff bug #55941.]

   * What was the outcome of this action?


an.tmac:<stdin>:1: style: .TH missing third argument; consider document 
modification date in ISO 8601 format (YYYY-MM-DD)
an.tmac:<stdin>:1: style: .TH missing fourth argument; consider package/project 
name and version (e.g., "groff 1.23.0")
troff:<stdin>:27: warning: trailing space in the line
troff:<stdin>:32: warning: trailing space in the line
troff:<stdin>:72: warning: trailing space in the line
troff:<stdin>:74: warning: trailing space in the line
troff:<stdin>:80: warning: trailing space in the line
troff:<stdin>:99: warning: trailing space in the line


   * What outcome did you expect instead?

     No output (no warnings).

-.-

  General remarks and further material, if a diff-file exist, are in the
attachments.


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.17-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), 
LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages mpack depends on:
ii  libc6  2.41-4

mpack recommends no packages.

Versions of packages mpack suggests:
ii  exim4-daemon-light [mail-transport-agent]  4.98.1-1
pn  inews                                      <none>

-- no debconf information
Input file is munpack.1

Output from "mandoc -T lint  munpack.1": (shortened list)

      1 missing date, using "": TH
      1 skipping paragraph macro: PP after SH
      6 whitespace at end of input line


Remove trailing space with: sed -e 's/  *$//'

-.-.

Output from "test-nroff -mandoc -t -ww -z munpack.1": (shortened list)

      6 trailing space in the line


Remove trailing space with: sed -e 's/  *$//'

-.-.

Remove space characters (whitespace) at the end of lines.
Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".

Number of lines affected is

6

-.-.

Wrong distance (not two spaces) between sentences in the input file.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

E-mail: Easier to quote exactly the relevant lines.

Generally: Easier to edit the sentence.

Patches: Less unaffected text.

Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.

  The amount of space between sentences in the output can then be
controlled with the ".ss" request.

Mark a final abbreviation point as such by suffixing it with "\&".

Some sentences (etc.) do not begin on a new line.

Split (sometimes) lines after a punctuation mark; before a conjunction.

  Lines with only one (or two) space(s) between sentences could be split,
so latter sentences begin on a new line.

Use

#!/usr/bin/sh

sed -e '/^\./n' \
-e 's/\([[:alpha:]]\)\.  */\1.\n/g' $1

to split lines after a sentence period.
Check result with the difference between the formatted outputs.
See also the attachment "general.bugs"

68:replaced with this character. The default replacement character is

-.-.

Only one space character after a possible end of sentence
(after a punctuation, that can end a sentence).

munpack.1:68:replaced with this character. The default replacement character is

-.-.

Put a subordinate sentence (after a comma) on a new line.

munpack.1:32:If no filename argument is given, 
munpack.1:36:If the message suggests a file name to use for the imbedded part, 
that
munpack.1:38:output file.  If the suggested filename includes subdirectories, 
they
munpack.1:40:If the message does not suggest a file name, the names
munpack.1:41:"part1", "part2", etc are used in sequence.
munpack.1:43:If the imbedded part was preceded with textual information, that
munpack.1:45:the imbedded part, with any filename extension replaced with 
".desc".
munpack.1:50:name of an existing file, the file will be overwritten.  Without 
this
munpack.1:54:appends ".1", ".2", etc to find a nonexistent file.
munpack.1:62:default, text parts that do not have a filename parameter do not 
get
munpack.1:67:If the suggested filename contains invalid characters, they are
munpack.1:79:To decode a MIME message, first save it to a text file.  If 
possible,
munpack.1:83:when the headers are missing or incomplete, other files it cannot
munpack.1:91:Online, as of the writing of this document) place the mail headers 
at
munpack.1:92:the bottom of the message, instead of at the top of the message.  
If
munpack.1:93:you are having problems decoding a MIME message on such a system, 
you
munpack.1:102:multiple messages in a single file, to decode things correctly it 
must
munpack.1:105:To decode a message, run the command:

-.-.

Section headings (.SH and .SS) do not need quoting their arguments.

77:.SH "DECODING MIME"
124:.SH "REPORTING BUGS"

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z 
":

an.tmac:<stdin>:1: style: .TH missing third argument; consider document 
modification date in ISO 8601 format (YYYY-MM-DD)
an.tmac:<stdin>:1: style: .TH missing fourth argument; consider package/project 
name and version (e.g., "groff 1.23.0")
troff:<stdin>:27: warning: trailing space in the line
troff:<stdin>:32: warning: trailing space in the line
troff:<stdin>:72: warning: trailing space in the line
troff:<stdin>:74: warning: trailing space in the line
troff:<stdin>:80: warning: trailing space in the line
troff:<stdin>:99: warning: trailing space in the line

-.-.

Additionally:

Change 'etc' to 'etc.\&'.

-.-

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.
--- munpack.1   2025-03-20 01:31:14.457260409 +0000
+++ munpack.1.new       2025-03-20 01:49:45.805755646 +0000
@@ -24,85 +24,99 @@ munpack \- unpack messages in MIME or sp
 .I "filename \&..."
 ]
 .SH DESCRIPTION
-The 
+The
 .I munpack
 program reads each RFC-822 message
 .I filename
-and writes all non-text MIME parts or split-uuencoded files as files.
-If no filename argument is given, 
+and writes all non-text MIME parts
+or split-uuencoded files as files.
+If no filename argument is given,
 .B munpack
 reads from standard input.
 .LP
-If the message suggests a file name to use for the imbedded part, that
-name is cleaned of potential problem characters and used for the
-output file.  If the suggested filename includes subdirectories, they
-will be created as necessary.
-If the message does not suggest a file name, the names
-"part1", "part2", etc are used in sequence.
-.LP
-If the imbedded part was preceded with textual information, that
-information is also written to a file.  The file is named the same as
-the imbedded part, with any filename extension replaced with ".desc".
+If the message suggests a file name to use for the imbedded part,
+that name is cleaned of potential problem characters
+and used for the output file.
+If the suggested filename includes subdirectories,
+they will be created as necessary.
+If the message does not suggest a file name,
+the names "part1", "part2", etc.\& are used in sequence.
+.LP
+If the imbedded part was preceded with textual information,
+that information is also written to a file.
+The file is named the same as the imbedded part,
+with any filename extension replaced with ".desc".
 .SH OPTIONS
 .TP
 .B \-f
-Force overwriting of existing files.  If a message suggests a file
-name of an existing file, the file will be overwritten.  Without this
-flag,
-.B
-munpack
-appends ".1", ".2", etc to find a nonexistent file.
+Force overwriting of existing files.
+If a message suggests a file name of an existing file,
+the file will be overwritten.
+Without this flag,
+.B munpack
+appends ".1", ".2", etc.\& to find a nonexistent file.
 .TP
 .B \-q
-Be quiet.  Suppresses messages about saving partial messages and about
-messages with no interesting information.
+Be quiet.
+Suppresses messages about saving partial messages
+and about messages with no interesting information.
 .TP
 .B \-t
-Also write the text MIME parts of multipart messages as files.  By
-default, text parts that do not have a filename parameter do not get
-unpacked.  This option effectively disables the ".desc" file feature
-for MIME messages.
+Also write the text MIME parts of multipart messages as files.
+By default,
+text parts
+that do not have a filename parameter
+do not get unpacked.
+This option effectively disables the ".desc" file feature for MIME messages.
 .TP
 .BI \-r " character"
-If the suggested filename contains invalid characters, they are
-replaced with this character. The default replacement character is
+If the suggested filename contains invalid characters,
+they are replaced with this character.
+The default replacement character is
 "X".
 .TP
 .BI \-C " directory"
-Change the current directory to 
+Change the current directory to
 .I directory
-before reading any files.  This is useful when invoking 
+before reading any files.  This is useful when invoking
 .B munpack
 from a mail or news reader.
-.SH "DECODING MIME"
-.LP
-To decode a MIME message, first save it to a text file.  If possible,
-save it with all headers included.  
+.SH DECODING MIME
+To decode a MIME message,
+first save it to a text file.
+If possible,
+save it with all headers included.
 .I Munpack
 can decode some MIME files
-when the headers are missing or incomplete, other files it cannot
-decode without having the information in the headers.  In general,
-messages which have a statement at the beginning that they are in MIME
-format can be decoded without the headers.  Messages which have been
-split into multiple parts generally require all headers in order to be
-reassembled and decoded.
-.LP
-Some LAN-based mail systems and some mail providers (including America
-Online, as of the writing of this document) place the mail headers at
-the bottom of the message, instead of at the top of the message.  If
-you are having problems decoding a MIME message on such a system, you
-need to convert the mail back into the standard format by removing the
-system's nonstandard headers and moving the standard Internet headers
-at the top of the message (separated from the message body with a
-blank line).
+when the headers are missing or incomplete,
+other files
+it cannot decode without having the information in the headers.
+In general,
+messages which have a statement at the beginning
+that they are in MIME format
+can be decoded without the headers.
+Messages
+which have been split into multiple parts
+generally require all headers in order to be reassembled and decoded.
+.LP
+Some LAN-based mail systems and some mail providers
+(including America Online, as of the writing of this document)
+place the mail headers at the bottom of the message,
+instead of at the top of the message.
+If you are having problems decoding a MIME message on such a system,
+you need to convert the mail back into the standard format
+by removing the system's nonstandard headers
+and moving the standard Internet headers at the top of the message
+(separated from the message body with a blank line).
 .LP
-There must be exactly one message per file.  
+There must be exactly one message per file.
 .I Munpack
-cannot deal with
-multiple messages in a single file, to decode things correctly it must
-know when one message ends and the next one begins.
+cannot deal with multiple messages in a single file,
+to decode things correctly it must know
+when one message ends and the next one begins.
 .LP
-To decode a message, run the command:
+To decode a message,
+run the command:
 .IP
 .IB munpack " file"
 .LP
@@ -121,5 +135,5 @@ Directory to store temporary files.  Def
 .TP
 .B $TMPDIR/m-prts-$USER/
 Directory used to store partial messages awaiting reassembly.
-.SH "REPORTING BUGS"
+.SH REPORTING BUGS
 Send all bug reports to mpack\-b...@andrew.cmu.edu.
  Any program (person), that produces man pages, should check the output
for defects by using (both groff and nroff)

[gn]roff -mandoc -t -ww -b -z -K utf8 <man page>

  The same goes for man pages that are used as an input.

  For a style guide use

  mandoc -T lint

-.-

  Any "autogenerator" should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.

  It should also check its input files for too long (> 80) lines.

  This is just a simple quality control measure.

  The "autogenerator" may have to be corrected to get a better man page,
the source file may, and any additional file may.

  Common defects:

  Not removing trailing spaces (in in- and output).
  The reason for these trailing spaces should be found and eliminated.

  "git" has a "tool" to point out whitespace,
see for example "git-apply(1)" and git-config(1)")

  Not beginning each input sentence on a new line.
Line length and patch size should thus be reduced.

  The script "reportbug" uses 'quoted-printable' encoding when a line is
longer than 1024 characters in an 'ascii' file.

  See man-pages(7), item "semantic newline".

-.-

The difference between the formatted output of the original and patched file
can be seen with:

  nroff -mandoc <file1> > <out1>
  nroff -mandoc <file2> > <out2>
  diff -d -u <out1> <out2>

and for groff, using

\"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - \"

instead of 'nroff -mandoc'

  Add the option '-t', if the file contains a table.

  Read the output from 'diff -d -u ...' with 'less -R' or similar.

-.-.

  If 'man' (man-db) is used to check the manual for warnings,
the following must be set:

  The option \"-warnings=w\"

  The environmental variable:

export MAN_KEEP_STDERR=yes (or any non-empty value)

  or

  (produce only warnings):

export MANROFFOPT=\"-ww -b -z\"

export MAN_KEEP_STDERR=yes (or any non-empty value)

-.-

Reply via email to