6 \fB\h'-\w'\\$1'u-1m'\\$1\h'1m'\fP\c
8 .TH space 1 "27 January 2007" "Straylight/Edgeware"
10 space \- check and fix whitespace in files
20 program identifies and fixes problematic use of whitespace in text
21 files. In particular, it will notice and (if you want) fix
23 .I trailing whitespace
24 \(en tabs and spaces just before a newline;
27 \(en which are obviously pointless;
29 .I end-of-file in mid-line
30 \(en which confuses a number of programs,
34 .I trailing blank lines
35 \(en which some editors, notably Emacs, introduce by default;
37 .I groups of spaces which could be replaced by tabs
38 \(en replacing them with the appropriate tab characters; or
41 \(en replacing them with appropriate numbers of spaces.
43 The program is capable of fixing files in place (leaving backups if you
46 The following command-line options are recognized.
49 Give a short help message describing the options available.
52 Just check files, exiting zero if they're all OK, or 1 if there are
53 whitespace problems with any of them; exit 32 if there are actual
54 errors. You may want the
56 option with this; without it,
61 Check the file for trailing blank lines, i.e., lines containing only
62 horizontal whitespace. With
64 report if the file has trailing blank lines; without
66 remove these trailing blank lines from the output.
69 Report detailed messages about whitespace problems encountered. Useful
77 in place. During processing, the fixed copy of the file is written to
78 some new name not currently in use. If the processing was successful,
83 and the new file is renamed to
85 If something very complicated goes wrong at just the right moment, it's
86 possible that you'll be left with just
88 but that's not very likely. The new file is created with the same
89 permissions as the old file, but no attempt is made to give it the same
90 owner or anything like that.
93 Worry about tabs in the middle of lines as well as tabs forming the
94 initial indentation. Normally, identify (and fix) tabs preceded by
95 spaces in the middle of lines; with
97 fix all groups of whitespace which could be turned into tabs.
100 Turn runs of horizontal whitespace into tabs where possible.
103 only complain about runs of space which could be turned into tabs but
104 don't actually do anything. By default, only runs of whitespace at the
105 starts of lines are affected. With
107 however, all runs of whitespace are considered to be fair game. The
108 rules for internal whitespace are as follows. A run at the start of a
109 line, or which contains a tab is always fair game; a run of two or more
116 character, either immediately or separated only by
120 characters, in which case three spaces are required. This is because
121 some typists (including the author) put two spaces after a full stop,
122 and don't want them randomly turning into tabs for no good reason.
125 Turn tabs into appropriate numbers of spaces. With
127 only complain about finding tabs, but don't actually do anything. All
128 tabs are considered fair game here and the
132 Tab stops are assumed to occur every eight columns, as is usual.
134 There's no way yet of controlling where the tab stops are.
136 This space program doesn't even attempt moon landings. The space man
137 page doesn't have wiggly antennae.
139 The jokes in the man page are somewhat lame.
141 Mark Wooding, <mdw@distorted.org.uk>