Package: ncal
Version: 12.1.8
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 ' $' <file>" to find 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?
* 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.5-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 ncal depends on:
ii libc6 2.40-4
ii libtinfo6 6.5-2+b1
ncal recommends no packages.
ncal suggests no packages.
-- no debconf information
Input file is ncal.1
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
-.-
So any 'generator' should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.
This is just a simple quality control measure.
The 'generator' may have to be corrected to get a better man page,
the source file may, and any additional file may.
Common defects:
Input text line longer than 80 bytes.
Not removing trailing spaces (in in- and output).
The reason for these trailing spaces should be found and eliminated.
Not beginning each input sentence on a new line.
Lines should thus be shorter.
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 -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 of 'diff -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)
-.-.
Output from "mandoc -T lint ncal.1": (shortened list)
14 new sentence, new line
1 referenced manual not found
9 whitespace at end of input line
-.-.
Output from "test-groff -mandoc -t -ww -z ncal.1": (shortened list)
6 trailing space in the line
-.-.
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
9
-.-.
Wrong distance 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 abbreviation point as such by suffixing them with "\&".
123:Display a calendar for the specified year. This option is implied when
128:Display only the current month. This is the default.
130:Months to add after. The specified number of months is added to the
131:end of the display. This is in addition to any date range selected by the
136:options. For example,
139:February of the following year. Negative numbers are allowed, in which
140:case the specified number of months is subtracted. For example,
142:shows July to December. And
146:Months to add before. The specified number of months is added to the
147:beginning of the display. See
153:mode. For
198:are mutually exclusive. If inconsistent options are given, the later
239:that should not be broken. Therefore it will always output 8 lines, even if
240:only 7 contain data. This extra blank line also appears with the original
-.-.
Put a parenthetical sentence, phrase on a separate line,
if not part of a code.
See man-pages(7), item "semantic newline".
Not considered in a patch, too many lines.
ncal.1:88:Display date of Easter (for western churches).
ncal.1:90:Display Julian days (days one-based, numbered from January 1).
ncal.1:161:as the current date (for debugging of date selection).
ncal.1:165:as the current date (for debugging of highlighting).
-.-.
Output from "test-groff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z
":
troff:<stdin>:128: warning: trailing space in the line
troff:<stdin>:140: warning: trailing space in the line
troff:<stdin>:142: warning: trailing space in the line
troff:<stdin>:146: warning: trailing space in the line
troff:<stdin>:194: warning: trailing space in the line
troff:<stdin>:196: warning: trailing space in the line
-.-
Additional
Change '-' to '\-' for some options.
Add a missing '.' after "Solaris 8".
--- ncal.1 2024-12-26 07:44:47.429974167 +0000
+++ ncal.1.new 2024-12-26 08:36:30.755267755 +0000
@@ -70,9 +70,10 @@ The
.Nm
utility displays a simple calendar in traditional format and
.Nm ncal
-offers an alternative layout, more options and the date of Easter.
-The new format is a little cramped but it makes a year fit
-on a 25x80 terminal.
+offers an alternative layout,
+more options and the date of Easter.
+The new format is a little cramped
+but it makes a year fit on a 25x80 terminal.
If arguments are not specified,
the current month is displayed.
.Pp
@@ -81,29 +82,36 @@ The options are as follows:
.It Fl h
Turns off highlighting of today.
.It Fl J
-Display Julian Calendar, if combined with the
+Display Julian Calendar,
+if combined with the
.Fl o
-option, display date of Orthodox Easter according to the Julian Calendar.
+option,
+display date of Orthodox Easter according to the Julian Calendar.
.It Fl e
-Display date of Easter (for western churches).
+Display date of Easter
+(for western churches).
.It Fl j
-Display Julian days (days one-based, numbered from January 1).
+Display Julian days
+(days one-based, numbered from January 1).
.It Fl m Ar month
Display the specified
.Ar month .
If
.Ar month
-is specified as a decimal number, appending
+is specified as a decimal number,
+appending
.Ql f
or
.Ql p
-displays the same month of the following or previous year respectively.
+displays the same month of the following
+or previous year respectively.
.It Fl o
-Display date of Orthodox Easter (Greek and Russian
-Orthodox Churches).
+Display date of Orthodox Easter
+(Greek and Russian Orthodox Churches).
.It Fl p
-Print the country codes and switching days from Julian to Gregorian
-Calendar as they are assumed by
+Print the country codes
+and switching days from Julian to Gregorian Calendar
+as they are assumed by
.Nm ncal .
The country code as determined from the local environment is marked
with an asterisk.
@@ -113,44 +121,54 @@ associated with the
.Ar country_code .
If not specified,
.Nm ncal
-tries to guess the switch date from the local environment or
-falls back to September 2, 1752.
-This was when Great
-Britain and her colonies switched to the Gregorian Calendar.
+tries to guess the switch date from the local environment
+or falls back to September 2, 1752.
+This was when Great Britain
+and her colonies switched to the Gregorian Calendar.
.It Fl w
Print the number of the week below each week column.
.It Fl y
-Display a calendar for the specified year. This option is implied when
-a year but no month are specified on the command line.
+Display a calendar for the specified year.
+This option is implied
+when a year but no month are specified on the command line.
.It Fl 3
-Display the previous, current and next month surrounding today.
+Display the previous,
+current and next month surrounding today.
.It Fl 1
-Display only the current month. This is the default.
+Display only the current month.
+This is the default.
.It Fl A Ar number
-Months to add after. The specified number of months is added to the
-end of the display. This is in addition to any date range selected by the
+Months to add after.
+The specified number of months is added to the end of the display.
+This is in addition to any date range selected by the
.Fl y ,
.Fl 3 ,
or
.Fl 1
-options. For example,
-.Dq Li cal -y -B2 -A2
+options.
+For example,
+.Dq Li cal \-y \-B2 \-A2
shows everything from November of the previous year to
-February of the following year. Negative numbers are allowed, in which
-case the specified number of months is subtracted. For example,
-.Dq Li cal -y -B-6
-shows July to December. And
-.Dq Li cal -A11
+February of the following year.
+Negative numbers are allowed,
+in which case the specified number of months is subtracted.
+For example,
+.Dq Li cal \-y \-B\-6
+shows July to December.
+And
+.Dq Li cal \-A11
simply shows the next 12 months.
.It Fl B Ar number
-Months to add before. The specified number of months is added to the
-beginning of the display. See
+Months to add before.
+The specified number of months is added to the beginning of the display.
+See
.Fl A
for examples.
.It Fl C
Completely switch to
.Nm cal
-mode. For
+mode.
+For
.Nm cal
like output only, use
.Fl b
@@ -158,11 +176,13 @@ instead.
.It Fl d Ar yyyy-mm
Use
.Ar yyyy-mm
-as the current date (for debugging of date selection).
+as the current date
+(for debugging of date selection).
.It Fl H Ar yyyy-mm-dd
Use
.Ar yyyy-mm-dd
-as the current date (for debugging of highlighting).
+as the current date
+(for debugging of highlighting).
.It Fl M
Weeks start on Monday.
.It Fl S
@@ -186,17 +206,18 @@ year; the month is either a number betwe
abbreviated name as specified by the current locale.
Month and
year default to those of the current system clock and time zone (so
-.Dq Li cal -m 8
+.Dq Li cal \-m 8
will display a calendar for the month of August in the current
year).
.Pp
Not all options can be used together.
-For example the options
-.Fl y , 3 ,
-and
-.Fl 1
-are mutually exclusive. If inconsistent options are given, the later
-ones take precedence over the earlier ones.
+For example the options
+.Fl y , 3 ,
+and
+.Fl 1
+are mutually exclusive.
+If inconsistent options are given,
+the later ones take precedence over the earlier ones.
.Pp
A year starts on January 1.
.Pp
@@ -235,11 +256,14 @@ The output of the
.Nm cal
command is supposed to be bit for bit compatible to the original Unix
.Nm cal
-command, because its output is processed by other programs like CGI scripts,
-that should not be broken. Therefore it will always output 8 lines, even if
-only 7 contain data. This extra blank line also appears with the original
+command,
+because its output is processed by other programs like CGI scripts,
+that should not be broken.
+Therefore it will always output 8 lines,
+even if only 7 contain data.
+This extra blank line also appears with the original
.Nm cal
-command, at least on Solaris 8
+command, at least on Solaris 8.
.Sh AUTHORS
The
.Nm ncal