1textutil::tabify(n)Text and string utilities, macro processintgextutil::tabify(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       textutil::tabify - Procedures to (un)tabify strings
9

SYNOPSIS

11       package require Tcl  8.2
12
13       package require textutil::tabify  ?0.7?
14
15       ::textutil::tabify::tabify string ?num?
16
17       ::textutil::tabify::tabify2 string ?num?
18
19       ::textutil::tabify::untabify string ?num?
20
21       ::textutil::tabify::untabify2 string ?num?
22
23_________________________________________________________________
24

DESCRIPTION

26       The  package  textutil::tabify  provides  commands that convert between
27       tabulation and ordinary whitespace in strings.
28
29       The complete set of procedures is described below.
30
31       ::textutil::tabify::tabify string ?num?
32              Tabify the string by replacing any substring of num space  chars
33              by  a  tabulation  and  return  the  result as a new string. num
34              defaults to 8.
35
36       ::textutil::tabify::tabify2 string ?num?
37              Similar to ::textutil::tabify this command tabifies  the  string
38              and returns the result as a new string. A different algorithm is
39              used however. Instead of replacing any substring of  num  spaces
40              this command works more like an editor. num defaults to 8.
41
42              Each  line of the text in string is treated as if there are tab‐
43              stops every num columns. Only sequences of space characters con‐
44              taining  more  than  one  space  character and found immediately
45              before a tabstop are replaced with tabs.
46
47       ::textutil::tabify::untabify string ?num?
48              Untabify the string by replacing any tabulation char by  a  sub‐
49              string of num space chars and return the result as a new string.
50              num defaults to 8.
51
52       ::textutil::tabify::untabify2 string ?num?
53              Untabify the string by replacing any tabulation char by  a  sub‐
54              string of at most num space chars and return the result as a new
55              string.  Unlike  textutil::tabify::untabify  each  tab  is   not
56              replaced  by  a  fixed  number of space characters.  The command
57              overlays each line in the string with tabstops every num columns
58              instead  and  replaces tabs with just enough space characters to
59              reach the next tabstop. This is the complement  of  the  actions
60              taken by ::textutil::tabify::tabify2. num defaults to 8.
61
62              There is one asymmetry though: A tab can be replaced with a sin‐
63              gle space, but not the other way around.
64

BUGS, IDEAS, FEEDBACK

66       This document, and the package it describes, will  undoubtedly  contain
67       bugs  and  other problems.  Please report such in the category textutil
68       of       the       Tcllib       SF       Trackers       [http://source
69       forge.net/tracker/?group_id=12883].   Please  also report any ideas for
70       enhancements you may have for either package and/or documentation.
71

SEE ALSO

73       regexp(n), split(n), string(n)
74

KEYWORDS

76       formatting, string, tabstops
77
78
79
80textutil                              0.7                  textutil::tabify(n)
Impressum