1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 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
|
[manpage_begin textutil::tabify n 0.7]
[see_also regexp(n)]
[see_also split(n)]
[see_also string(n)]
[keywords formatting]
[keywords string]
[keywords tabstops]
[moddesc {Text and string utilities, macro processing}]
[titledesc {Procedures to (un)tabify strings}]
[category {Text processing}]
[require Tcl 8.2]
[require textutil::tabify [opt 0.7]]
[description]
The package [package textutil::tabify] provides commands that convert
between tabulation and ordinary whitespace in strings.
[para]
The complete set of procedures is described below.
[list_begin definitions]
[call [cmd ::textutil::tabify::tabify] [arg string] [opt [arg num]]]
Tabify the [arg string] by replacing any substring of [arg num] space
chars by a tabulation and return the result as a new string. [arg num]
defaults to 8.
[call [cmd ::textutil::tabify::tabify2] [arg string] [opt [arg num]]]
Similar to [cmd ::textutil::tabify] this command tabifies the
[arg string] and returns the result as a new string. A different
algorithm is used however. Instead of replacing any substring of
[arg num] spaces this command works more like an editor. [arg num]
defaults to 8.
[para]
Each line of the text in [arg string] is treated as if there are
tabstops every [arg num] columns. Only sequences of space characters
containing more than one space character and found immediately before
a tabstop are replaced with tabs.
[call [cmd ::textutil::tabify::untabify] [arg string] [opt [arg num]]]
Untabify the [arg string] by replacing any tabulation char by a
substring of [arg num] space chars and return the result as a new
string. [arg num] defaults to 8.
[call [cmd ::textutil::tabify::untabify2] [arg string] [opt [arg num]]]
Untabify the [arg string] by replacing any tabulation char by a
substring of at most [arg num] space chars and return the result as a
new string. Unlike [cmd textutil::tabify::untabify] each tab is not
replaced by a fixed number of space characters. The command overlays
each line in the [arg string] with tabstops every [arg num] columns
instead and replaces tabs with just enough space characters to reach
the next tabstop. This is the complement of the actions taken by
[cmd ::textutil::tabify::tabify2]. [arg num] defaults to 8.
[para]
There is one asymmetry though: A tab can be replaced with a single
space, but not the other way around.
[list_end]
[vset CATEGORY textutil]
[include ../common-text/feedback.inc]
[manpage_end]
|