2 sed '/^X/s///' > ctags.man
<< '/'
5 Xctags
- Generates
"tags" and
(optionally
) "refs" files
7 X
\fBctags
\fP
[\fB
-stvra\fP
] \fIfilesnames
\fP...
9 X
\fIctags
\fP generates the
"tags" and
"refs" files
10 Xfrom a group of C
source files.
11 XThe
"tags" file is used by Elvis
' ":tag" command,
14 XThe "refs" file is sometimes used by the \fIref(1)\fP program.
16 XEach C source file is scanned for #define statements and
17 Xglobal function definitions.
18 XThe name of the macro or function becomes the name of a tag.
19 XFor each tag, a line is added to the "tags" file which contains:
22 X - the name of the tag
24 X - the name of the file containing the tag
26 X - a way to find the particular line within the file.
30 XThe filenames list will typically be the names of all C source
31 Xfiles in the current directory, like this:
40 XA tag will be generated for each user-defined type.
41 XAlso tags will be generated for struct and enum names.
42 XTypes are considered to be global if they are defined in a header file,
43 Xand static if they are defined in a C source file.
45 XInclude variable declarations.
46 XA tag will be generated for each variable, except for those that are declared
47 Xinside the body of a function.
50 X\fICtags\fR will normally put global tags in the "tags" file, and silently ignore
52 XThis flag causes both global and static tags to be added.
53 XThe name of a static tag is generated by prefixing the name of the declared
54 Xitem with the name of the file where it is defined, with a colon in between.
55 XFor example, "static foo(){}" in "bar.c" results in a tag named "bar.c:foo".
57 XThis causes \fIctags\fP to generate both "tags" and "refs".
58 XWithout \fB-r\fP, it would only generate "tags".
60 XAppend to "tags", and maybe "refs".
61 XNormally, \fIctags\fR overwrites these files each time it is invoked.
62 XThis flag is useful when you have to many files in the current directory
63 Xfor you to list them on a single command-line;
64 Xit allows you to split the arguments among several invocations.
67 XA cross-reference that lists each tag name, the name of the source file that
68 Xcontains it, and a way to locate a particular line in the source file.
70 XThe "refs" file contains the definitions for each tag in the "tags" file,
71 Xand very little else.
72 XThis file can be useful, for example, when licensing restrictions prevent
73 Xyou from making the source code to the standard C library readable by everybody,
74 Xbut you still everybody to know what arguments the library functions need.
77 X\fIctags\fR is sensitive to indenting and line breaks.
78 XConsequently, it might not discover all of the tags in a file that
79 Xis formatted in an unusual way.
89 sed '/^X
/s
///' > elvis.man << '/'
92 Xelvis, ex, vi, view, input - The editor
94 X\fBelvis\fP [\fIflags\fP] [\fB+\fP\fIcmd\fP] [\fIfiles\fP...]
96 X\fIElvis\fP is a text editor which emulates \fIvi\fP/\fIex\fP.
98 XOn systems which pass the program name as an argument, such as Unix and Minix,
99 Xyou may also install \fIelvis\fP under the names "ex", "vi", "view", and "input".
100 XThese extra names would normally be links to elvis;
101 Xsee the "ln" shell command.
103 XWhen \fIelvis\fP is invoked as "vi",
104 Xit behaves exactly as though it was invoked as "elvis".
105 XHowever, if you invoke \fIelvis\fP as "view",
106 Xthen the readonly option is set as though you had given it the "-R" flag.
107 XIf you invoke \fIelvis\fP as "ex",
108 Xthen \fIelvis\fP will start up in the colon command mode
109 Xinstead of the visual command mode,
110 Xas though you had given it the "-e" flag.
111 XIf you invoke \fIelvis\fP as "input" or "edit",
112 Xthen \fIelvis\fP will start up in input mode,
113 Xas though the "-i" flag was given.
116 XTo the real vi, this flag means that a previous edit should be recovered.
117 X\fIElvis\fP, though, has a separate program, called \fIelvrec(1)\fP, for recovering
119 XWhen you invoke \fIelvis\fP with -r, \fIelvis\fP will tell you to run \fIelvrec\fP.
121 XThis sets the "readonly" option,
122 Xso you won't accidentally overwrite a
file.
123 X.IP
"\fB-t\fP \fItag\fP"
124 XThis causes
\fIelvis
\fP to start editing
at the given tag.
125 X.IP
"\fB-m\fP [\fIfile\fP]"
126 X
\fIElvis
\fP will search through
\fIfile
\fP
for something that looks like
127 Xan error message from a compiler.
128 XIt will
then begin editing the
source file that caused the error
,
129 Xwith the cursor sitting on the line where the error was detected.
130 XIf you don
't explicitly name a \fIfile\fP, then "errlist" is assumed.
132 X\fIElvis\fP will start up in colon command mode.
134 X\fIElvis\fP will start up in visual command mode.
136 X\fIElvis\fP will start up in input mode.
137 X.IP "\fB-w\fR \fIwinsize\fR"
138 XSets the "window" option's value to
\fIwinsize
\fR.
139 X.IP
"\fB+\fP\fIcommand\fP or \fB-c\fP \fIcommand\fP"
140 XIf you use the
+\fIcommand
\fP parameter
,
141 Xthen after the first
file is loaded
142 X
\fIcommand
\fP is executed as an EX
command.
143 XA typical example would be
"elvis +237 foo",
144 Xwhich would cause
\fIelvis
\fP to start editing foo and
145 Xthen move directly to line
237.
146 XThe
"-c \fIcommand\fP" variant was added
for UNIX SysV compatibility.
150 X
\fIelvis
\fP stores text
in a temporary
file.
151 XFor UNIX
, this
file will usually be stored
in the
/tmp directory
,
152 Xand the first three characters will be
"elv".
153 XFor other systems
, the temporary files may be stored someplace
else;
154 Xsee the version-specific section of the documentation.
156 XThis is the database used by the
\fI
:tags
\fP
command and the
\fB
-t\fP option.
157 XIt is usually created by the
\fIctags
(1)\fP program.
158 X.IP
".exrc or elvis.rc"
159 XOn UNIX-like systems
, a
file called
".exrc" in your home directory
160 Xis executed as a series of
\fIex
\fR commands.
161 XA
file by the same name may be executed
in the current directory
, too.
162 XOn non-UNIX systems
, ".exrc" is usually an invalid
file name
;
163 Xthere
, the initialization
file is called
"elvis.rc" instead.
165 Xctags
(1), ref
(1), virec
(1)
167 X
\fIElvis
- A Clone of Vi
/Ex
\fP
, the complete
\fIelvis
\fP documentation.
169 XThere is no LISP support.
170 XCertain other features are missing
, too.
172 XAuto-indent mode is not quite compatible with the real vi.
173 XAmong other things
, 0^D and ^^D don
't do what you might expect.
175 XLong lines are displayed differently.
176 XThe real vi wraps long lines onto multiple rows of the screen,
177 Xbut \fIelvis\fP scrolls sideways.
184 XMany other people have worked to port \fIelvis\fP to various operating systems.
185 XTo see who deserves credit, run the \fI:version\fP command from within \fIelvis\fP,
186 Xor look in the system-specific section of the complete documentation.
189 sed '/^X
/s
///' > elvprsv.man << '/'
192 Xelvprsv - Preserve the the modified version of a file after a crash.
195 X\fB\fBelvprsv\fP ["-\fIwhy elvis died\fP"] /tmp/\fIfilename\fP...
196 X\fB\fBelvprsv\fP -R /tmp/\fIfilename\fP...
200 X\fIelvprsv\fP preserves your edited text after \fIelvis\fP dies.
201 XThe text can be recovered later, via the \fIelvprsv\fP program.
203 XFor UNIX-like systems,
204 Xyou should never need to run this program from the command line.
205 XIt is run automatically when \fIelvis\fP is about to die,
206 Xand it should be run (via /etc/rc) when the computer is booted.
209 XFor non-UNIX systems such as MS-DOS
, you can either use
\fIelvprsv
\fP
210 Xthe same way as under UNIX systems
(by running it from your AUTOEXEC.BAT
file),
211 Xor you can run it separately with the
"-R" flag to recover the files
214 XIf you
're editing a file when \fIelvis\fP dies
215 X(due to a bug, system crash, power failure, etc.)
216 Xthen \fIelvprsv\fP will preserve the most recent version of your text.
217 XThe preserved text is stored in a special directory; it does NOT overwrite
218 Xyour text file automatically.
220 X\fIelvprsv\fP will send mail to any user whose work it preserves,
221 Xif your operating system normally supports mail.
224 XThe temporary file that \fIelvis\fP was using when it died.
225 X.IP /usr/preserve/p*
226 XThe text that is preserved by \fIelvprsv\fP.
227 X.IP /usr/preserve/Index
228 XA text file which lists the names of all preserved files, and the names
229 Xof the /usr/preserve/p* files which contain their preserved text.
232 XDue to the permissions on the /usr/preserve directory, on UNIX systems
233 X\fIelvprsv\fP must be run as superuser.
234 XThis is accomplished by making the \fIelvprsv\fP executable be owned by "root"
235 Xand turning on its "set user id" bit.
237 XIf you're editing a nameless buffer when
\fIelvis
\fP dies
, then \fIelvprsv
\fP will pretend
238 Xthat the
file was named
"foo".
246 sed '/^X/s///' > elvrec.man
<< '/'
249 Xelvrec
- Recover the modified version of a
file after a crash
252 X
\fBelvrec
\fP
[\fIpreservedfile
\fP
[\fInewfile
\fR
]]
256 XIf you
're editing a file when \fIelvis\fP dies, the system crashes, or power fails,
257 Xthe most recent version of your text will be preserved.
258 XThe preserved text is stored in a special directory; it does NOT overwrite
259 Xyour text file automatically.
261 XThe \fIelvrec\fP program locates the preserved version of a given file,
262 Xand writes it over the top of your text file -- or to a new file, if you prefer.
263 XThe recovered file will have nearly all of your changes.
265 XTo see a list of all recoverable files, run \fIelvrec\fP with no arguments.
267 X.IP /usr/preserve/p*
268 XThe text that was preserved when \fIelvis\fP died.
269 X.IP /usr/preserve/Index
270 XA text file which lists the names of all preserved files, and the names
271 Xof the /usr/preserve/p* files which contain their preserved text.
274 X\fIelvrec\fP is very picky about filenames.
275 XYou must tell it to recover the file using exactly the same pathname as
276 Xwhen you were editing it.
277 XThe simplest way to do this is to go into the same directory that you were
278 Xediting, and invoke \fIelvrec\fP with the same filename as \fIelvis\fP.
279 XIf that doesn't work
, then try running
\fIelvrec
\fP with no arguments
,
280 Xto see exactly
which pathname it is using
for the desired
file.
282 XDue to the permissions on the
/usr
/preserve directory
, on UNIX systems
283 X
\fIelvrec
\fP must be run as superuser.
284 XThis is accomplished by making the
\fIelvrec
\fP executable be owned by
"root"
285 Xand setting its
"set user id" bit.
287 XIf you
're editing a nameless buffer when \fIelvis\fP dies, then \fIelvrec\fP
288 Xwill pretend that the file was named "foo".
296 sed '/^X
/s
///' > fmt.man << '/'
299 Xfmt - adjust line-length for paragraphs of text
301 X\fBfmt\fP [\-\fIwidth\fP] [\fIfiles\fP]...
303 X\fIfmt\fR is a simple text formatter.
304 XIt inserts or deletes newlines, as necessary, to make all lines in a
305 Xparagraph be approximately the same width.
306 XIt preserves indentation and word spacing.
308 XThe default line width is 72 characters.
309 XYou can override this with the \-\fIwidth\fR flag.
310 XIf you don't name any files on the
command line
,
311 Xthen
\fIfmt
\fR will
read from stdin.
313 XIt is typically used from within
\fIvi
\fR to adjust the line breaks
314 Xin a single paragraph.
315 XTo
do this
, move the cursor to the top of the paragraph
,
325 sed '/^X/s///' > ref.man
<< '/'
328 Xref
- Display a C
function header
330 X
\fBref
\fR
[-t] [-c \fIclass
\fR
]...
[-f \fIfile
\fR
]...
\fItag
\fR
332 X
\fIref
\fP quickly locates and displays the header of a
function.
333 XTo
do this
, \fIref
\fR
334 Xlooks
in the
"tags" file for the line that describes the
function, and
then
335 Xscans the
source file for the
function.
336 XWhen it locates the
function, it displays an introductory comment
337 X
(if there is one
), the
function's declaration, and the declarations of all
341 X\fIref\fR uses a fairly sophisticated tag look-up algorithm.
342 XIf you supply a filename via \fB-f\fR \fIfile\fR, then elvis first scans
343 Xthe tags file for a static tag from that file.
344 XThis search is limited to the tags file in the current directory.
346 XIf you supply a classname via \fB-c\fR \fIclass\fR, then elvis searches
347 Xfor a tag from that class.
348 XThis search is not limited to the current directory;
349 XYou can supply a list of directories in the environment variable \fITAGPATH\fR,
350 Xand \fIref\fR will search through the "tags" file in each directory until it finds
351 Xa tag in the desired class.
353 XIf that fails, \fIref\fR will then try to look up an ordinary global tag.
354 XThis search checks all of the directories listed in \fITAGPATH\fR, too.
356 XIf you've given the
\fB
-t\fR flag
, then \fIref
\fR will simply output the tag line that
357 Xit found
, and
then exit.
358 XWithout
\fB
-t\fR
, though
, \fIref
\fR will search
for the tag line.
359 XIt will try to open the
source file, which should be
in the same directory
360 Xas the tags
file where the tag was discovered.
361 XIf the
source file doesn
't exist, or is unreadable, then \fIref\fR will try to open
362 Xa file called "\fIrefs\fR" in that directory.
363 XEither way, \fIref\fR will try to locate the tag, and display whatever it finds.
364 X.SH "INTERACTION WITH ELVIS"
366 X\fIref\fP is used by \fIelvis\fR' shift-K
command.
367 XIf the cursor is located on a word such as
"splat", in the
file "foo.c",
368 Xthen
\fIelvis
\fR will invoke
\fIref
\fR with the
command "ref -f foo.c splat".
370 XIf
\fIelvis
\fR has been compiled with the
-DEXTERNAL_TAGS flag
, then \fIelvis
\fR will
371 Xuse
\fIref
\fR
\fB
\fRto scan the tags files.
372 XThis is slower than the built-in tag searching
, but it allows
\fIelvis
\fR to access
373 Xthe
more sophisticated tag lookup provided by
\fIref
\fR.
374 XOther than that
, external tags should act exactly like internal tags.
377 XOutput tag info
, instead of the
function header.
378 X.IP
"\fB-f\fR \fIfile\fR"
379 XThe tag might be a static
function in \fIfile
\fR.
380 XYou can use several
-f flags to have
\fIref
\fR consider static tags from
more than one
file.
381 X.IP
"\fB-c\fR \fIclass\fR"
382 XThe tag might be a member of class
\fIclass
\fR.
383 XYou can use several
-c flags to have
\fIref
\fR consider tags from
more than one class.
386 XList of
function names and their locations
, generated by
\fIctags
\fR.
388 XFunction headers extracted from
source files
(optional
).
391 XList of directories to be searched.
392 XThe elements
in the list are separated by either
393 Xsemicolons
(for MS-DOS
, Atari TOS
, and AmigaDos
), or
394 Xby colons
(every other operating system
).
395 XFor each operating system
, \fIref
\fR has a built-in default
which is probably
399 XYou might want to generate a
"tags" file the directory that contains the
400 Xsource code
for standard C library on your system.
401 XIf licensing restrictions prevent you from making the library
source readable
402 Xby everybody
, then you can have
\fIctags
\fR generate a
"refs" file,
403 Xand
make "refs" readable by everybody.
405 XIf your system doesn
't come with the library source code, then perhaps you
406 Xcan produce something workable from the \fIlint\fR libraries.