diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2004-07-06 09:27:31 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2004-07-06 09:27:31 (GMT) |
| commit | 3f9238ba86d26ff58b3e75437b45e4119b5d095e (patch) | |
| tree | 7c3d61b3105e86ade815a6ee352e44b38a2685a3 /tools/man2html2.tcl | |
| parent | fc258418a8b42865426d6ce2b08cf6878a26bcaf (diff) | |
| download | tcl-3f9238ba86d26ff58b3e75437b45e4119b5d095e.zip tcl-3f9238ba86d26ff58b3e75437b45e4119b5d095e.tar.gz tcl-3f9238ba86d26ff58b3e75437b45e4119b5d095e.tar.bz2 | |
More elegant fix for tab size handling
Diffstat (limited to 'tools/man2html2.tcl')
| -rw-r--r-- | tools/man2html2.tcl | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/tools/man2html2.tcl b/tools/man2html2.tcl index 399b54c..3e1344e 100644 --- a/tools/man2html2.tcl +++ b/tools/man2html2.tcl @@ -5,7 +5,7 @@ # # Copyright (c) 1996 by Sun Microsystems, Inc. # -# $Id: man2html2.tcl,v 1.5 2004/07/06 09:25:48 dkf Exp $ +# $Id: man2html2.tcl,v 1.6 2004/07/06 09:27:31 dkf Exp $ # # Global variables used by these scripts: @@ -519,27 +519,26 @@ proc setTabs {tabList} { set relative 0 } # Always operate in relative mode for "measurement" mode - if {[regexp {^\\w'.*'u$} $arg]} { - append tabString " 1" - set last [expr {$last + 2}] - continue - } - if {[scan $arg "%f%s" distance units] != 2} { - puts stderr "bad distance \"$arg\"" - return 0 - } - switch -- $units { - c { - set distance [expr {$distance * $charsPerInch / 2.54}] - } - i { - set distance [expr {$distance * $charsPerInch}] + if {[regexp {^\\w'(.*)'u$} $arg content]} { + set distance [string length $content] + } else { + if {[scan $arg "%f%s" distance units] != 2} { + puts stderr "bad distance \"$arg\"" + return 0 } - default { - puts stderr "bad units in distance \"$arg\"" - continue + switch -- $units { + c { + set distance [expr {$distance * $charsPerInch / 2.54}] + } + i { + set distance [expr {$distance * $charsPerInch}] + } + default { + puts stderr "bad units in distance \"$arg\"" + continue + } } - } + } # ? distance if {$relative} { append tabString [format "%*s1" [expr {round($distance-1)}] " "] |
