tcl(9)
[Home]
[Commands]
[Variables]
[Macro-Dev]
[Glossary]
SYNOPSIS
tcl, tk - TCL Programming language templates
FILES
hktcl.emf - TCL/TK programming language hook definition
tcl.eaf - TCL/TK programming language abbreviation file
tcl.etf - TCL/TK programming language template file
EXTENSIONS
MAGIC STRINGS
^#![ \t]*/.*wish
MicroEmacs recognizes the magic string on the first line of the file used to locate the executable. The tcl files may be extension less and are still recognized.
DESCRIPTION
The tcl provides hilighting and automatic formatting features, in addition to a number of tools to handle the file type.
General Editing
On creating a new file, a new header is automatically included into the file.
time(2m) is by default enabled, allowing the modification time-stamp to be maintained in the header.
Hilighting
The hilighting features allow commands, variables, logical, preprocessor definitions, comments, strings and characters of the language to be differentiated and rendered in different colors.
Abbreviations
The installation comes with a default abbreviation file for Tcl file editing which can be used by writing short abbreviations like "if", "else" (else) or "proc" (procedure) - and then pressing the key-binding for the
expand-abbrev-handle(3) command. The list of abbreviations can be used interactively in the GUI version of MicroEmacs using the
abbrev-list(3) command.
Auto Layout
Tags
A C-tags file may be generated within the editor using the Tools -> Tcl-Tools -> Generate Tag File.
find-tag(2) takes the user to the file using the tag information.
Folding and Information Hiding
Generic folding is enabled within the C and C++ files. The folds occur about braces {...} located on the left-hand margin.
collapse-all(3) (un)folds all regions in the file,
collapse-current(3) (un)folds the current region. Note that folding does not operate on K&R style code.
Navigation via Item List
The Tcl mode offers beside folding as well support for displaying an outline of the procedures, methods and classes for easy navigation using the
item-list(3) command.
Short Cuts
The short cut keys used within the buffer are:-
C-c C-c - Comment out the current line.
C-c C-d - Uncomment the current line.
C-c C-e - Comment to the end of the line with hashes (#).
A-C-i - Restyle the current region.
f2 - (un)fold the current region
f3 - (un)fold all regions
f6 - List items
esc f6 - Close item list
Executing, Formatting and Linting Tcl Code
The Tcl file hook supports the
file-exec(3), the
file-format(3) and the
file-lint(3) macros. The tools, compilers which are currently supported are "tclsh" the Tcl interpreter and "tclint" a Python package to lint Tcl code and "tclfmt" which is a formatter as well provided by the "tclint" Python package. The formatter and the linter can be installed using the Python package manager "pip". Here an example on how to install them for the current user:
pip install tclint --user
SEE ALSO
abbrev-list(3),
collapse-all(3),
collapse-current(3),
expand-abbrev-handle(3),
file-exec(3),
file-format(3),
file-lint(3),
find-tag(2),
indent(2),
item-list(3),
restyle-buffer(3),
restyle-region(3),
tcltags(3f),
time(2m).
Supported File Types
(c) Copyright JASSPA 2025
Last Modified: 2025/08/28
Generated On: 2025/09/29