Skip to content
Tcl Source Code Changes To Proposed changes to the Tcl/Tk manual pages
Login

Changes To Proposed changes to the Tcl/Tk manual pages

Changes to "Proposed changes to the Tcl/Tk manual pages" between 2026-11-11 08:57:13 and 2026-11-14 11:59:06

︙
48
49
50
51
52
53
54
55

56
57
58
59

60
61
62
63
64
65
66
67
68
69
70
71

72
73
74
75
76
77
78
48
49
50
51
52
53
54

55
56
57
58

59
60
61
62
63
64
65
66
67
68
69
70

71
72
73
74
75
76
77
78







-
+



-
+











-
+








A unification would be valuable. In general, it is a good idea to use a (sub)subsection for each (sub)command so that it can be handled nicely for inclusion into a TOC and can also take proper attributes (for class definition helping the HTML rendering e.g.). *A proposal for a common outline of the pages is not ready yet.*

## Inconsistent use of terms

Many commands have 'subcommands'. They are also called 'options'. However, in the SYNOPSIS section of the manual pages, the usage is mixed.

E.g., the [namespace](https://www.tcl.tk/man/tcl/TclCmd/namespace.html) page calls it 'subcommand' while the [string](https://www.tcl.tk/man/tcl/TclCmd/string.html) page calls it 'option' although they are the exact same thing, namely the second word of a command when it can have different meanings (as opposed to the usage in e.g. the [fconfigure](https://www.tcl.tk/man/tcl/TclCmd/fconfigure.html) page where the second word always means the same and therefor has a specific name reflecting this specific meaning). Let us call this the *simple case*. Further, other pages such as the [clock](https://www.tcl.tk/man/tcl/TclCmd/clock.html) page don't use this way of writing the synopsis but list every subcommand individually. Let's call this the *extended case*.
E.g., the [namespace](https://www.tcl-lang.org/man/tcl/TclCmd/namespace.html) page calls it 'subcommand' while the [string](https://www.tcl-lang.org/man/tcl/TclCmd/string.html) page calls it 'option' although they are the exact same thing, namely the second word of a command when it can have different meanings (as opposed to the usage in e.g. the [fconfigure](https://www.tcl-lang.org/man/tcl/TclCmd/fconfigure.html) page where the second word always means the same and therefor has a specific name reflecting this specific meaning). Let us call this the *simple case*. Further, other pages such as the [clock](https://www.tcl-lang.org/man/tcl/TclCmd/clock.html) page don't use this way of writing the synopsis but list every subcommand individually. Let's call this the *extended case*.

The way of presenting a command in the SYNOPSIS section should be consistent on all manual pages by using either the *extended case* on all pages or using the *simple case* (the author (TB) tends to prefer the *extended case*). When using the *simple case*, the usage of 'subcommand' or 'option' should be consistent (the author prefers the former, also because it is used in the output of the error messages inside the Tcl interpreter when using commands wrongly). In any case, when talking about the various subcommands/options in the text of the manual pages, the usage should be consistent there too.

The problem with the term 'option' is that it is also used for the real options, i.e. for the words in a command that are optional. As an example, the `namespace` manual page uses this term for the `-force` option of the `namespace import` command (is this a command or a subcommand?). Other commands such as [unload](https://www.tcl.tk/man/tcl/TclCmd/unload.htm) use the term 'switch' instead. Also this needs unification (the author tends to call everything an 'option' can takes a value, and call everything that does not take a value a 'switch').
The problem with the term 'option' is that it is also used for the real options, i.e. for the words in a command that are optional. As an example, the `namespace` manual page uses this term for the `-force` option of the `namespace import` command (is this a command or a subcommand?). Other commands such as [unload](https://www.tcl-lang.org/man/tcl/TclCmd/unload.htm) use the term 'switch' instead. Also this needs unification (the author tends to call everything an 'option' can takes a value, and call everything that does not take a value a 'switch').

There is also an inconsistency with the term 'window'. For the commands `[wm]` and `[winfo]` the term often refers to a toplevel window (although not explicitly stated) whereas for the widget commands (label, ttk::label and the others), the term 'window' refers to the widget and is not a toplevel window. This may lead to misconception that the `[wm]` and `[winfo]` commands apply to any "window". This is the case especially as there are commands such as `[winfo children]` that can also operate on any widget, not just toplevels. The term is still the same.

The proposal is to use the term 'toplevel' where a toplevel is to be specified, and use 'window' where any widget (including toplevels) can be specified.

Another inconsistency is mentioned [in this Tcl ticket on chan.n](https://core.tcl-lang.org/tcl/tktview/7be97a6859) regarding the use of *channelID* vs *channelName* and how to call the "things" in a command in general.

**In any case, it is also proposed to have a separate page actually explaining these terms and how to read the syntax (i.e. what does it mean when a term is printed in bold, italic, inside a pair of "?" and what the function of the "..." is.**

## Inconsistent use of command syntax in the SYNOPSIS

The syntax written in the "SYNOPSIS" section is also not consistent. E.g. some commands list the possible syntax with one line for each variant (e.g. [return](https://www.tcl.tk/man/tcl/TclCmd/return.html)). Others just use one line with the keyword "switches" and leave it to the DESCRIPTION to mention the possible forms (e.g. [lsort](https://www.tcl.tk/man/tcl/TclCmd/lsort.html)). The way that the syntax of a command is described in the SYNOPSIS should be the same for all manual pages.
The syntax written in the "SYNOPSIS" section is also not consistent. E.g. some commands list the possible syntax with one line for each variant (e.g. [return](https://www.tcl-lang.org/man/tcl/TclCmd/return.html)). Others just use one line with the keyword "switches" and leave it to the DESCRIPTION to mention the possible forms (e.g. [lsort](https://www.tcl-lang.org/man/tcl/TclCmd/lsort.html)). The way that the syntax of a command is described in the SYNOPSIS should be the same for all manual pages.

## Capitalization of syntax elements

The Tcl commands are presented by sometimes giving the arguments names. The `after` manual page is on example. The command `after ms` is presented with the named argument "ms". This is fine and makes it easy for readers to know what the argument is supposed to mean. However, when used in the normal text these names are using upper case letters when they are at the beginning of the text of the beginning of a sentence. Example

> *Ms* must be an integer giving a time in milliseconds.

︙
86
87
88
89
90
91
92




93
94
95
96
97
98
99
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103







+
+
+
+








> ... that was previously scheduled. [id]{.arg} indicates which command ...

Imagine these arguments are rendered with a different font and colour (possibly with another background colour) consistent with how they look like in the command line definition itself, then capitalization does not make sense at all and the rendering makes sure that no-one really would expect this anymore.

In general, arguments that are variable names should be marked as such (e.g. we now have `listVar`, `variableList`, `varName`). A uniform naming scheme is recommended here, using camelCase to avoid misunderstandings. camelCase is good for the names of longer arguments. It makes them easier to read (as a replacement of the space that otherwise would separate words) and avoids odd readings (e.g. `adict` vs `aDict`). However, abbreviation should be used sparsely (the current dictionary manual pages use "dictionaryValue" and "dictionaryVariable"). Although a long word, using these full versions avoids misunderstandings and no glossary is needed to explain that "var..." means variables and "a..." means the value inside a variable.

## General change of how the C API pages are structured

These pages are difficult to read because the information on a particular C functions tends to be spread around the page. The input and output arguments are always collected at the top of the page, the functions themselves are then described in prose in several paragraphs further below. The signature of the function is also separated from the description of its arguments (although these two items follow directly after each other). Especially for pages with many functions such as [DString](https://www.tcl-lang.org/man/tcl9.1/TclLib/DString.html) or [Hash](https://www.tcl-lang.org/man/tcl9.1/TclLib/Hash.html) it takes quite some time to collect all the information. This should be consolidated in a way similar to the script-level commands so readers can find all information regarding on function in one place. The challenge will be to do it in a form that not leads to too much redundancy, repeating the same kind of function arguments for every function (often, e.g. the first argument of a family of functions have the exact same argument). One idea could be to divide the DESCRIPTION section into individual parts, one for each function, putting the function signature in full there as well (not only in the synopsis), and when hovering over the argument a popup comes up, showing the text from the ARGUMENTS section.

# Changes in specific manual pages

## Tcl → Tcl.n

1. The Tcl.n page has a section "SYNOPSIS" but it contains nothing in terms of syntax compared to the other pages. It just says "Summary of Tcl language syntax". Unclear what to do about it here. Maybe, this page is a special case.

## Tcl → chan
︙