[Pkg-tcltk-devel] Bug#1082435: tclsh8.6.1: Some remarks and editorial changes for this man page

Bjarni Ingi Gislason bjarniig at simnet.is
Sat Sep 21 01:09:06 BST 2024


Package: tcl8.6
Version: 8.6.14+dfsg-1
Severity: minor
Tags: patch

   * What led up to the situation?

     Checking for defects with

[test-]groff -mandoc -t -K utf8 -rF0 -rHY=0 -ww -b -z < "man page"

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

   * What was the outcome of this action?


troff: backtrace: '<stdin>':187: trap-called macro '^B'
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':458: macro 'an-write-paragraph-tag'
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':499: macro 'an*TP-trap'
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':489: trap-called macro 'an-input-trap'
troff: backtrace: file '<stdin>':375
troff:<stdin>:375: warning: register '^v' not defined


   * 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.10.9-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 tcl8.6 depends on:
ii  libc6      2.40-2
ii  libtcl8.6  8.6.14+dfsg-1

tcl8.6 recommends no packages.

Versions of packages tcl8.6 suggests:
ii  tcl-tclreadline  2.3.8-2+b1

-- no debconf information
-------------- next part --------------
  Any program (person), that produces man pages, should check its content for
defects by using

groff -mandoc -t -ww -b -z [ -K utf8 | k ] <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 outputs 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 tclsh8.6.1": (possibly shortened list)

mandoc: tclsh8.6.1:8:13: WARNING: missing date, using "": TH
mandoc: tclsh8.6.1:282:2: WARNING: skipping paragraph macro: br at the end of SH
mandoc: tclsh8.6.1:284:2: WARNING: skipping paragraph macro: PP after SH
mandoc: tclsh8.6.1:297:2: WARNING: skipping paragraph macro: PP after SH
mandoc: tclsh8.6.1:370:2: WARNING: skipping paragraph macro: PP after SH
mandoc: tclsh8.6.1:396:2: WARNING: skipping paragraph macro: PP after SH
mandoc: tclsh8.6.1:410:2: WARNING: skipping paragraph macro: PP after SH

-.-.

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.

300:the text data stored in that script file. Any additional arguments

-.-.

Do not begin a decimal fraction with a period (.), but with a zero (0).

243:.ta .25i .5i .75i 1i

-.-.

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

troff: backtrace: '<stdin>':184: trap-called macro '^B'
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':458: macro 'an-write-paragraph-tag'
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':499: macro 'an*TP-trap'
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':489: trap-called macro 'an-input-trap'
troff: backtrace: file '<stdin>':375
troff:<stdin>:375: warning: register '^v' not defined

-.-

Additionally:

Define registers that are used before they are defined: ^v, ^Y
-------------- next part --------------
--- tclsh8.6.1	2024-09-20 23:36:22.182244770 +0000
+++ tclsh8.6.1.new	2024-09-20 23:53:20.046767317 +0000
@@ -76,9 +76,14 @@
 .\"	(for trailing punctuation) and then a closing parenthesis.
 .\"
 .\"	# Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
+.\" Macro ^B uses register '^v'
+.ie n .nr ^v 0
+.el .nr ^v 1
+.
 .if t .wh -1.3i ^B
 .nr ^l \n(.l
-.ad b
+.ie n .ad l
+.el .ad b
 .\"	# Start an argument description
 .de AP
 .ie !"\\$4"" .TP \\$4
@@ -149,8 +154,11 @@
 .de VS
 .if !"\\$2"" .br
 .mk ^Y
-.ie n 'mc \s12\(br\s0
-.el .nr ^v 1u
+.ie n \{\
+'  mc \s(12\(br\s0
+.  nr ^v 0
+.\}
+.el .nr ^v 1
 ..
 .\"	# VE - end of vertical sidebar
 .de VE
@@ -181,6 +189,8 @@
 .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
 .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
 .\}
+.\" define ^Y to be 0 if not defined, otherwise unchanged
+.nr ^Y +0
 .if \\n(^v \{\
 .nr ^x \\n(^tu+1v-\\n(^Yu
 \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
@@ -240,7 +250,7 @@ Database Class:	\\fB\\$3\\fR
 .de CS
 .RS
 .nf
-.ta .25i .5i .75i 1i
+.ta 0.25i 0.5i 0.75i 1i
 ..
 .\"	# CE - end code excerpt
 .de CE
@@ -281,7 +291,6 @@ tclsh \- Simple shell containing Tcl int
 \fBtclsh\fR ?\fB\-encoding \fIname\fR? ?\fIfileName arg arg ...\fR?
 .BE
 .SH DESCRIPTION
-.PP
 \fBTclsh\fR is a shell-like application that reads Tcl commands
 from its standard input or from a file and evaluates them.
 If invoked with no arguments then it runs interactively, reading
@@ -294,10 +303,10 @@ the Windows platforms) in the home direc
 the user, interactive \fBtclsh\fR evaluates the file as a Tcl script
 just before reading the first command from standard input.
 .SH "SCRIPT FILES"
-.PP
 If \fBtclsh\fR is invoked with arguments then the first few arguments
 specify the name of a script file, and, optionally, the encoding of
-the text data stored in that script file. Any additional arguments
+the text data stored in that script file.
+Any additional arguments
 are made available to the script as variables (see below).
 Instead of reading commands from standard input \fBtclsh\fR will
 read Tcl commands from the named file;  \fBtclsh\fR will exit
@@ -367,7 +376,6 @@ allowing multiple versions of Tcl to exi
 but also the disadvantage of making it harder to write scripts that
 start up uniformly across different versions of Tcl.
 .SH "VARIABLES"
-.PP
 \fBTclsh\fR sets the following global Tcl variables in addition to those
 created by the Tcl library itself (such as \fBenv\fR, which maps
 environment variables such as \fBPATH\fR into Tcl):
@@ -393,7 +401,6 @@ Contains 1 if \fBtclsh\fR is running int
 \fIfileName\fR was specified and standard input is a terminal-like
 device), 0 otherwise.
 .SH PROMPTS
-.PP
 When \fBtclsh\fR is invoked interactively it normally prompts for each
 command with
 .QW "\fB% \fR" .
@@ -407,9 +414,8 @@ a newline is typed but the current comma
 if \fBtcl_prompt2\fR is not set then no prompt is output for
 incomplete commands.
 .SH "STANDARD CHANNELS"
-.PP
 See \fBTcl_StandardChannels\fR for more explanations.
 .SH "SEE ALSO"
-auto_path(3tcl), encoding(3tcl), env(3tcl), fconfigure(3tcl)
+.BR auto_path "(3tcl), " encoding "(3tcl), " env "(3tcl), " fconfigure (3tcl)
 .SH KEYWORDS
 application, argument, interpreter, prompt, script file, shell


More information about the Pkg-tcltk-devel mailing list