Debian Codegraph @

doc/intro.nr

raw
1 .\" ditroff -ms
2 .\"##########################################################################
3 .\"# This program is Copyright (C) 1986-2002 by Jonathan Payne. JOVE is #
4 .\"# provided by Jonathan and Jovehacks without charge and without #
5 .\"# warranty. You may copy, modify, and/or distribute JOVE, provided that #
6 .\"# this notice is included in all the source files and documentation. #
7 .\"##########################################################################
8 .
9 .\" intro.nr: the first half of the JOVE manual (not manpage!).
10 .\"
11 .\" To produce the whole manual,
12 .\" tbl intro.nr | [nt]roff -ms - cmds.nr contents.nr
13 .
14 .\" In troff, `\` tends to overlap the characters to its left or right. In
15 .\" this text, therefore, it is usually preceded and followed by '\' (a thin
16 .\" space, ignored in nroff). Exceptions are where it it adjacent to
17 .\" whitespace, and the specific cases '\"', '\|', '\1', '\)' and '\}' which
18 .\" appear better left alone.
19 .
20 .de IQ \" italics (here, in manual) or quote (in describe-command)
21 \&\\fI\\$1\\fP\\$2
22 ..
23 .de BQ \" bold (here, in manual) or quote (in describe-command)
24 \&\\fB\\$1\\fP\\$2
25 ..
26 .de dc
27 .NH 2
28 \\$1
29 .if '\\$2'(variable)' (variable)
30 .if !'\\$2'(variable)' (\\$2)
31 .XS \\n(PN 5n
32 \\*(SN
33 \\$1
34 .if '\\$2'(variable)' (variable)
35 .XE
36 .LP
37 ..
38 .de HH
39 .nr Op \\n(PS
40 .RT
41 .ne 4.1
42 .if \\$1=1 .nr PS +4
43 .if \\$1=2 .nr PS +2
44 .NH \\$1
45 \\$2
46 .if \\$1=1 .XS
47 .if \\$1=2 .XS \\n(PN 5n
48 .if \\$1=3 .XS \\n(PN 10n
49 .if \\$1=4 .XS \\n(PN 15n
50 .ps 10
51 \\*(SN
52 \\$2
53 .XE
54 .nr PS \\n(Op
55 .ps \\n(PS
56 ..
57 .
58 .\" Change the extra vertical spacing around .DS/.DE
59 .\" Does not work with groff's version of MS (GS is 1 iff groff MS)
60 .if !\n(GS .if n .nr DD 0v
61 .if !\n(GS .if t .nr DD \n(PD/2u
62 .
63 .nr LL 6.5i
64 .nr LT 6.5i
65 .nr Ww (\n(LL-30n-4n)/1n
66 .EH '%'JOVE User Manual''
67 .OH ''JOVE User Manual'%'
68 .TL
69 JOVE User Manual
70 .br
71 Version 4.17
72 .AU
73 Jonathan Payne
74 (with revisions by Doug Kingston, Mark Seiden, D. Hugh Redelmeieir, Mark Moraes and Charles Lindsey)
75 .AI
76 .AB no
77 .AE
78 .HH 1 "Introduction"
79 .LP
80 \s-2JOVE\s0*
81 .FS
82 *\s-2JOVE\s0 stands for Jonathan's Own Version of \s-2EMACS\s0.
83 .FE
84 is an advanced, self-documenting, customizable, display editor.
85 It (and this tutorial introduction) are based on the original \s-2EMACS\s0
86 editor and user manual written at M.I.T. by Richard Stallman\(dg.
87 .FS
88 \(dgAlthough \s-2JOVE\s0 is meant to be compatible with \s-2EMACS\s0,
89 and indeed many of the basic commands are very similar,
90 there are some major differences between the two editors,
91 and you should not rely on their behaving identically.
92 .FE
93 .LP
94 \s-2JOVE\s0 is considered a display
95 editor because normally the text being
96 edited is visible on the screen and is updated automatically as you
97 type your commands. What You See Is What You Get.
98 .KS
99 .LP
100 \s-2JOVE\s0 provides many facilities that go beyond
101 simple insertion and deletion. Some of the more advanced features are:
102 .DS
103 cut and paste (or kill and yank in our terminology);
104 search and replace using regular-expressions;
105 multiple files, buffers and windows available simultaneously;
106 filling of text, both on demand and as you type;
107 manipulation of words, lines, sentences and paragraphs;
108 automatic indentation of programs;
109 automatic location of procedure definitions;
110 executing programs, capturing their output in buffers;
111 automatic location of spelling and compilation errors;
112 parenthesis matching.
113 .DE
114 .KE
115 .LP
116 \s-2JOVE\s0 is self-documenting insofar as you can call up descriptions of
117 commands, variables and key bindings.
118 .KS
119 .LP
120 \s-2JOVE\s0 is customizable insofar as you can
121 .DS
122 change its behavior by changing appropriate variables;
123 change its behavior by setting appropriate modes;
124 automatically set the modes for a buffer from its filename;
125 define macros to perform complex tasks;
126 change the key bindings to match features of the particular keyboard.
127 .DE
128 .KE
129 All of these options can be exercised by the system administrator, or by the
130 user at startup, or even in the middle of a job.
131 .LP
132 Finally, mouse support
133 is available (on screens which support the X-Windows package from M.I.T.)
134 using the front end program \fIxjove\fP
135 (or alternatively via the mouse-reporting facilities of the terminal emulator
136 \fIxterm\fP).
137 .KS
138 .HH 1 "The Organization of the Screen"
139 .LP
140 \s-2JOVE\s0 divides the screen into several sections.
141 .TS
142 center;
143 =
144 || L1 || L .
145
146 #include <stdio.h>
147
148 void main()
149 {
150 \ \ \ \ printf("Hello world!\^\e\^n");
151 \ \ \ \ return 0; <\ the Window
152 }
153
154 _
155 \fBJOVE\ (C OvWrt)\ \ \ [Main:1]\ \ "hello.c"\ \ \(**\ \ /home/foo\fP <\ the Mode Line
156 _
157 : write-file (default hello.c) aloha.c\^\(sq <\ the Message Line
158 =
159 .TE
160 .KE
161 .HH 2 "The Window"
162 .LP
163 The Window section is used to display the text you are editing.
164 The terminal's cursor shows the position of \fIpoint\fP,
165 the location at which editing takes place.
166 While the cursor appears to point \fIat\fP a character,
167 point should be thought of as between characters;
168 it points \fIbefore\fP the character that the cursor appears to be on top of.
169 Terminals have only one cursor,
170 and when output is in progress it must appear where the typing is being done.
171 This doesn't mean that point is moving;
172 it is only that \s-2JOVE\s0 has no way of
173 showing you the location of point except when the terminal is idle.
174 In the example, the user is in the middle of issuing a \fIwrite-file\fP
175 command, so the cursor is at the end of the message line.
176 .HH 3 "Typeout"
177 .LP
178 The lines of the window are usually available for displaying text but
179 sometimes are pre-empted by typeout from certain commands (such as a
180 listing of all the buffers).
181 You can always recognize such \fItypeout\fP because it is terminated by
182 either an \fB--end--\fP line or a \fB--more--\fP line.
183 Most of the time,
184 output from commands like these is only desired for a short period of time,
185 usually just long enough to glance at it.
186 When you have finished looking at the output,
187 you can type Space to make the text reappear
188 (usually a Space that you type inserts itself, but when there is typeout in
189 the window, it does nothing but get rid of that).
190 Any other command executes normally,
191 .I after
192 redrawing your text.
193 .LP
194 You will see \fB--more--\fP on the line above the last mode line
195 when typeout from a command is too long to fit on the screen.
196 It means that if you type a Space the next screenful of typeout will be
197 printed. If you are not interested, typing ^G will cause the rest of the
198 output to be discarded. Typing any other key will discard the rest of the
199 output and that key will be taken as the next keyboard input. Similarly,
200 \fB--end--\fP signifies that typeout is complete; the same responses are
201 accepted.
202 .LP
203 Sometimes you may wish to keep a permanent record of the typeout from these
204 commands. To do this, set the variable \fIsend-typeout-to-buffer\fP to
205 \fIon\fP. The typeout will then be put into a newly-created buffer, which
206 you can arrange to save to a permanent file.
207 .HH 2 "The Mode Line"
208 .LP
209 The Mode Line gives information about the window above it. There is a
210 variable \fImode-line\fP which determines the layout of the mode line. For
211 the example above, this was set as described in the section on customizing
212 \s-2JOVE\s0.
213 .LP
214 \fB(C OvWrt)\fP shows that \fBC\fP is the name of the current \fImajor
215 mode\fP and that the OverWrite \fIminor mode\fP is turned on.
216 .LP
217 At any time, \s-2JOVE\s0 can be in only one major mode.
218 Currently there are four major modes: \fIFundamental\fP,
219 \fIText\fP, \fILisp\fP and \fIC\fP. New ones may be added in the future.
220 .KS
221 .LP
222 The words which indicate which minor modes are turned on are:
223 .DS
224 \fBWoAbbr\fP meaning that \fIWord Abbrev\fP mode is on;
225 \fBAuInd\fP meaning that \fIAuto Indent\fP mode is on;
226 \fBAuFill\fP meaning that \fIAuto Fill\fP mode is on;
227 \fBOvWrt\fP meaning that \fIOver Write\fP mode is on;
228 \fBReadO\fP meaning that \fIRead Only\fP mode is on.
229 \fBShoMat\fP meaning that \fIShow Match\fP mode is on.
230 \fBDBX\fP meaning that \fIDBX\fP mode is on.
231 \fBDef\fP meaning that you are in the process of defining a keyboard macro.
232 (This is not really a mode, but it's useful to be reminded about it.)
233 .DE
234 .KE
235 The meanings of these modes are described later in this document.
236 .LP
237 \fB[Main:1]\fP shows that the name of the currently selected \fIbuffer\fP
238 is \fBMain\fP and its number is \fB1\fP.
239 Each buffer has its own name and holds a file being edited,
240 which is how \s-2JOVE\s0 can hold several files at once.
241 But at any given time you are editing only one of them,
242 the \fIselected\fP buffer.
243 When we speak of what some command does to \*Qthe buffer\*U,
244 we are talking about the currently selected buffer.
245 Multiple buffers make it easy to switch around between several files,
246 and then it is very useful that
247 the mode line tells you which one you are editing at any time.
248 .LP
249 \fB"hello.c"\fP shows the name of the file being edited in buffer \fBMain\fP.
250 This is also the default filename for commands that expect a filename as
251 input, as can be seen in the message line which follows.
252 .LP
253 The \(** in the mode line means that there are changes in
254 the buffer that have not been saved in the file.
255 If the buffer had not been changed since it was read in or last saved,
256 there would be a minus instead.
257 .LP
258 Sometimes a file is changed ``behind \s-2JOVE\s0's back'': something
259 changes the file (not the buffer) after it has been loaded into or
260 saved from a buffer. This can be quite dangerous, so \s-2JOVE\s0
261 tests for this when it reads, writes, or finds the file.
262 \s-2JOVE\s0 indicates the problem by displaying a # before the
263 change indicator. It also asks for confirmation before performing
264 the read or write.
265 .LP
266 \fB/home/foo\fP shows the name of the current directory.
267 .LP
268 \fB15.23\fP shows the time.
269 .HH 2 "The Message Line"
270 .LP
271 The Message Line
272 is reserved for printing messages and for accepting input from the user,
273 such as filenames or search strings.
274 When
275 \s-2JOVE\s0
276 prompts for input,
277 the cursor will temporarily appear on the bottom line, waiting for you
278 to type a string.
279 When you have finished typing your input, you can
280 type a Return to send it to \s-2JOVE\s0.
281 If you change your mind about running the command that is waiting for input,
282 you can type ^G to abort,
283 and you can then continue with your editing.
284 .LP
285 The message line and the list of filenames from the shell command that
286 invoked \s-2JOVE\s0 are kept in a special buffer called
287 \fIMinibuf\fP that can be edited like any other buffer.
288 It is instructive to view the Minibuf in a window and to observe how it changes
289 as parameters to commands are typed, and as the ^N and ^P functions are
290 invoked.
291 .HH 2 "Multiple Windows"
292 .LP
293 The window area, described above, can in fact be split into several
294 \fIwindows\fP, each showing a different \fIbuffer\fP, or possibly different
295 parts of the same buffer. Each window has its own mode line beneath it. The
296 methods of creating and destroying windows will be described presently.
297 .HH 1 "Input Conventions"
298 .LP
299 .HH 2 "Keyboard Usage"
300 .LP
301 In this manual,
302 \*QControl\*U characters
303 (that is, characters that are typed with the Control key
304 and some other key at the same time)
305 are represented by a circumflex (^) followed by another character.
306 Thus,
307 ^A is the character you get when you type A with the Control key
308 (sometimes labeled CTRL) held down.
309 Control characters in the \s-2JOVE\s0
310 buffer are displayed with a caret; thus, ^A for Control-A.
311 DEL is displayed as ^?, ESC as ^[.
312 .LP
313 If the keyboard has extra keys, such as Function keys, Arrow keys and the
314 like, then \s-2JOVE\s0 can be customized to use them.
315 .HH 2 "The Character Set"
316 .LP
317 \s-2JOVE\s0 normally accepts the ASCII character set, with its 95 printing
318 characters, including Space, (which appear on the screen as themselves) and
319 its 33 Control characters (which, except for TAB, appear on the screen as,
320 e.g. \*Q\^^C\*U). There are, however, two characters that may not appear.
321 One is the NL character (because it is always converted into a
322 \fIline-separator\fP, which is not quite a character) and the other is the
323 NUL character (^@) which is used internally
324 within \s-2JOVE\s0 to delimit lines (lines also have a maximum length,
325 which is 1023 in most systems).
326 .LP
327 However, \s-2JOVE\s0 is \*Q8-bit clean\*U, so if your keyboard is able to
328 produce all 256 8-bit characters, the extra ones will appear in octal (e.g.
329 \*Q\^\e\^277\*U). Moreover, if your
330 .UX
331 system supports the \fILocale\fP facility (as most modern ones do), you may
332 set the variable \fIlc-ctype\fP to \*QC\*U (the default, which corresponds
333 to pure ASCII), or to \*Qiso_8859_1\*U (which corresponds to the Latin-1
334 alphabet with a total of 192 printing characters, all of which \s-2JOVE\s0
335 should be able to display), or to any other \fILocale\fP available on your
336 system. The initial value of \fIlc-ctype\fP is taken from your LC_CTYPE
337 environment variable, and otherwise defaults to \*QC\*U. With each
338 \fILocale\fP \s-2JOVE\s0 will know which of the extra characters are
339 upper-case letters, lower-case letters, etc.
340 .HH 2 "Name Completion"
341 .LP
342 \s-2JOVE\s0 knows the names of all sorts of objects, such as \s-2JOVE\s0
343 Commands, \s-2JOVE\s0 Variables, Macros, Keymaps, Buffers and even (with
344 some help from the
345 .UX
346 directories) Files. Since names must be entered often, \s-2JOVE\s0
347 has features to make this easier.
348 .LP
349 For many names, \s-2JOVE\s0 is willing to supply a default if
350 you enter an empty answer. For example, when you are telling
351 .IQ select-buffer
352 which buffer to select, it will default to the previous buffer.
353 When the prompt mentions a default, this is the value that will
354 be used in place of an empty answer.
355 .LP
356 If the default isn't the name you want, name completion can help
357 you enter a name. When you are prompted for a name, you need type
358 only enough letters to make it unambiguous. At any point in the course of
359 typing the name, you can type question mark (?) to see a list of all the
360 relevant names which begin with the characters you have already typed; you
361 can type Tab to have \s-2JOVE\s0 supply as many characters as it can; or you
362 can type Return to terminate your input, or you can type Space to do both
363 (supply the characters and terminate). For example, you are typing a
364 Command and you have so far typed the letters \*Q\fIau\fP\*U and you then
365 type a question mark, you will see the list
366 .DS I
367 auto-execute-command
368 auto-execute-macro
369 auto-fill-mode
370 auto-indent-mode
371 .DE
372 If you type a Return at this point, \s-2JOVE\s0 will complain by ringing
373 the bell, because the letters you have typed do not unambiguously specify a
374 single command. But if you type Tab or Space, \s-2JOVE\s0 will supply the
375 characters \*Q\fIto-\fP\*U because all commands that begin \*Q\fIau\fP\*U also
376 begin \*Q\fIauto-\fP\*U. You could then type the letter \*Qf\*U followed
377 by either Space or Return, and \s-2JOVE\s0 would complete and obey the entire
378 command.
379 .LP
380 There are in fact two cases that can arise.
381 .IP 1.
382 .B
383 The name you are typing is supposed to exist already
384 .R
385 (Commands, Variables and Keymaps always, Macros and Buffers except when you
386 are trying to create a new one).
387 .br
388 If you type Return and what you have typed is not an unambiguous prefix of
389 any name of the right kind, you will hear the bell; otherwise, it will
390 complete what you have typed and then use it. Tab will complete what it can
391 (you can then type Return if it looks right). Space will complete what it
392 can and use it if it then matches.
393 .IP 2.
394 .B
395 The name you are typing may be a new one
396 .R
397 (Files always, Macros (including the Keyboard Macro) and Buffers if you are
398 allowed to create or rename one at that point).
399 .br
400 If you type Return, and it does not match any name, then it will take
401 exactly what you have typed as a new name. Tab and Space try to complete as
402 before.
403 .LP
404 If you type ^R, it will insert a name that might be useful. Even if
405 this name is not the one you wish to enter, it is often convenient
406 to edit this name into the desired one. The inserted name will be
407 the default (if there is one), or the current value (if there is
408 one). When \s-2JOVE\s0 is asking for a command or variable name, ^R
409 will insert the last one named.
410 .LP
411 Buffers, keymaps, and macros are also numbered (if you type \*Q?\*U when
412 first prompted, you will see the numbers as well as the possible names), and
413 the number may be used in place of the name.
414 .HH 3 "Filename Completion"
415 .LP
416 Whenever \s-2JOVE\s0 is prompting you for a filename, say in the
417 \fIfind-file\fP command, things happen as just described and Return always
418 accepts the name just as it is (because you might be wanting to create a new
419 file with a name similar to that of an existing one). The variable
420 \fIbad-filename-extensions\fP contains a list of words separated by spaces
421 which are to be considered bad filename extensions; any filename with one of
422 these extensions will not be counted in filename completion. The default
423 includes \*Q.o\*U so if you have jove.c and jove.o in the same directory,
424 the filename completion will not complain of an ambiguity because it will
425 ignore jove.o.
426 .LP
427 When \s-2JOVE\s0 is prompting for a \fIfilename\fP,
428 it has the following extra functions:
429 .IP "^N"
430 Insert the next filename from the argument list in the Minibuf.
431 .IP "^P"
432 Insert the previous filename from the argument list in the Minibuf.
433 .HH 1 "Commands and Variables"
434 .HH 2 "Commands"
435 .LP
436 \s-2JOVE\s0 uses \fIcommands\fP
437 which have long names such as
438 \fInext-line\fP.
439 Then \fIkeys\fP such as ^N are connected to
440 commands through the \fIcommand dispatch table\fP.
441 When we say that ^N moves the cursor down a line,
442 we are glossing over a distinction which is unimportant for ordinary use,
443 but essential for simple customization:
444 it is the command \fInext-line\fP which knows how to move down a line,
445 and ^N moves down a line because it is connected to that command.
446 The name for this connection is a \fIbinding\fP; we say that the key
447 ^N \fIis bound to\fP the command \fInext-line\fP (or vice versa). \s-2JOVE\s0 has many
448 bindings already \fIbuilt-in\fP, but you (or your system administrator) may
449 also add your own, e.g. to make full use of any Function Keys provided on your
450 particular keyboard.
451 .LP
452 Thus there may be three ways to refer to a command \(em by its full name, or
453 by its standard (built-in) binding, or by your customized binding.
454 Throughout this manual, we shall always use the standard bindings,
455 followed by the full name (in italics). The standard bindings are designed
456 to work on any ASCII keyboard, and can always be used so long as you (or
457 your system administrator) have not actually changed them. But they
458 are hard to remember, so you may well prefer to use your own, particularly
459 if you always use the same terminal. See the section on Customization for
460 more details.
461 .LP
462 Some terminals and modems cannot accept characters flat out
463 at a reasonable baud rate, and therefore require the use of a flow control
464 protocol using the characters ^S and ^Q (see the variable
465 \fIallow-^S-and-^Q\fP). These characters cannot, therefore, be typed by the
466 user. It has therefore been arranged that whenever a standard binding
467 requires ^S (^Q) to be typed, a spare standard binding for that facility is
468 also provided in which ^\^\e (^^) can be typed in its place.
469 .LP
470 Not all commands are bound to keys. To invoke a command that isn't bound
471 to a key, you can type the sequence ESC\ X, which is bound to the command
472 \fIexecute-named-command\fP. You will then be able to type the name of
473 whatever command you want to execute on the message line.
474 .HH 2 "Prefix Characters"
475 .LP
476 Because there are more command names than keys,
477 \s-2JOVE\s0 allows a sequence of keystrokes to be bound to a command.
478 Usually, the first character of the sequence will be one of the two
479 \fIprefix characters\fP ^X or ESC.
480 When you type such a prefix character \s-2JOVE\s0 will wait
481 for the next character before deciding what to do.
482 If you wait more than a second or so,
483 \s-2JOVE\s0 will print the prefix character on the
484 message line as a reminder and leave the cursor down there while you type
485 the rest of the sequence.
486 Many \s-2JOVE\s0 commands are bound to a 2-stroke sequence starting with
487 ^X or ESC.
488 How the next character is interpreted depends on which
489 of them you typed.
490 For example,
491 if you type ESC followed by B you will run \fIbackward-word\fP,
492 but if you type ^X followed by B you will run \fIselect-buffer\fP.
493 .HH 2 "Variables"
494 .LP
495 Sometimes the description of a command will say
496 \*Qto change this, set the variable \fImumble-foo\fP\*U.
497 A variable is a name used to remember a value.
498 \s-2JOVE\s0 contains variables which are there so that you can change
499 them if you want to customize.
500 The variable's value may be examined by some command,
501 and changing that value makes the command behave differently.
502 However, the facilities provided are pretty limited: you cannot invent new
503 variables, or use them for other than their built-in purposes, and their
504 values apply globally to all buffers irrespective of mode settings.
505 .TS
506 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
507 set Sets the value of a variable.
508 print Displays the current value of a variable.
509 .TE
510 .LP
511 To set or change the value of a variable, type ESC\ X \fIset\fP <variable-name>
512 <value><return>. Values may be \fIon\fP of \fIoff\fP (for Boolean variables)
513 or numbers (numeric variables) or strings (string variables). To inspect the
514 current value of a variable, type ESC\ X print <variable-name><return>.
515 .HH 2 "Giving Numeric Arguments to \s-2JOVE\s0 Commands"
516 .LP
517 Many \s-2JOVE\s0 commands can be given a \fInumeric argument\fP.
518 Many commands interpret the argument as a repetition count (possibly
519 negative). For example,
520 giving an argument of ten to the ^F command (\fIforward-character\fP) moves forward
521 ten characters.
522 With these commands,
523 no argument is equivalent to an argument of 1.
524 .LP
525 Some commands use the value of the argument, or even just its presence or
526 absence, in highly idiosyncratic ways.
527 For example,
528 the commands which change the minor modes (such as \fIauto-fill-mode\fP)
529 toggle the mode if there is no argument, but turn the more off with a zero
530 argument, and on with any other argument.
531 .LP
532 The fundamental way of specifying an argument is to use ESC followed by the
533 digits of the argument, for example, ESC\ 123 ESC\ G to go to line 123.
534 Negative arguments are allowed, although not all commands know what
535 to do with them.
536 Unless otherwise stated, ESC\ Minus\ ... is equivalent to ESC\ Minus\ 1\ ...\ .
537 Note that when giving arguments to \fIsourced\fP commands
538 (described later under Customization) different rules apply.
539 .LP
540 Typing ^U means \*Qsupply an argument of 4\*U. Two such ^U's supply
541 sixteen. Thus, ^U ^U ^F moves forward sixteen characters.
542 This is a good way to move forward quickly,
543 since it moves about 1/4 of a line on most terminals.
544 Other useful combinations are:
545 ^U ^U ^N (move down a good fraction of the screen),
546 and ^U ^U ^O (make \*Qa lot\*U of blank lines).
547 .LP
548 There are other,
549 terminal-dependent, ways of specifying arguments.
550 They have the same effect but may be easier to type.
551 If your terminal
552 has a numeric keypad which sends something recognizably different from
553 the ordinary digits,
554 it is possible to customize \s-2JOVE\s0 to allow use of
555 the numeric keypad for specifying arguments.
556 .HH 2 "Help"
557 .LP
558 To get a list of keys and their associated commands,
559 you type ESC\ X \fIdescribe-bindings\fP (warning: the list runs to many
560 screenfuls; type Space to see the next one, or ^G when you have seen enough).
561 If you want to describe a single key,
562 ^X\ ? (\fIdescribe-key\fP) will work. A description of an
563 individual command is available by using ESC\ ? (\fIdescribe-command\fP),
564 and descriptions of variables by using ESC\ X \fIdescribe-variable\fP.
565 If you can't remember the name of the thing you want to know about,
566 ESC\ X \fIapropos\fP will tell you if a command or variable has a given
567 string in its name. For example, ESC\ X \fIapropos describe\fP will
568 list the names of the four describe commands just mentioned.
569 .HH 1 "Basic Editing Commands"
570 .LP
571 .HH 2 "Inserting Text"
572 .LP
573 To insert printing characters into the text,
574 just type them.
575 All such printing characters you type are inserted into the text at
576 the cursor (that is, at \fIpoint\fP),
577 and the cursor moves forward.
578 Any characters after the cursor move forward too.
579 If the text in the buffer is FOOBAR,
580 with the cursor before the B,
581 then if you type XX
582 you get FOOXXBAR,
583 with the cursor still before the B.
584 .LP
585 To correct text you have just inserted,
586 you can use DEL.
587 DEL deletes the character \fIbefore\fP the cursor (not the one that the
588 cursor is on top of or under; that is the character \fIafter\fP the
589 cursor).
590 The cursor and all characters after it move backwards.
591 Therefore,
592 if you typing a printing character and then type DEL,
593 they cancel out.
594 .LP
595 To end a line and start typing a new one, type Return. Return operates by
596 inserting a \fIline-separator\fP, so if you type Return in the middle of a
597 line, you break the line in two. Because a line-separator behaves like a
598 single character, you can type DEL at the beginning of a line to delete the
599 line-separator and join it with the preceding line. Note that the line
600 separator is \fBnot\fP a character (it is not the ASCII NL character, for
601 example) so that you cannot include it in search or replace strings.
602 .LP
603 As a special case, if you type Return at the end of a line and there are
604 two or more empty lines just below it, \s-2JOVE\s0 does not insert a
605 line-separator but instead merely moves to the next (empty) line. This
606 behavior is convenient when you want to add several lines of text in the
607 middle of a buffer. You can use the ^O (\fInewline-and-backup\fP)
608 command to \*Qopen\*U several empty lines at once; then you can insert the new
609 text, filling up these empty lines. The advantage is that \s-2JOVE\s0 does
610 not have to redraw the bottom part of the screen for each Return you type,
611 as it would ordinarily. That \*Qredisplay\*U can be both slow and distracting.
612 .LP
613 If you add too many characters to one line,
614 without breaking it with Return,
615 the line will grow too long to display on one screen line.
616 When this happens,
617 \s-2JOVE\s0 puts an \*Q!\*U at the extreme right margin,
618 and doesn't bother to display the rest of the line unless the
619 cursor happens to be in it.
620 The \*Q!\*U is not part of your text;
621 conversely,
622 even though you can't see the rest of your line,
623 it is still there,
624 and if you break the line,
625 the \*Q!\*U will go away.
626 .LP
627 Direct insertion works for printing characters and space,
628 but other
629 characters act as editing commands and do not insert themselves.
630 If you need to insert a control character,
631 ESC,
632 or DEL,
633 you must first \fIquote\fP it by typing the ^Q command (\fIquoted-insert\fP)
634 first, for example ^Q\ ^C to insert a genuine ^C.
635 .HH 2 "Moving the Cursor"
636 .LP
637 To do more than insert characters,
638 you have to know how to move the cursor.
639 Here are the commands for doing that.
640 .TS
641 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
642 ^A beginning-of-line Move to the beginning of the line.
643 ^E end-of-line Move to the end of the line.
644 ^F or \(-> forward-character Move forward over one character.
645 ^B or \(<- backward-character Move backward over one character.
646 ^N or \(da next-line T{
647 Move down one line, vertically.
648 If you start in the middle of one line,
649 you end in the middle of the next.
650 T}
651 ^P or \(ua previous-line Move up one line, vertically.
652 ESC\ < beginning-of-file Move to the beginning of the entire buffer.
653 ESC\ > end-of-file Move to the end of the entire buffer.
654 ESC\ , beginning-of-window Move to the beginning of the visible window.
655 ESC\ \fB.\fP end-of-window Move to the end of the visible window.
656 ^Z scroll-up T{
657 Move the lines in the window upwards. If this brings the cursor outside of
658 the window, it is automatically relocated.
659 T}
660 ESC\ Z scroll-down Move the lines in the window downwards.
661 .TE
662 Observe the use of the arrow keys (\(->, \(<-, \(da and \(ua) as alternatives
663 for ^F, ^B, ^N and ^P. These should be available on just about any terminal.
664 You (or your system administrator) may find it convenient to bind other
665 Function Keys available on your keyboard to some of these commands,
666 especially if those keys already have appropriate engravings on them.
667 See the section on Customizing \s-2JOVE\s0.
668 .HH 2 "Deleting Text"
669 .TS
670 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
671 DEL delete-previous-character Delete the character before the cursor.
672 ^D delete-next-character Delete the character after the cursor.
673 ESC \e delete-white-space Delete spaces and tabs around point.
674 ^X\ ^O delete-blank-lines Delete blank lines around the current line.
675 .TE
676 .LP
677 You already know about the DEL command which deletes the character
678 \fIbefore\fP the cursor. Another command,
679 ^D,
680 deletes the character
681 \fIafter\fP the cursor, the one the cursor is \*Qon top of\*U or \*Qunderneath\*U,
682 causing the rest of the text on the line to shift left.
683 Line-separators act like normal characters when deleted,
684 so if ^D is typed at the end of a line,
685 that line and the next line are joined together.
686 .LP
687 The other delete commands are those which delete only formatting
688 characters:
689 spaces,
690 tabs,
691 and line-separators.
692 ESC\ \e (\fIdelete-white-space\fP)
693 deletes all the spaces and tab characters before and after point.
694 ^X\ ^O (\fIdelete-blank-lines\fP) deletes all blank lines after the current line,
695 and if the current line is blank deletes all the blank
696 lines preceding the current line as well
697 (leaving one blank line, the current line).
698 .HH 2 "Files \(em Saving Your Work"
699 .LP
700 The commands above are sufficient for creating text in the \s-2JOVE\s0 buffer.
701 The more advanced \s-2JOVE\s0 commands just make things easier.
702 But to keep any text permanently you must put it into a \fIfile\fP.
703 Files are the objects which
704 .UX
705 uses for storing data for a length of time.
706 To tell \s-2JOVE\s0 to read text into a file,
707 choose a filename,
708 such as \fIfoo.bar\fP,
709 and type ^X\ ^F\ \fIfoo.bar\fP<return> (\fIfind-file\fP).
710 This reads the file \fIfoo.bar\fP so that its contents appear in a new
711 buffer on the screen for editing.
712 Alternatively, type ^X\ ^R \fIfoo.bar\fP<return> (\fIread-file\fP) to have the file appear in
713 an existing buffer.
714 You can make changes,
715 and then save the file by typing ^X\ ^S (\fIsave-file\fP).
716 This makes the changes permanent and actually changes the file \fIfoo.bar\fP.
717 Until then,
718 the changes are only inside \s-2JOVE\s0,
719 and the file \fIfoo.bar\fP is not really changed.
720 If the file \fIfoo.bar\fP does not exist,
721 and you want to create it,
722 read it as if it did exist.
723 When you save your text with ^X\ ^S, the file will be created then.
724 .HH 2 "Exiting and Pausing \(em Leaving \s-2JOVE\s0"
725 .LP
726 The command ^X\ ^C (\fIexit-jove\fP) will terminate the \s-2JOVE\s0
727 session and return to the shell. If there are modified but
728 unsaved buffers, \s-2JOVE\s0 will ask you for confirmation, and you
729 can abort the command, look at what buffers are
730 modified but unsaved using ^X\ ^B (\fIlist-buffers\fP), save the
731 valuable ones, and then exit. If what you want to do, on the other hand,
732 is to \fIpreserve\fP the editing session but return to the shell temporarily
733 you can (under most modern versions of
734 .UX )
735 issue the command ESC\ S (\fIpause-jove\fP), do your
736 .UX
737 work within your shell, and then return to \s-2JOVE\s0 using the
738 \fIfg\fP command to resume editing at the point where you paused.
739 Alternatively, for this sort of situation, you might consider using an
740 \fIinteractive shell\fP (that is, a shell in a \s-2JOVE\s0 window) which
741 lets you use the editor to issue your
742 .UX
743 commands and manipulate their output, while never leaving the editor
744 (the interactive shell feature is described later).
745 .HH 1 "Kill and Yank (or Cut and Paste)"
746 .LP
747 Any editor needs a facility for dealing with large blocks of text \(em
748 deleting them or moving them to other places. The usual terminology speaks
749 of \*QCut\*U (to remove a block of text), \*QPaste\*U (to replace it
750 somewhere else) and \*QCopy\*U (to copy it for subsequent pasting without
751 removal from its original place). For historical reasons, editors based on
752 \s-2EMACS\s0 use the terms Kill, Yank and Copy with essentially the same
753 meanings, and we shall continue to do so in this manual. However, it may be
754 sensible, if your keyboard has keys marked Cut, Paste and Copy, to bind
755 appropriate Kill, Yank and Copy commands to them as part of your local
756 customization.
757 .HH 2 "The Mark and the Region"
758 .LP
759 In general, a command that processes an arbitrary part of the buffer must
760 know where to start and where to stop. In \s-2JOVE\s0, such commands
761 usually operate on the text between \fIpoint\fP and \fIthe mark\fP. On most
762 terminals, the position of the mark is indicated by underlining. This body
763 of text is called \fIthe region\fP. To specify a region, you set point at
764 one end of it and mark at the other. It doesn't matter which one comes
765 earlier in the text.
766 .TS
767 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
768 ^@ set-mark Set the mark where point is.
769 ^X\ ^X exchange-point-and-mark Interchange point and mark.
770 pop-mark Move to the previous mark in the ring.
771 .TE
772 .LP
773 The way to set the mark is with the ^@ command or (on some terminals) the
774 ^Space command. They set the mark where point is. Then you can move point
775 away, leaving the mark behind. When the mark is set, \*Q[Point pushed]\*U
776 is printed on the message line.
777 .LP
778 For example,
779 if you wish to convert part of the buffer to all upper-case,
780 you can use the \fIcase-region-upper\fP command,
781 which operates on the text in the region.
782 You can first go to the beginning of the text to be capitalized,
783 put the mark there, move to the other end, and then type
784 ESC\ X \fIcase-region-upper\fP.
785 Or,
786 you can set the mark at the end of the text,
787 move to the beginning,
788 and then type the same thing.
789 .LP
790 On terminals with the requisite capabilities, the marked character is
791 underlined. Otherwise, you have to remember where it is (the usual method is
792 to set the mark and then use it soon). Alternatively, you can see where the
793 mark is with the command ^X\ ^X which puts the mark where point was and
794 point where the mark was. The extent of the region is unchanged, but the
795 cursor and point are now at the previous location of the mark.
796 .HH 2 "The Ring of Marks"
797 .LP
798 Aside from delimiting the region,
799 the mark is also useful for remembering a spot that you may want to go back to.
800 To make this feature more useful,
801 \s-2JOVE\s0 remembers 16 previous locations of the mark.
802 Most commands that set the mark push the old mark onto this stack.
803 To return to a marked location, use ^U\ ^@ (equivalent to \fIpop-mark\fP).
804 This moves point to where the mark was,
805 and restores the mark from the stack of former marks.
806 So repeated use of this command moves point to all of the old
807 marks on the stack,
808 one by one.
809 Since the stack is actually a ring,
810 enough uses of ^U\ ^@ bring point back to where it was originally.
811 .LP
812 Some commands whose primary purpose is to move point a great distance
813 take advantage of the stack of marks to give you a way to undo the
814 command.
815 The best example is ESC\ < (\fIbeginning-of-file\fP),
816 which moves to the beginning of the buffer.
817 If there are more than 22 lines between the beginning of
818 the buffer and point,
819 ESC\ < sets the mark first,
820 so that you can use ^U ^@ or ^X\ ^X to go back to where you were.
821 You can change the number of lines from 22 since it is kept in the variable \fImark-threshold\fP.
822 By setting it to 0,
823 you can make these commands always set the mark and
824 by setting it to a very large number you can make them never set it.
825 If a command decides to set the mark,
826 it prints the message [Point pushed].
827 .HH 2 "Killing and Moving Text"
828 .LP
829 The way of moving text with \s-2JOVE\s0 is to \fIkill\fP (cut) it,
830 and \fIyank\fP (paste) it back again later in one or more places.
831 This is very safe
832 because the last several pieces of killed text are all remembered,
833 and it is versatile
834 because the many commands for killing syntactic units
835 can also be used for moving those units.
836 .HH 3 "Deletion and Killing"
837 .LP
838 Most commands which erase text from the buffer save it so that you can
839 get it back if you change your mind, or you can
840 copy it to other parts of the buffer (even to a different buffer).
841 These commands are known as \fIkill\fP commands.
842 The rest of the commands that erase text do not save it;
843 they are known as \fIdelete\fP commands.
844 The delete commands include ^D and DEL,
845 which delete only one character at a time,
846 and those commands that delete only spaces or line-separators.
847 Commands that can destroy significant amounts of nontrivial data generally
848 kill. A command's
849 name and description will use the words \fIkill\fP or \fIdelete\fP to
850 say which it does.
851 .TS
852 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
853 ^D delete-next-character Delete next character.
854 DEL delete-previous-character Delete previous character.
855 ESC\ \e delete-white-space Delete spaces and tabs around point.
856 ^X\ ^O delete-blank-lines Delete blank lines around the current line.
857 ^K kill-to-end-of-line Kill rest of line or one or more lines.
858 ^W kill-region Kill the region (from point to mark).
859 ESC\ D kill-next-word Kill word.
860 ESC\ DEL kill-previous-word Kill word backwards.
861 ESC\ K kill-to-end-of-sentence Kill to end of sentence.
862 ^X\ DEL kill-to-beginning-of-sentence Kill to beginning of sentence.
863 ESC\ ^K kill-s-expression Kill from point to the end of an s-expression.
864 .TE
865 .HH 3 "Deletion"
866 .LP
867 The various delete commands have already been described.
868 Actually,
869 ^D and DEL aren't always \fIdelete\fP commands;
870 if you give an argument,
871 they \fIkill\fP instead.
872 This prevents you from losing a great deal of text by typing a large
873 argument to a ^D or DEL.
874 .HH 3 "Killing (and Copying) the region, and Yanking it back again"
875 .LP
876 The commonest kill command is ^W (\fIkill-region\fP),
877 which kills everything between point and the mark*.
878 .FS
879 *Often users switch this binding from ^W to ^X\ ^K because it is too
880 easy to hit ^W accidentally.
881 .FE
882 With this command,
883 you can kill and save contiguous characters,
884 if you first set the mark at one end of them and then go to the other end.
885 .TS
886 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
887 ^W kill-region Kill everything between point and mark.
888 ESC\ W copy-region Save the region without killing.
889 .TE
890 .LP
891 Yanking (un-killing) is getting back text which was killed.
892 The usual way to
893 move or copy text is to kill or copy it and then yank it one or more times.
894 .TS
895 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
896 ^Y yank Yank (re-insert) the last killed text.
897 ESC\ Y yank-pop Replace re-inserted killed text with the previously killed text.
898 .TE
899 .LP
900 Killed text is pushed onto a \fIring buffer\fP called the \fIkill
901 ring\fP that remembers the last sixteen blocks of text that were killed
902 (why it is called a ring buffer will be explained below).
903 The command ^Y (\fIyank\fP) reinserts the text of the most recent kill.
904 The yanked text becomes the new region. Thus,
905 a single ^Y undoes the ^W and vice versa.
906 .LP
907 If you wish to copy a block of text,
908 you might want to use ESC\ W (\fIcopy-region\fP),
909 which copies the region into the kill ring without removing it from the buffer.
910 .LP
911 There is only one kill ring shared among all the buffers. After reading a
912 new file or selecting a new buffer, whatever was last killed in the previous
913 file or buffer is still on top of the kill ring. This is important for
914 moving text between buffers.
915 .HH 3 "Other Kill commands"
916 .LP
917 Other syntactic units can be killed, too;
918 words,
919 with ESC\ DEL (\fIkill-previous-word\fP) and ESC\ D (\fIkill-next-word\fP);
920 and sentences,
921 with ESC\ K (\fIkill-to-end-of-sentence\fP) and ^X\ DEL
922 (\fIkill-to-beginning-of-sentence\fP).
923 .HH 3 "Killing by Lines"
924 .LP
925 Another kill command is the ^K command (\fIkill-to-end-of-line\fP). If
926 issued at the beginning of a line, it kills all the text on the line,
927 leaving it blank. If given in the middle of a line, it kills all the text
928 up to the end of the line. If given on a line that is empty or contains
929 only white space (blanks and tabs) the line disappears. If ^K is done at
930 the end of a line, it joins that line and the next line. As a consequence,
931 if you go to the front of a non-blank line and type two ^K's, the line
932 disappears completely (but be careful, because one ^K is sufficient to
933 remove an empty line).
934 .LP
935 In general,
936 ^K kills from point up to the end of the line,
937 unless it is at the end of a line,
938 in which case
939 it kills the line-separator following the line,
940 thus merging the next line into the current one.
941 Invisible spaces and tabs at the end of the line are ignored when
942 deciding which case applies,
943 so if point appears to be at the end of the line,
944 you can be sure the line-separator will be killed.
945 .LP
946 ^K with an argument kills that many lines, including their line
947 separators (whether the lines are empty or not). Without an argument, ^K
948 behaves as described in the previous paragraph.
949 ^U ^K kills four lines (but note that typing ^K four times
950 would kill only 2 lines)
951 .LP
952 ^K with an argument of zero kills all the text before
953 point on the current line.
954 .HH 3 "Appending Kills"
955 .LP
956 Normally,
957 each kill command pushes a new block onto the kill ring.
958 However,
959 two or more kill commands immediately in a row (without any other
960 intervening commands) combine their text into a
961 single entry on the ring,
962 so that a single ^Y (\fIyank\fP) command gets it all back as it was before
963 it was killed. This means that you don't have to kill all the text in one
964 command; you can keep killing line after line,
965 or word after word,
966 until you have killed it all,
967 and you can still get it all back at once.
968 .LP
969 Commands that kill forward from point
970 add onto the end of the previously
971 killed text.
972 Commands that kill backward from point
973 add onto the beginning.
974 This way,
975 any sequence of mixed forward and backward kill
976 commands puts all the killed text into one entry without needing rearrangement.
977 .LP
978 Suppose, for example you have a line containing FOO\ BAR\ BAZ with the
979 cursor at the start of BAR. Type ESC\ D (\fIkill-next-word\fP), then
980 ESC\ DEL (\fIkill-previous-word\fP), then ESC\ F (\fIforward-word\fP) to put
981 the cursor after BAZ, and Space to insert a space. Then type ^Y (\fIyank\fP)
982 and your line will contain BAZ\ FOO\ BAR.
983 .HH 2 "The Kill Ring"
984 .LP
985 To recover killed text that is no longer the most recent kill,
986 you need the ESC\ Y (\fIyank-pop\fP) command.
987 The ESC\ Y command can be used
988 only immediately after a ^Y (\fIyank\fP) command or another ESC\ Y.
989 It takes the yanked
990 text inserted by the ^Y and replaces it with the text from an earlier
991 kill.
992 So,
993 to recover the text of the next-to-the-last kill,
994 you first use ^Y to recover the last kill,
995 and then discard it by use of ESC\ Y to move back to the previous one.
996 .LP
997 You can think of all the last few kills as living on a ring.
998 After a ^Y command,
999 the text at the front of the ring is still present in the buffer.
1000 ESC\ Y \*Qrotates\*U the ring bringing the previous string of text to the front
1001 and this text replaces the other text in the buffer as well.
1002 Enough ESC\ Y commands can rotate any part of the ring to the front,
1003 so you can get at any killed text so long as it is recent enough
1004 to be still in the ring.
1005 Eventually the ring rotates all the way
1006 round and the most recently killed text comes to the front
1007 (and into the buffer) again.
1008 ESC\ Y with a negative argument rotates the ring backwards.
1009 .LP
1010 When the text you are looking for is brought into the buffer,
1011 you can stop doing ESC\ Y's and the text will stay there.
1012 It is really just a copy of what's at the front of the ring,
1013 so editing it does not change what's in the ring.
1014 And the ring,
1015 once rotated,
1016 stays rotated,
1017 so that doing another ^Y gets another copy of what you rotated to the
1018 front with ESC\ Y.
1019 .LP
1020 If you change your
1021 mind about yanking,
1022 ^W (\fIkill-region\fP) gets rid of the yanked text, even
1023 after any number of ESC\ Y's.
1024 .HH 1 "Searching and Replacing"
1025 .HH 2 "Searching"
1026 .LP
1027 The search commands are useful for finding and moving to arbitrary
1028 positions in the buffer in one swift motion.
1029 For example,
1030 if you just ran the spell program on a document
1031 and you want to correct some word,
1032 you can use the search commands to move directly to that word. There are
1033 two flavors of search: \fIstring search\fP and \fIincremental search\fP.
1034 The former is the default flavor \(em if you want to use incremental search
1035 you must rearrange the key bindings (see below).
1036 .HH 3 "Conventional Search"
1037 .TS
1038 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1039 ^S or ^\^\e search-forward Search forward.
1040 ^R search-reverse Search backward.
1041 .TE
1042 .LP
1043 To search for the string \*QFOO\*U you type ^S\ FOO<return>.
1044 If \s-2JOVE\s0 finds
1045 FOO it moves point to the end of it; otherwise \s-2JOVE\s0 prints an error
1046 message and leaves point unchanged.
1047 ^S searches forward from point
1048 so only occurrences of FOO after point are found.
1049 To search in the other direction use ^R.
1050 It is exactly the same as ^S except that it searches in the opposite direction,
1051 and if it finds the string
1052 it leaves point at the beginning of it,
1053 not at the end as in ^S.
1054 .LP
1055 While \s-2JOVE\s0 is searching it displays the search string on the message line.
1056 This is so you know what \s-2JOVE\s0 is doing.
1057 When the system is heavily loaded and
1058 editing in exceptionally large buffers,
1059 searches can take several (sometimes many) seconds.
1060 .LP
1061 \s-2JOVE\s0 remembers the last search string you used,
1062 so if you want to search for the same string again you can type
1063 ^S\ <return>. If you mistyped the last search string,
1064 you can type ^S followed immediately by ^R (which is \fInot\fP the
1065 \fIsearch-reverse\fP command in this context) which
1066 inserts the default search string,
1067 and then you can fix it up.
1068 .LP
1069 Note that the precise interpretation of the search string is dependent on
1070 the variable \fImatch-regular-expressions\fP and is subject to the rules for
1071 \fIregular-expressions\fP to be described shortly.
1072 .HH 3 "Incremental Search"
1073 .LP
1074 This search command is unusual in that is is \fIincremental\fP;
1075 it begins to search before you have typed the complete search string.
1076 As you type in the search string,
1077 \s-2JOVE\s0 shows you where it would be found.
1078 When you have typed enough characters to identify the place you want,
1079 you can stop.
1080 Depending on what you will do next,
1081 you may or may not need to terminate the search explicitly with a Return.
1082 .LP
1083 To use the incremental searches, you first have to bind them to suitable
1084 keys, for example to ^S and ^R if you want all your searching to become
1085 incremental. To do this, type
1086 .IP
1087 .I
1088 ESC\ X bind-to-key i-search-forward ^S
1089 .br
1090 ESC\ X bind-to-key i-search-reverse ^R
1091 .R
1092 .LP
1093 The command to search is now ^S (\fIi-search-forward\fP).
1094 ^S reads in characters and positions the cursor at the first
1095 occurrence of the characters that you have typed so far.
1096 If you type ^S and then F,
1097 the cursor moves in the text just after the next \*QF\*U.
1098 Type an \*QO\*U,
1099 and see the cursor move to after the next \*QFO\*U.
1100 After another \*QO\*U,
1101 the cursor is after the next \*QFOO\*U.
1102 At the same time,
1103 \*QFOO\*U has echoed on the message line.
1104 .LP
1105 If you type a mistaken character,
1106 you can rub it out.
1107 After the FOO,
1108 typing a DEL makes the \*QO\*U disappear from the message line,
1109 leaving only \*QFO\*U.
1110 The cursor moves back in the buffer to the \*QFO\*U.
1111 Rubbing out the \*QO\*U and \*QF\*U moves the cursor back to where you
1112 started the search.
1113 .LP
1114 When you are satisfied with the place you have reached,
1115 you can type a Return,
1116 which stops searching,
1117 leaving the cursor where the search brought it.
1118 Also,
1119 any command not specially meaningful in searches stops
1120 the searching and is then executed.
1121 Thus,
1122 typing ^A would exit the search and then move to the beginning of the line.
1123 Return is necessary only if the next character you want to type is a printing
1124 character,
1125 DEL,
1126 Return,
1127 or another search command,
1128 since those are the characters that have special meanings inside the search.
1129 .LP
1130 Sometimes you search for \*QFOO\*U and find it,
1131 but not the one you hoped to find.
1132 Perhaps there is a second FOO
1133 after the one you just found.
1134 Then type another \*Q^S\*U and the cursor will find the next FOO.
1135 This can be done any number of times.
1136 If you overshoot,
1137 you can return to previous finds by rubbing out the \*Q^S\*Us.
1138 Note that, in this context, \*Q^S\*U (alternatively \*Q^\^\e\*U) is a
1139 built-in use of the ^S character and not another invocation of
1140 \fIi-search-forward\fP (which is why I have shown it in \*Qquotes\*U).
1141 .LP
1142 After you exit a search,
1143 you can search for the same string again by typing just ^S ^S:
1144 one ^S command to start the search and then
1145 another \*Q^S\*U to mean \*Qsearch again for the same string\*U.
1146 .LP
1147 If your string is not found at all,
1148 the message line says \*QFailing I-search\*U.
1149 The cursor is after the place where \s-2JOVE\s0 found as much of
1150 your string as it could.
1151 Thus,
1152 if you search for FOOT and there is no FOOT,
1153 you might see the cursor after the FOO in FOOL.
1154 At this point there are several things you can do.
1155 If your string was mistyped,
1156 you can rub some of it out and correct it.
1157 If you like the place you have found,
1158 you can type Return or some other \s-2JOVE\s0 command
1159 to \*Qaccept what the search offered\*U.
1160 Or you can type ^G,
1161 which undoes the search altogether and positions you back where you started
1162 the search.
1163 .LP
1164 You can also type ^R (\fIi-search-reverse\fP) at any time to start searching
1165 backwards. If a search fails because the place you started was too late in
1166 the file, you should do this. Repeated \*Q^R\*Us keep looking backward for
1167 more occurrences of the last search string. A \*Q^S\*U starts going forward
1168 again. \*Q^R\*Us can be rubbed out just like anything else.
1169 .LP
1170 Unlike conventional searching, incremental searching does not use the rules
1171 for regular-expressions.
1172 .HH 2 "Replacing"
1173 .LP
1174 In addition to
1175 the simple Replace operation which is like that found in most editors,
1176 there is a Query Replace operation which asks,
1177 for each occurrence of the pattern,
1178 whether to replace it or not.
1179 .TS
1180 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1181 ESC\ R replace-string T{
1182 Replace every occurrence of the string from point to
1183 the end of the buffer.
1184 T}
1185 replace-in-region T{
1186 Replace every occurrence of the string within the region.
1187 T}
1188 ESC\ Q query-replace-string T{
1189 Replace occurrences of the string from point to the end of the buffer, but
1190 asking for confirmation before each replacement.
1191 T}
1192 .TE
1193 .HH 3 "Global replacement"
1194 .LP
1195 To replace every occurrence of FOO after point with BAR,
1196 you can do, ESC\ R FOO<return>BAR<return> (\fIreplace-string\fP).
1197 Replacement takes place only between point and the end of the buffer,
1198 so if you want to cover the whole buffer you must go to the beginning first.
1199 .LP
1200 Another alternative is to use \fIreplace-in-region\fP which is just like
1201 \fIreplace-string\fP except it searches only within the region.
1202 .HH 3 "Query Replace"
1203 .LP
1204 If you want to change only some of the occurrences of FOO,
1205 not all,
1206 then the global \fIreplace-string\fP is inappropriate;
1207 instead,
1208 use, e.g., ESC\ Q FOO<return>BAR<return> (\fIquery-replace-string\fP).
1209 This moves the cursor to each occurrence of FOO and waits for you to say
1210 whether to replace it with BAR.
1211 The things you can type when you are shown an occurrence of FOO are:
1212 .IP "Space or Y or y" "\w'DEL or BS or N or n11'u"
1213 to replace the FOO with BAR.
1214 .IP "Period"
1215 to replace this FOO and then stop.
1216 .IP "DEL or BS or N or n"
1217 to skip to the next FOO without replacing this one.
1218 .IP "^R\ or\ R\ or\ r"
1219 to enter a recursive editing level, in case the FOO needs to be edited
1220 rather than just replaced with a BAR. When you are done, exit the recursive
1221 editing level with ^X\ ^C (\fIexit-jove\fP) and the next FOO will be
1222 displayed.
1223 .IP "^W"
1224 to delete the FOO, and then start editing the buffer.
1225 When you are finished editing whatever is to replace the FOO,
1226 exit the recursive editing level with ^X\ ^C (\fIexit-jove\fP)
1227 and the \fIquery-replace\fP will continue at the next FOO.
1228 .IP "^U or U or u"
1229 move to the last replacement and undo all changes made on that line.
1230 .IP "! or P or p"
1231 to replace all remaining FOO's without asking, as in \fIreplace-string\fP.
1232 .IP "Return or Q or q"
1233 to stop without doing any more replacements.
1234 .IP "^L"
1235 redraw the screen.
1236 .HH 2 "Searching with Regular Expressions"
1237 .LP
1238 When we use the searching and replacement facilities described above,
1239 \s-2JOVE\s0 can search for patterns using \fIregular-expressions\fP. The
1240 handling of regular-expressions in \s-2JOVE\s0 is somewhat like that of
1241 \fIed(1)\fP or \fIvi(1)\fP, but with some notable additions. The precise
1242 behavior depends on the setting of the variable
1243 \fImatch-regular-expressions\fP. If this variable is \fIon\fP, we use true
1244 \fIregular-expressions\fP. If it is \fIoff\fP, we have just
1245 \fIsimple-expressions\fP. In what follows, the term \fIexpression\fP should
1246 be interpreted as simple-expression or regular-expression according to the
1247 state of that variable.
1248 .LP
1249 Another variable that affects searching is \fIcase-ignore-search\fP. If
1250 this variable is set to \fIon\fP then upper case and lower case letters are
1251 considered equal (except, of course, within regular-expressions such as
1252 [A\-Za\-z]).
1253 .LP
1254 Note that the rules which follow are complex, arbitrary, and different from
1255 those in other editors. Hence they may be changed significantly in future
1256 versions of \s-2JOVE\s0.
1257 .HH 3 "Simple Regular Expressions"
1258 .LP
1259 If the variable \fImatch-regular-expressions\fP is \fIoff\fP, the search
1260 pattern is interpreted as follows:
1261 .IP "^ (at the start of a pattern or sub-pattern) " 14n
1262 Matches the empty string at the beginning of a line.
1263 .IP "$ (at the end of a pattern or sub-pattern)"
1264 Matches the empty string at the end of a line.
1265 .IP "\e\^<"
1266 Matches the empty string at the beginning of a word. What makes up a word
1267 depends on the major mode of the buffer that you are searching in. In all
1268 modes a word is a contiguous sequence of characters which have some defined
1269 pattern, bounded by characters that don't fit that pattern or by the
1270 beginning or end of the line. The individual modes' word patterns are as
1271 follows:
1272 .RS
1273 .KS
1274 .IP "\fIFundamental\fP " 12n
1275 upper and lower case letters and digits.
1276 .IP "\fIText\fP"
1277 upper and lower case letters and digits plus apostrophe (').
1278 .IP "\fIC\fP"
1279 upper and lower case letters and digits plus \*Q$\*U and \*Q_\*U (underscore).
1280 .IP "\fILisp\fP"
1281 upper and lower case letters and digits plus
1282 \*Q!\^$\^%\^&\^\(**\^+\^\-\^/\^:\^<\^=\^>\^?\^^\^_\^{\^|\^}\^\s+2~\s0\*U
1283 and Delete.
1284 .KE
1285 .RE
1286 .IP "\e\^> " 14n
1287 Matches the empty string at the end of a word.
1288 .IP "\e\^\fIc\fP"
1289 Matches the character \fIc\fP where \fIc\fP is not one of
1290 <, >, (, ), {, } or |. In particular, \e\^^, \e\^$ and \e\^\e match the
1291 characters ^, $ and \e\^. When full regular-expressions are in use,
1292 \e\^\fB.\fP, \e\^\(** and \e\^[ will also be required.
1293 .IP "\fIc\fP"
1294 Matches the character \fIc\fP where \fIc\fP is not \e or ^ (at the start of
1295 a pattern) or $ (at the end of a pattern) (plus a few further things if
1296 \fImatch-regular-expressions\fP is \fIon\fP).
1297 .IP "\e\^{\fIc1...cN\fP\^\e}"
1298 Matches whatever the sequence of regular-expressions \fIc1..cN\fP would have
1299 matched. Note that full regular-expression capability (even the \e| construct
1300 described below) is provided within
1301 \e\^{...\e} whatever the setting of the variable \fImatch-regular-expressions\fP.
1302 \e\^{...\e} provides a grouping construct like parentheses in algebraic
1303 expressions. Thus \*Qaa\^\e\^{xx\^\e|yy\e}bb\*U searches for \*Qaaxxbb\*U
1304 or \*Qaayybb\*U.
1305 .IP "\e\^(\fIc1..cN\fP\^\e)"
1306 Matches whatever the sequence of expressions \fIc1..cN\fP would have
1307 matched, where the expressions are any of those described above (and also
1308 the additional full regular-expressions if \fImatch-regular-expressions\fP is \fIon\fP).
1309 This is used to tag part of the search text for later reference via
1310 \e\^\fBn\fP (see below). \e\^(\fIc1..cN\fP\^\e) patterns may be nested.
1311 Observe that use of the \e| construct (see below) directly within a \e\^(...\e)
1312 is precluded.
1313 .IP "\e\^\fIn\fP"
1314 Matches the \fIn\fP'th \e\^(\fIc1..cN\fP\^\e) pattern where \fIn\fP is
1315 between 1 and 9. The \e\^(\fIc1..cN\fP\^\e) patterns are numbered by
1316 counting the \e\^( sequences starting from the beginning of the search
1317 pattern, resetting to 1 (or to the value at the start of an enclosing
1318 \e\^{...\e}) whenever a \e| is encountered. To avoid confusion in the
1319 counting, it is required that each alternative (separated by \e|) within a
1320 \e\^{...\e} should contain the same number of \e\^(...\e)s. For example, the
1321 search pattern
1322 \*Q^\^\e\^(\^\e\^{ab\^\e|cd\^\e}\^\e)\^\e1$\*U searches for all non-empty lines
1323 which contain just \*Qabab\*U or \*Qcdcd\*U (but not \*Qabcd\*U). It is an
1324 error in the search pattern to reference a
1325 \e\^(\fIc1..cN\fP\^\e) pattern that follows the occurrence of \e\^\fIn\fP.
1326 .IP "\fIc1..cN\fP"
1327 Matches the longest string matched by \fIc1\fP, followed by the longest
1328 string matched by \fIc2\fP, and so on. The expressions \fIc1..cN\fP are
1329 any of those described above (and also the additional full
1330 regular-expressions if \fImatch-regular-expressions\fP is \fIon\fP).
1331 .IP "\fIc1..cN\fP\^\e|\fId1..dN\fP"
1332 Matches the longest string matched by \fIc1..cN\fP, if any, and otherwise
1333 the longest string matched by
1334 \fId1..dN\fP. Multiple \e| sequences may be used to indicate more
1335 alternatives. The sequences \fIc1..cN\fP and \fId1..dN\fP are any of those
1336 described above, which means that \e| has lower precedence than any of the
1337 other operators.
1338 Each alternative must have the same number of \e\^(...\e) groups, as already
1339 explained.
1340 Thus, \*Q\^\e\^<foo\^\e|bar\^\e|baz\^\e\^>\*U matches any
1341 word beginning with
1342 \*Qfoo\*U, any occurrence of the string \*Qbar\*U, or any word ending in
1343 \*Qbaz\*U.
1344 .LP
1345 In the replacement string:
1346 .IP "\e\^\fIn\fP" 14n
1347 Is replaced with the characters matched by the \fIn\fP'th
1348 \e\^(\fIc1..cN\fP\^\e) in the search pattern where \fIn\fP is
1349 between 1 and 9. For example, one could replace
1350 \*Q\e\^<\^\e\^(\^\e\^{FOO\^\e|BAR\^\e|BAZ\^\e}\^\e)\^\e\^>\*U
1351 with \*Q[\^\e1]\*U to enclose every occurrence of the words FOO, BAR and
1352 BAZ within [...].
1353 .IP "\e\^0"
1354 Is replaced with the characters matched by the entire search pattern.
1355 .IP "\e\^\fIc\fP"
1356 Inserts the character \fIc\fP where \fIc\fP is not a digit.
1357 .IP "\fIc\fP"
1358 Inserts the character \fIc\fP where \fIc\fP is not \e\^.
1359 .HH 3 "Full Regular Expressions"
1360 .LP
1361 If the variable \fImatch-regular-expressions\fP is \fIon\fP, the following additional
1362 special matching rules are used. Observe that special meanings now attach to
1363 the characters \fB.\fP, \(** and [, which can therefore no longer stand for
1364 themselves.
1365 .LP
1366 In the search pattern:
1367 .IP "\fIc\fP " 14n
1368 Matches the character \fIc\fP where \fIc\fP is not one of \fB.\fP\^,
1369 \(**, [, \e\^, ^ (at the start of
1370 a line) or $ (at the end of a line).
1371 .IP "\fB.\fP"
1372 Matches any character, but not a line-separator.
1373 .IP "[\fIc1..cN\fP]"
1374 Matches any of the characters in the sequence of characters \fIc1..cN\fP
1375 provided circumflex (^) is not the first character of the sequence (see
1376 below). The only special characters recognized while parsing the sequence
1377 are \*Q]\*U,
1378 \*Q\-\*U and
1379 \*Q\^\e\*U. All may be represented by escaping them with a backslash (\^\e\^):
1380 \*Q\^\e\^]\*U, \*Q\^\e\^\-\*U, \*Q\^\e\^\e\*U. Ranges of characters may be
1381 indicated by \fIa\fP\-\fIb\fP where \fIa\fP is the first character of the
1382 range and \fIb\fP is the last. The special meaning of \- is lost if it
1383 appears as the first or last character of the sequence. The special meaning
1384 of ] is lost if it appears as the first character of the sequence.
1385 .IP "[^\fIc1..cN\fP]"
1386 Matches any character except those contained in the sequence of characters
1387 \fIc1..cN\fP. The circumflex (^) is not special except immediately
1388 following the left bracket.
1389 .IP "\fIc\fP\(**"
1390 Matches zero or more occurrences of the expression \fIc\fP. The expression
1391 \fIc\fP may be any of the expressions covered above except for
1392 ^ and $ (which match null strings), \e\^(\fIc1..cN\fP\^\e) and
1393 \fIc1..cN\fP\^\e|\fId1..dN\fP (which would not work), and
1394 \e\^{\fIc1...cN\fP\^\e} (arbitrarily forbidden).
1395 .HH 1 "Commands for English Text"
1396 .LP
1397 \s-2JOVE\s0 has many commands that work on the basic units of English text:
1398 words, sentences and paragraphs.
1399 .HH 2 "Word Commands"
1400 .LP
1401 \s-2JOVE\s0 has commands for moving over or operating on words.
1402 By convention,
1403 they are all ESC commands.
1404 .TS
1405 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1406 ESC\ F forward-word Move Forward over a word.
1407 ESC\ B backward-word Move Backward over a word.
1408 ESC\ D kill-next-word Kill forward to the end of a word.
1409 ESC\ DEL kill-previous-word Kill backward to the beginning of a word.
1410 .TE
1411 .LP
1412 Notice how these commands form a group that parallels the character-based
1413 commands, ^F, ^B, ^D, and DEL.
1414 .LP
1415 The commands ESC\ F and ESC\ B move forward and backward over words.
1416 They are thus analogous to ^F and ^B,
1417 which move over single characters.
1418 Like their Control- analogues,
1419 ESC\ F and ESC\ B move over several words if given an argument (and in the
1420 opposite direction with negative arguments).
1421 Forward motion stops right after the last letter of the word;
1422 backward motion stops right before the first letter.
1423 .LP
1424 ESC\ D kills the word after point.
1425 To be precise,
1426 it kills everything from point to the place ESC\ F would move to.
1427 Thus,
1428 if point is in the middle of a word,
1429 only the part after point is killed.
1430 If some punctuation comes after point,
1431 and before the next word,
1432 it is killed along with the word.
1433 If you wish to kill only the next word but not the punctuation,
1434 simply do ESC\ F to get to the end,
1435 and kill the word backwards with ESC\ DEL.
1436 ESC\ D takes arguments just like ESC\ F.
1437 .LP
1438 ESC\ DEL kills the word before point.
1439 It kills everything from point back to where ESC\ B would move to.
1440 If point is after the space in \*QFOO, BAR\*U,
1441 then \*QFOO, \*U is killed.
1442 If you wish to kill just \*QFOO\*U,
1443 then do an ESC\ B and an ESC\ D instead of an ESC\ DEL.
1444 .LP
1445 Note that the term \*Qword\*U in all of these commands refers simply to a
1446 sequence of upper and lower case letters and digits. It is not dependent on
1447 the major mode of the buffer as was the case with regular-expressions
1448 involving \e\^< and \e\^>. Thus it will require two uses of ESC\ D to remove a
1449 word such as \*Qisn't\*U, even if the major mode is Text mode.
1450 .HH 2 "Sentence Commands"
1451 .LP
1452 The \s-2JOVE\s0 commands for manipulating sentences and paragraphs are
1453 mostly ESC commands,
1454 so as to resemble the word-handling commands.
1455 .TS
1456 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1457 ESC\ A backward-sentence Move back to the beginning of the sentence.
1458 ESC\ E forward-sentence Move forward to the end of the sentence.
1459 ESC\ K kill-to-end-of-sentence Kill forward to the end of the sentence.
1460 ^X\ DEL kill-to-beginning-of-sentence Kill back to the beginning of the sentence.
1461 .TE
1462 .LP
1463 The commands ESC\ A and ESC\ E move to the beginning and end of the
1464 current sentence,
1465 respectively.
1466 They were chosen to resemble
1467 ^A and ^E,
1468 which move to the beginning and end of a line.
1469 Unlike them,
1470 ESC\ A and ESC\ E if repeated or given numeric arguments
1471 move over successive sentences.
1472 \s-2JOVE\s0 considers a sentence to end wherever there is a \*Q.\*U,
1473 \*Q?\*U, or \*Q!\*U followed by the end of a line
1474 or by one or more spaces.
1475 Neither ESC\ A nor ESC\ E moves past the
1476 end of the line or the spaces which delimit the sentence.
1477 .LP
1478 Just as ^A and ^E have a kill command,
1479 ^K,
1480 to go with them,
1481 so ESC\ A and ESC\ E have a corresponding kill command ESC\ K which kills from
1482 point to the end of the sentence.
1483 With minus one as an argument it
1484 kills back to the beginning of the sentence.
1485 Positive arguments serve as a repeat count.
1486 .LP
1487 There is a special command
1488 ^X\ DEL for killing back to the beginning of a sentence,
1489 because this is useful when you change your
1490 mind in the middle of composing text.
1491 .HH 2 "Paragraph Commands"
1492 .LP
1493 The \s-2JOVE\s0 commands for handling paragraphs are
1494 .TS
1495 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1496 backward-paragraph Move back to the start of the previous paragraph.
1497 ESC\ ] forward-paragraph Move forward to the end of the next paragraph.
1498 .TE
1499 .LP
1500 Note that \*QESC\ [\*U is not bound to \fIbackward-paragraph\fP, as might have
1501 been expected, on most (i.e. ANSI-compliant) terminals because that sequence
1502 is used as a prefix for codes generated by the Function Keys.
1503 .LP
1504 \fIBackward-paragraph\fP moves to the beginning of the current or previous
1505 paragraph, while \fIforward-paragraph\fP moves to the end of the current or
1506 next paragraph. Paragraphs are delimited by lines of differing indent, or
1507 lines with text formatter commands, or blank lines. \s-2JOVE\s0 knows how
1508 to deal with most indented paragraphs correctly, although it can get
1509 confused by one- or two-line paragraphs delimited only by indentation.
1510 .HH 2 "Text Indentation Commands"
1511 .LP
1512 .TS
1513 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1514 Tab handle-tab Indent \*Qappropriately\*U in a mode-dependent fashion.
1515 Linefeed newline-and-indent T{
1516 Is the same as Return, except it copies the indent of the line you just left.
1517 T}
1518 ESC\ M first-non-blank Moves to the line's first non-blank character.
1519 .TE
1520 .LP
1521 The way to request indentation is with the Tab command.
1522 Its precise effect depends on the major mode.
1523 In \fIText\fP mode,
1524 it indents to the next tab stop (as determined by the variable
1525 \fItab-width\fP, whose default value is 8).
1526 In \fIC\fP mode or \fILisp\fP mode,
1527 it indents to the \*Qright\*U position for those programs (see later).
1528 .LP
1529 To move over the indentation on a line,
1530 do ESC\ M (\fIfirst-non-blank\fP).
1531 This command,
1532 given anywhere on a line,
1533 positions the cursor at the first non-blank, non-tab character on the line.
1534 .HH 2 "Text Filling"
1535 .TS
1536 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1537 auto-fill-mode Toggle the minor mode \fIauto fill\fP.
1538 ESC\ J fill-paragraph Refill the paragraph containing the cursor.
1539 fill-region Refill the region.
1540 fill-comment Refill a comment, depending on the major mode.
1541 left-margin-here Sets the variable \fIleft-margin\fP from point.
1542 right-margin-here Sets the variable \fIright-margin\fP from point.
1543 .TE
1544 .LP
1545 \fIAuto Fill\fP mode is a minor mode that causes text to be \fIfilled\fP
1546 (broken up into lines that fit in a specified width)
1547 automatically as you type it in.
1548 If you alter existing text so that it is no longer properly filled,
1549 \s-2JOVE\s0 can fill it again if you ask.
1550 .LP
1551 Entering \fIAuto Fill\fP mode is done with ESC\ X \fIauto-fill-mode\fP.
1552 From then on,
1553 lines are broken automatically at spaces when they get longer than the
1554 desired width.
1555 To leave \fIAuto Fill\fP mode,
1556 once again execute ESC\ X \fIauto-fill-mode\fP.
1557 When \fIAuto Fill\fP mode is in effect,
1558 the word \fBFill\fP appears in the mode line.
1559 .LP
1560 If you edit the middle of a paragraph,
1561 it may no longer be filled correctly.
1562 To refill a paragraph,
1563 use the command ESC\ J (\fIfill-paragraph\fP).
1564 It causes the paragraph that point is inside to be filled.
1565 All the line breaks are removed and new ones inserted where necessary.
1566 Similarly, \fIfill-region\fP may be used to refill a region other than a
1567 paragraph. The special command \fIfill-comment\fP is only meaningful in
1568 those major modes, currently C mode and Lisp mode, which support it.
1569 .LP
1570 The maximum line width for filling is in the variable \fIright-margin\fP.
1571 Both ESC\ J and auto-fill make sure that no line exceeds this width.
1572 The value of \fIright-margin\fP is initially 78.
1573 .LP
1574 Normally ESC\ J figures out the indent of the paragraph and uses that same
1575 indent when filling. If you want to force some other indent for a paragraph,
1576 you set \fIleft-margin\fP to the new position and type ^U\ ESC\ J, since
1577 \fIfill-paragraph\fP uses the value of
1578 \fIleft-margin\fP when supplied with a numeric argument.
1579 .LP
1580 If you know where you want to set the variable \fIright-margin\fP but you
1581 don't know the actual value, move to where you want to set the value and use
1582 the
1583 \fIright-margin-here\fP command. \fIleft-margin-here\fP does the same
1584 for the \fIleft-margin\fP variable.
1585 .HH 2 "Case Conversion Commands"
1586 .TS
1587 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1588 ESC\ L case-word-lower Convert the following word to lower case.
1589 ESC\ U case-word-upper Convert the following word to upper case.
1590 ESC\ C case-word-capitalize Capitalize the following word.
1591 case-character-capitalize Capitalize the character after point.
1592 case-region-lower Convert the region to lower case.
1593 case-region-upper Convert the region to upper case.
1594 .TE
1595 .LP
1596 The word conversion commands are most useful.
1597 ESC\ L converts the word after point to lower case,
1598 moving past it.
1599 Thus,
1600 successive ESC\ L's convert successive words.
1601 ESC\ U converts to all capitals instead,
1602 while ESC\ C puts the first letter of the word into upper case and the
1603 rest into lower case.
1604 All these commands convert several words at once if given an argument.
1605 They are especially convenient for
1606 converting a large amount of text from all upper case to mixed case,
1607 because you can move through the text using ESC\ L,
1608 ESC\ U or ESC\ C on each word as appropriate.
1609 .LP
1610 When given a negative argument,
1611 the word case conversion commands apply to
1612 the appropriate number of words before point,
1613 but do not move point.
1614 This is convenient when you have just typed a word in the wrong case.
1615 You can give the case conversion command and continue typing.
1616 .LP
1617 If a word case conversion command is given in the middle of a word,
1618 it applies only to the part of the word which follows the cursor,
1619 treating it as a whole word.
1620 .HH 2 "Commands for Fixing Typos"
1621 .LP
1622 In this section we summarize the commands that are especially useful for the
1623 times when you catch a mistake in your text just after you have made it, or
1624 you change your mind while composing text on a line.
1625 .TS
1626 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1627 DEL delete-previous-character Delete last character.
1628 ESC\ DEL kill-previous-word Kill last word.
1629 ^X\ DEL kill-to-beginning-of-sentence Kill to beginning of sentence.
1630 ^T transpose-characters Transpose two characters.
1631 ^X\ ^T transpose-lines Transpose two lines.
1632 ESC\ Minus ESC\ L Convert last word to lower case.
1633 ESC\ Minus ESC\ U Convert last word to upper case.
1634 ESC\ Minus ESC\ C Convert last word to lower case with initial capital.
1635 .TE
1636 .LP
1637 .HH 3 "Killing Your Mistakes"
1638 .LP
1639 The DEL command is the most important correction command.
1640 When used among printing (self-inserting) characters,
1641 it can be thought of as canceling the last character typed.
1642 .LP
1643 When your mistake is longer than a couple of characters,
1644 it might be more convenient to use ESC\ DEL or ^X\ DEL.
1645 ^X\ DEL is particularly useful when
1646 you are thinking of what to write as you type it,
1647 in case you change your mind about phrasing.
1648 ESC\ DEL and ^X\ DEL save the killed text for subsequent yanking.
1649 .LP
1650 ESC\ DEL is often useful even when you have typed only a few
1651 characters wrong,
1652 if you know you are confused in your typing and aren't sure what you typed.
1653 At such a time,
1654 you cannot correct with
1655 DEL except by looking at the screen to see what you did.
1656 It requires less thought to kill the whole word and start over again.
1657 .HH 3 "Transposition"
1658 .LP
1659 The common error of transposing two characters can be fixed
1660 with the ^T (\fItranspose-characters\fP) command.
1661 Normally,
1662 ^T transposes the two characters on either side of the cursor
1663 and moves the cursor forward one character. Repeating the command
1664 several times \*Qdrags\*U a character to the right.
1665 When given at the end of a line,
1666 rather than switching the last character of the line with the line-separator,
1667 which would be useless,
1668 ^T transposes the last two characters on the line.
1669 So,
1670 if you catch your transposition error right away,
1671 you can fix it with just a ^T.
1672 If you don't catch it so quickly,
1673 you must move the cursor back to between the two characters.
1674 .LP
1675 To transpose two lines,
1676 use the ^X\ ^T (\fItranspose-lines\fP) command. The line containing the
1677 cursor is exchanged with the line above it; the cursor is left at the
1678 beginning of the line following its original position.
1679 .HH 2 "Checking and Correcting Spelling"
1680 .LP
1681 When you write a paper,
1682 you should correct its spelling at some point close to finishing it.
1683 To correct the entire buffer,
1684 do ESC\ X \fIspell-buffer\fP.
1685 This invokes the
1686 .UX
1687 .I spell
1688 program,
1689 which prints a list of all the misspelled words.
1690 \s-2JOVE\s0 catches the list and places it in a
1691 \s-2JOVE\s0 buffer called \fBSpell\fP.
1692 You now edit the \fBSpell\fP buffer (technically, you are in a recursive
1693 edit at this point) by deleting from that buffer any words that
1694 aren't really errors. Next, type ^X\ ^C (\fIexit-jove\fP) to escape from the
1695 recursive edit, and \s-2JOVE\s0 now positions you at the first misspelled word
1696 in the original buffer. Correct that mistake with the usual editor commands.
1697 Then you can go forward to each other misspelled word with ^X\ ^N
1698 (\fInext-error\fP) or backward with ^X\ ^P (\fIprevious-error\fP).
1699 If, in the course of editing a mistake, you get completely lost, the command
1700 \fIcurrent-error\fP will put you back at the error you were supposed to be
1701 correcting.
1702 .HH 1 "Buffers"
1703 .LP
1704 When we speak of \*Qthe buffer\*U,
1705 which contains the text you are editing,
1706 we may have given the impression that there is only one.
1707 In fact,
1708 there may be many of them,
1709 each with its own body of text.
1710 At any time only one buffer can be \fIcurrent\fP and available for editing,
1711 but it is easy to switch to a different one.
1712 Each buffer individually remembers which file it contains,
1713 what modes are in effect,
1714 and whether there are any changes that need saving.
1715 .TS
1716 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1717 ^X\ B select-buffer Select or create a buffer.
1718 ^X\ ^B list-buffers List the existing buffers.
1719 ^X\ K delete-buffer Delete the contents of a buffer and destroy it.
1720 erase-buffer Delete the contents of a buffer.
1721 kill-some-buffers Destroy unwanted buffers.
1722 rename-buffer Rename the selected buffer.
1723 buffer-position Report the position of point within the buffer.
1724 ESC\ \s+2~\s0 make-buffer-unmodified Tell \s-2JOVE\s0 to forget that the buffer has been changed.
1725 ^X\ ^F find-file Read a file into its own buffer.
1726 ^X\ ^S or ^X\ \e save-file Save the selected buffer.
1727 ^X\ ^M write-modified-files Save all modified buffers.
1728 .TE
1729 .LP
1730 Each buffer in \s-2JOVE\s0 has a single name
1731 which normally doesn't change.
1732 A buffer's name can be any length.
1733 The name of the currently selected buffer
1734 and the name of the file contained in it
1735 are visible in the mode line of any window displaying that buffer.
1736 A newly started \s-2JOVE\s0 has only one buffer,
1737 named \fBMain\fP, unless you specified files to edit in the
1738 shell command that started \s-2JOVE\s0.
1739 .HH 2 "Creating and Selecting Buffers"
1740 .LP
1741 To create a new buffer,
1742 you need only think of a name for it (say, FOO)
1743 and then type ^X\ B FOO<return> (\fIselect-buffer\fP).
1744 This makes a new,
1745 empty buffer (if one by that name didn't exist previously)
1746 and selects it for editing.
1747 The new buffer does not contain any file,
1748 so if you try to save it you will be asked for the filename to use.
1749 Each buffer has its own major mode;
1750 the new buffer's major mode is Text mode by default.
1751 .LP
1752 To return to buffer FOO later after having switched to another,
1753 the same command ^X\ B FOO<return> is used,
1754 since ^X\ B can tell whether a buffer named FOO exists already or not.
1755 Just ^X\ B<return> reselects the previous buffer.
1756 Repeated ^X\ B<return>'s alternate between the last two buffers selected.
1757 .HH 2 "Using Existing Buffers"
1758 .LP
1759 To get a list of all the buffers that exist,
1760 type ^X\ ^B (\fIlist-buffers\fP).
1761 Each buffer's type,
1762 name,
1763 and contained filename is printed.
1764 An asterisk before the buffer name indicates that there are
1765 changes that have not yet been saved. The number
1766 that appears at the beginning of a line in a ^X\ ^B listing is that
1767 buffer's \fIbuffer number\fP.
1768 You can select a buffer by typing its number in place of its name.
1769 If a buffer with that number doesn't already exist,
1770 a new buffer is created with that number as its name.
1771 .LP
1772 If several buffers have modified text in them,
1773 you can save them with ^X\ ^M (\fIwrite-modified-files\fP).
1774 This finds all the buffers that need saving and then saves them.
1775 Saving the buffers this way is much
1776 easier and more efficient (but more dangerous)
1777 than selecting each one and typing ^X\ ^S (\fIsave-file\fP).
1778 If you give ^X\ ^M an argument, \s-2JOVE\s0 will ask for confirmation
1779 before saving each buffer.
1780 .LP
1781 ESC\ X \fIrename-buffer\fP <new name><return> changes the name of the
1782 selected buffer.
1783 .LP
1784 ESC\ X \fIerase-buffer\fP <buffer name><return> erases the contents of
1785 <buffer name> without destroying it entirely.
1786 .LP
1787 ESC\ X \fIbuffer-position\fP reports the position of point within the
1788 selected buffer, both as lines/total-lines, chars/total-chars, and as a
1789 percentage.
1790 .LP
1791 Sometimes you will change a buffer by accident.
1792 Even if you undo the effect of the change by editing,
1793 \s-2JOVE\s0 still knows that \*Qthe buffer has been changed\*U.
1794 You can tell \s-2JOVE\s0 to pretend that there have been no changes with the
1795 ESC\ \s+2~\s0 command (\fImake-buffer-unmodified\fP).
1796 This command simply clears the \*Qmodified\*U flag which
1797 says that the buffer contains changes which need to be saved.
1798 Even if
1799 the buffer really \fIis\fP changed \s-2JOVE\s0 will still act as if it were not.
1800 .HH 3 "Killing Buffers"
1801 .LP
1802 After you use a \s-2JOVE\s0 for a while, it may fill up with buffers which
1803 you no longer need. Eventually you can reach a point where trying to create
1804 any more results in an \*Qout of memory\*U or \*Qout of lines\*U error.
1805 When this happens you will want to destroy some buffers with the ^X\ K
1806 (\fIdelete-buffer\fP) command. You can destroy the buffer FOO by doing
1807 ^X\ K FOO<return>. If you type ^X\ K <return> \s-2JOVE\s0 will kill the
1808 previously selected buffer. If you try to kill a buffer that needs saving
1809 \s-2JOVE\s0 will ask you to confirm it.
1810 .LP
1811 If you need to kill several buffers, use the command \fIkill-some-buffers\fP.
1812 This prompts you with the name of each buffer and asks for confirmation
1813 before killing it.
1814 .HH 1 "File Handling"
1815 .LP
1816 The basic unit of stored data is the file.
1817 Each program,
1818 each document,
1819 lives usually in its own file.
1820 To edit a program or document,
1821 the file that contains it must first be brought into a buffer, either an
1822 existing one (\fIvisit-file\fP) or one created specifically for that file
1823 (\fIfind-file\fP).
1824 To make your changes to the file permanent on disk,
1825 you must \fIsave\fP the file.
1826 .HH 2 "Reading Files"
1827 .TS
1828 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1829 ^X\ ^F find-file Read a file into its own buffer.
1830 ^X\ ^V visit-file Visit a file.
1831 ^X\ ^R visit-file An alternative to ^X\ ^V.
1832 ^X\ ^I insert-file Insert a file at point.
1833 .TE
1834 .LP
1835 \s-2JOVE\s0 remembers the name of the file that is contained in each buffer
1836 (remember the ^X\ ^B (\fIlist-buffers\fP) command).
1837 The name of the buffer is visible in its mode line together with the
1838 name of its file.
1839 .LP
1840 You can read a file into its own newly created buffer by typing ^X\ ^F
1841 (\fIfind-file\fP), followed by the filename. The name of the new buffer will
1842 be the last element of the file's pathname. You can abort the command by
1843 typing ^G, or edit the filename with any of the standard \s-2JOVE\s0
1844 commands (e.g., ^A, ^E, ^F, ESC\ F, ESC\ DEL). If the filename you wish to
1845 visit is similar to the filename in the current mode line (the default
1846 filename), you can type ^R to insert the default and then edit it. For more
1847 about this and other special methods of constructing filenames, see the
1848 sections on
1849 .IQ "The Message Line"
1850 and
1851 .IQ "Name Completion"
1852 earlier in this
1853 manual. When you are satisfied type Return, and the new file's text will
1854 appear on the screen, and its name in the mode line.
1855 .LP
1856 The ^F in ^X\ ^F stands for \*QFind\*U,
1857 because if the specified file already resides in some buffer,
1858 that buffer is simply reselected.
1859 So you need not remember whether you have brought the file in already or not.
1860 A buffer created by ^X\ ^F can be reselected later with ^X\ B or ^X\ ^F,
1861 whichever you find more convenient.
1862 .LP
1863 \fIVisiting\fP a file means copying its contents into an existing buffer so
1864 that you can edit them.
1865 To visit a file,
1866 use the command ^X\ ^V or ^X\ ^R (\fIvisit-file\fP),
1867 followed by the filename. The name of the new file will appear in the mode
1868 line but the name of the buffer will be unchanged.
1869 .LP
1870 If you alter one file and then visit another in the same buffer,
1871 \s-2JOVE\s0 offers to save the old one.
1872 If you answer YES (or y),
1873 the old file is saved;
1874 if you answer NO (or n),
1875 all the changes you have made to it since the last save are lost.
1876 You should not type ahead after a file visiting
1877 command,
1878 because your type-ahead might answer an unexpected question
1879 in a way that you would regret.
1880 .LP
1881 ^X\ ^I (\fIinsert-file\fP) followed by a filename reads the file and inserts
1882 it into the buffer at point, leaving point before the file contents and the
1883 mark at their end.
1884 .LP
1885 The changes you make with \s-2JOVE\s0 are made in a copy inside \s-2JOVE\s0.
1886 The file itself is not changed.
1887 The changed text is not permanent until you \fIsave\fP it in a file.
1888 The first time you change the text,
1889 an asterisk appears in the mode line; this indicates that the text
1890 contains fresh changes which will be lost unless you save them.
1891 .LP
1892 What if you want to create a file? Just read it with \fIfind-file\fP or
1893 \fIvisit-file\fP. \s-2JOVE\s0 prints
1894 \fI(New file)\fP but aside from that behaves as if you had read an existing
1895 empty file.
1896 If you make any changes and save them,
1897 the file is created then.
1898 If you read a nonexistent file unintentionally
1899 (because you typed the wrong filename),
1900 go ahead and read the file you meant.
1901 The unwanted file will not have been created.
1902 .HH 2 "Writing files"
1903 .TS
1904 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1905 ^X\ ^S or ^X\ ^\^\e save-file Save the file in the selected buffer.
1906 ^X\ ^W write-file Write the selected buffer to a different file.
1907 write-region Write the region to the specified file.
1908 append-region Append the region to the specified file.
1909 .TE
1910 .LP
1911 If you wish to save the file and make your changes permanent,
1912 type ^X\ ^S.
1913 After the save is finished,
1914 ^X\ ^S prints the filename and the
1915 number of characters and lines that it wrote to the file.
1916 If there are no changes to save (no asterisk in the mode line),
1917 the file is not saved;
1918 otherwise the changes are saved and the asterisk in
1919 the mode line disappears.
1920 .LP
1921 If \s-2JOVE\s0 is about to save a file and sees that the date of the version
1922 on disk does not match what \s-2JOVE\s0 last read or wrote,
1923 \s-2JOVE\s0 notifies you of this fact,
1924 and asks what to do, because this probably means that something is wrong.
1925 For example,
1926 somebody else may have been editing the same file.
1927 If this is so,
1928 there is a good chance that your work
1929 or his work will be lost if you don't take the proper steps.
1930 You should first find out exactly what is going on.
1931 If you determine that somebody else has modified the file,
1932 save your file under a different filename and then DIFF the two files
1933 to merge the two sets of changes. (The \*Qpatch\*U command is useful for
1934 applying the results of context diffs directly).
1935 Also get in touch with the other person so that the files don't diverge
1936 any further.
1937 .LP
1938 ^X\ ^W <filename><return> (\fIwrite-file\fP) writes the contents of the
1939 buffer into the file <filename>, changing the name of the file recorded in
1940 the mode line accordingly. It can be thought of
1941 as a way of \*Qchanging the name\*U of the file in the buffer. Unlike
1942 ^X\ ^S,
1943 \fIwrite-file\fP saves even if the buffer has not been changed.
1944 .LP
1945 ESC\ X \fIwrite-region\fP <file><return> writes the region (the text between
1946 point and mark) to the specified file.
1947 It does not change the buffer's filename.
1948 .LP
1949 ESC\ X \fIappend-region\fP <file><return> appends the region to <file>.
1950 The text is added to the end of <file>.
1951 .HH 2 "How to Undo Drastic Changes to a File"
1952 .LP
1953 If you have made several extensive changes to a file and then change
1954 your mind about them,
1955 and you haven't yet saved them,
1956 you can get rid of them by reading in the previous version of the file.
1957 You can do this with the ^X\ ^V (\fIvisit-file\fP) command,
1958 to visit the unsaved version of the file.
1959 Remember to tell it not to save your existing changes when it asks.
1960 .HH 1 "Windows
1961 .HH 2 "Multiple Windows"
1962 .LP
1963 \s-2JOVE\s0 allows you to split the screen into two or more \fIwindows\fP and
1964 use them to display parts of different buffers,
1965 or different parts of the same buffer.
1966 .KS
1967 .TS
1968 center;
1969 =
1970 || L1 || L .
1971
1972 #define\ getchar()\ \ \ \ getc(stdin)
1973 #define\ putchar(x)\ \ \ putc((x), stdout) <\ first Window
1974 _
1975 \fBJOVE\ (C RO)\ \ \ [stdio.h:1]\ \ "/usr/include/stdio.h"\ \ \-\-\fP <\ the Mode Line
1976 _
1977 {
1978 \ \ \ \ printf("Hello world!\^\e\^n");
1979 \ \ \ \ return 0; <\ second Window
1980 }\^\(sq
1981 _
1982 \fBJOVE\ (C OvWrt)\ \ \ [Main:1]\ \ "aloha.c"\ \ \-\-\ \ /home/foo\fP <\ the Mode Line
1983 _
1984 [Point pushed] <\ the Message Line
1985 =
1986 .TE
1987 .KE
1988 .TS
1989 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
1990 ^X\ 2 split-current-window Divide the active window into two smaller ones.
1991 ^X\ 1 delete-other-windows Delete all windows but the current one.
1992 ^X\ D delete-current-window Delete the active window.
1993 ^X\ N next-window Switch to the next window.
1994 ^X\ P previous-window Switch to the previous window.
1995 ^X\ O previous-window Same as ^X\ P.
1996 ^X\ ^ grow-window Make this window bigger.
1997 shrink-window Make this window smaller.
1998 ESC\ ^V page-next-window Scroll the other window.
1999 ^X\ 4 window-find Combination window command.
2000 .TE
2001 .LP
2002 When using \fImultiple window\fP mode,
2003 the window portion of the screen
2004 is divided into \fIwindows\fP,
2005 which can display different pieces of text.
2006 Each window can display different buffers,
2007 or different parts of the same buffer.
2008 Only one of the windows is
2009 \fIactive\fP, viz.
2010 the window which the cursor is in.
2011 Editing normally takes place in that window alone.
2012 To edit in another window,
2013 you would give a command to move the cursor to the other window,
2014 and then edit there.
2015 .LP
2016 Each window includes a mode line for the buffer it is displaying. This is
2017 useful to keep track of which window corresponds with which buffer and which
2018 file. In addition, the mode line serves as a separator between windows.
2019 Normally, the variable \fImode-line-should-standout\fP is \fIon\fP so that
2020 \s-2JOVE\s0 displays the mode-line in reverse video (assuming your
2021 particular terminal has the reverse video capability). However, if the
2022 variable
2023 .I scroll-bar
2024 is also \fIon\fP, a portion of the mode line is left clear to indicate how the
2025 window is located within the buffer.
2026 .LP
2027 The command ^X\ 2 (\fIsplit-current-window\fP) divides the active window
2028 into two. A new mode line appears across the middle of the original window,
2029 dividing its display area into two halves.
2030 Both windows contain the same buffer and display the same position in it,
2031 namely where point was at the time you issued the command.
2032 The cursor moves to the second window.
2033 .LP
2034 To return to viewing only one window,
2035 use the command ^X\ 1 (\fIdelete-other-windows\fP).
2036 The active window expands to fill the whole screen,
2037 and the other windows disappear until the next ^X\ 2.
2038 (The buffers and their contents are unaffected by any of the
2039 window operations).
2040 .LP
2041 While there is more than one window,
2042 you can use ^X\ N (\fInext-window\fP) to switch to the next window,
2043 and ^X\ P (\fIprevious-window\fP) to switch to the previous one.
2044 If you are in the bottom window and you type ^X\ N,
2045 you will be placed in the top window,
2046 and the opposite thing happens when you type ^X\ P in the top window.
2047 ^X\ O is the same as ^X\ P.
2048 It stands for \*Qother window\*U because, when there are only two windows,
2049 repeated use of this command will switch between them.
2050 .LP
2051 Often you will be editing one window while using the other just for reference.
2052 Then,
2053 the command ESC\ ^V (\fIpage-next-window\fP) is very useful.
2054 It scrolls the next window up, just
2055 as if you switched to the next window,
2056 typed ^V,
2057 and switched back.
2058 With a negative argument,
2059 ESC\ ^V will scroll down.
2060 .LP
2061 When a window splits,
2062 both halves are approximately the same size.
2063 You can redistribute the screen space between the windows with
2064 the ^X\ ^ (\fIgrow-window\fP) command.
2065 It makes the active window grow one line bigger,
2066 or as many lines as is specified with a numeric argument.
2067 Use ESC\ X \fIshrink-window\fP to make the active window smaller.
2068 .HH 2 "Multiple Buffers in Multiple Windows"
2069 .LP
2070 Buffers can be selected independently in each window. The ^X\ B
2071 (\fIselect-buffer\fP) command selects a different buffer in the active
2072 window (i.e. the
2073 one containing the cursor). Other windows' buffers do not change. Likewise,
2074 the ^X\ ^F (\fIfind-file\fP) command reads a new file into a new buffer in
2075 the active window.
2076 .LP
2077 You can view the same buffer in more than one window.
2078 Although the same buffer appears in both windows,
2079 they have different values of point,
2080 so you can move around in one window while the other window
2081 continues to show the same text.
2082 If you make changes in one window, and the same place in the buffer happens
2083 to be visible in the other window, your changes will appear simultaneously
2084 in both places.
2085 .LP
2086 If you have the same buffer in both windows,
2087 you must beware of trying to visit a different file in one of
2088 the windows with ^X\ ^V,
2089 because if you bring a new file into this buffer
2090 it will replace the old file in \fIboth\fP windows.
2091 To view different files in different windows,
2092 you must switch buffers in one of the windows first
2093 (with ^X\ B) or use ^X\ ^F (\fIfind-file\fP).
2094 .LP
2095 A convenient \*Qcombination\*U command for viewing something in another
2096 window is ^X\ 4 (\fIwindow-find\fP).
2097 With this command you can ask to see any specified buffer,
2098 file or tag in the other window.
2099 Follow the ^X\ 4 with either B and a buffer name,
2100 F and a filename,
2101 or T and a tag name.
2102 This switches to the other window and finds there what you specified.
2103 If you were previously in one-window mode,
2104 multiple-window mode is entered.
2105 ^X\ 4 B is similar to ^X\ 2 ^X\ B;
2106 ^X\ 4 F is similar to ^X\ 2 ^X\ ^F;
2107 ^X\ 4 T is similar to ^X\ 2 ^X\ T.
2108 The difference is one of efficiency,
2109 and also that ^X\ 4 works equally well if you are already using two windows.
2110 .HH 2 "Controlling the Display"
2111 .LP
2112 Since only part of a large file will fit in a window,
2113 \s-2JOVE\s0 tries to show the portion that is likely to be interesting.
2114 The display control commands allow you to bring a different portion of the buffer
2115 within the active window.
2116 .TS
2117 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2118 ^L redraw-display T{
2119 Reposition point at a specified vertical position,
2120 OR clear and redraw the window with point in the same place.
2121 T}
2122 ESC\ ^L clear-and-redraw Clear and redraw the entire screen.
2123 ^V next-page Scroll forwards (a page or a few lines).
2124 ESC\ V previous-page Scroll backwards.
2125 ^Z scroll-up Scroll forward some lines.
2126 ESC\ Z scroll-down Scroll backwards some lines.
2127 scroll-left Scroll the window to the left.
2128 scroll-right Scroll the window to the right.
2129 number-lines-in-window Number the lines in the window.
2130 .TE
2131 .LP
2132 A window is rarely large enough to display all of your file.
2133 If the whole buffer doesn't fit on the screen,
2134 \s-2JOVE\s0 shows a contiguous portion of it,
2135 containing point.
2136 It continues to show approximately the same portion
2137 until point moves outside of what is displayed;
2138 then \s-2JOVE\s0 chooses a new portion centered around a new point.
2139 This is \s-2JOVE\s0's guess as to what you are most interested in seeing,
2140 but if the guess is wrong,
2141 you can use the display control commands to see a different portion.
2142 .LP
2143 If the window holds only a part of the buffer, and if the variable
2144 .I scroll-bar
2145 is \fIon\fP, a clear patch in the (otherwise reverse-videoed) mode line
2146 indicates what proportion is visible. This is especially useful for
2147 mouse-based versions of the editor, such as
2148 .I xjove .
2149 .LP
2150 First we describe how \s-2JOVE\s0 chooses a new window position on its own.
2151 The goal is usually to place point
2152 half way down the window.
2153 This is controlled by the variable \fIscroll-step\fP,
2154 whose value is the number of
2155 lines above the bottom or below the top of the window that the line
2156 containing point is placed.
2157 A value of 0 (the initial value) means center point
2158 in the window.
2159 .LP
2160 The basic display control command is ^L (\fIredraw-display\fP).
2161 In its simplest form,
2162 with no argument,
2163 it tells \s-2JOVE\s0 to choose a new portion of the buffer,
2164 centering the existing point half way from the top as usual.
2165 ^L with a positive argument chooses a new portion so as to put point
2166 that many lines from the top.
2167 An argument of zero puts point on the very top line.
2168 Point does not move with respect to the text; rather,
2169 the text and point move rigidly on the screen.
2170 .LP
2171 If during the ^L command point stays on the same line,
2172 the window is first cleared and then redrawn.
2173 Thus,
2174 two ^L's in a row are guaranteed to clear and redraw the active window.
2175 ESC\ ^L (\fIclear-and-redraw\fP) will clear and redraw the entire screen.
2176 .LP
2177 The \fIscrolling\fP commands ^V,
2178 ESC\ V,
2179 ^Z,
2180 and ESC\ Z
2181 let you move the whole display up or down a few lines.
2182 In fact, with a numeric argument, ^V is identical to ^Z and ESC\ V to ESC\ Z.
2183 So ^V (\fInext-page\fP) or ^Z (\fIscroll-up\fP) with an
2184 argument shows you that many more lines at the bottom of the screen,
2185 moving the text and point up together as ^L might.
2186 ^V or ^Z with a
2187 negative argument shows you more lines at the top of the screen,
2188 as does ESC\ V (\fIprevious-page\fP) or ESC\ Z (\fIscroll-down\fP) with a
2189 positive argument.
2190 .LP
2191 ^V with no argument scrolls the buffer a window at a time.
2192 It takes the last line at the bottom of the window and puts
2193 it at the top,
2194 followed by nearly a whole window of lines not visible before.
2195 Point is put at the top of the window.
2196 Thus, each ^V shows the \*Qnext page of text\*U,
2197 except for one line of overlap to provide context.
2198 To move backward,
2199 use ESC\ V without an argument,
2200 which moves a whole window backwards (again with a line of overlap).
2201 .LP
2202 With no argument, ^Z and ESC\ Z scroll one line forward and one line backward,
2203 respectively.
2204 These are convenient for moving in units of one line
2205 without having to type a numeric argument.
2206 .LP
2207 The commands \fIscroll-left\fP and \fIscroll-right\fP scroll the entire
2208 window in the specified direction by the amount of the argument (or for 10
2209 characters by default). The argument may be negative.
2210 .LP
2211 The command \fInumber-lines-in-window\fP causes each line displayed to be
2212 preceded by its line-number (and giving the command again restores the
2213 former state). Note that this state is a property of the window, not of the
2214 buffer.
2215 .HH 1 "Processes Under \s-2JOVE\s0"
2216 .LP
2217 An important feature of \s-2JOVE\s0 is its ability to interact with
2218 .UX .
2219 You can run
2220 .UX
2221 commands from \s-2JOVE\s0 and catch their output in \s-2JOVE\s0 buffers.
2222 Two mechanisms are provided, \fIinteractive processes\fP and \fInon-interactive processes\fP.
2223 .HH 2 "Interactive Processes"
2224 .LP
2225 With most modern
2226 .UX
2227 systems, \s-2JOVE\s0
2228 has the capability of running interactive
2229 processes, accepting your input and capturing your output in a buffer.
2230 .TS
2231 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2232 shell T{
2233 Run a shell in an interactive process buffer.
2234 T}
2235 i-shell-command T{
2236 Run a \s-1UNIX\s0 command in an interactive process buffer.
2237 T}
2238 .TE
2239 .HH 3 "How to Run a Shell in a Window"
2240 .LP
2241 Type ESC\ X \fIshell\fP<return> to start up a shell.
2242 \s-2JOVE\s0 will
2243 create a buffer,
2244 called \fB\(**shell\(**\-1\fP,
2245 and choose a window for this new buffer.
2246 The shell process is now said to be attached to the buffer.
2247 The program that is now running in the buffer is that specified by the
2248 variable \fIshell\fP, which is itself initialized from your SHELL
2249 environment variable. The shell command is called with the flag \*Q-c\*U, or
2250 whatever else the variable \fIshell-flags\fP has been set to.
2251 .LP
2252 Use an argument (\fBn\fP) with the \fIshell\fP command to create other
2253 buffers (\fB\(**shell\(**\-n\fP) running independent shells.
2254 .LP
2255 Once an interactive process is running you can select another buffer into
2256 that window, or you can delete that window altogether. You can go off and
2257 do some other editing while the command is running. This is useful for
2258 commands that do sporadic output and run for fairly long periods of time.
2259 When you reselect that buffer later it will be up to date. That is, even
2260 though the buffer wasn't visible it was still receiving output from the
2261 process. You don't have to worry about missing anything when the buffer
2262 isn't visible.
2263 .HH 3 "How to Run a Command in a Window"
2264 .LP
2265 To run a
2266 .UX
2267 command interactively from \s-2JOVE\s0 type ESC\ X \fIi-shell-command\fP
2268 <command-name><return>. For example, to run the desk calculator, you do:
2269 .DS
2270 ESC\ X i-shell-command dc<return>
2271 .DE
2272 Then \s-2JOVE\s0 picks a buffer in which the output from the
2273 command will be placed, named after the command (\fIdc\fP in this case).
2274 Compare this command to the non-interactive \fIshell-command\fP to be
2275 described presently.
2276 .HH 3 "Facilities available in interactive windows"
2277 .LP
2278 What you type into an interactive process isn't seen immediately by the
2279 process; instead \s-2JOVE\s0 waits until you type an entire line before
2280 passing it on to the process to read. This means that before you type
2281 Return all of \s-2JOVE\s0's editing capabilities are available for fixing
2282 errors on your input line. If you discover an error at the beginning of the
2283 line, rather than erasing the whole line and starting over you can simply
2284 move to the error, correct it, move back, and continue typing.
2285 .LP
2286 In fact Return does different things
2287 depending on both your position in the buffer and on the state of the process.
2288 In the normal case,
2289 when point is in the last line of the buffer,
2290 Return does as already described: it inserts a line-separator and then
2291 sends the line to the process.
2292 If you are somewhere else in the buffer,
2293 possibly positioned at a previous command that you want to edit,
2294 Return will place a copy of that line
2295 at the end of the buffer and move you there
2296 (the prompt will be discarded if there is one \(em the variable
2297 \fIprocess-prompt\fP specifies what to discard)
2298 Then you can edit the line and type Return as in the normal case.
2299 If the process has died for some reason,
2300 Return does nothing.
2301 It doesn't even insert itself.
2302 If that happens unexpectedly,
2303 you should type ESC\ X \fIlist-processes\fP<return>
2304 to get a list of each process and its state.
2305 If your process died abnormally,
2306 \fIlist-processes\fP may help you figure out why.
2307 .LP
2308 Another feature is that you have the entire history of your session in
2309 the \s-2JOVE\s0 buffer.
2310 You don't have to worry about output from a command
2311 moving past the top of the screen.
2312 If you missed some output you can
2313 move back through it with ESC\ V and other commands.
2314 In addition,
2315 you can save yourself retyping a command (or a similar one) by sending
2316 edited versions of previous commands, or edit the output of one command
2317 to become a list of commands to be executed (\*Qimmediate shell scripts\*U).
2318 .LP
2319 There are several special commands available only in interactive windows.
2320 .TS
2321 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2322 Return process-newline Send a line to a process.
2323 process-send-data-no-return T{
2324 Send a line to a process, but without the line-separator.
2325 T}
2326 ^C\ ^C interrupt-process Send SIGINT to the process.
2327 ^C\ \^\e quit-process Send SIGQUIT to the process.
2328 ^C\ ^Z stop-process Send SIGTSTP to the process.
2329 ^C\ ^Y dstop-process Send SIGTSTP when next the process tries to read input.
2330 continue-process Send SIGCONT to the process.
2331 kill-process Send SIGKILL to the process in a specified buffer.
2332 ^C\ ^D eof-process Send EOF to the process.
2333 .TE
2334 Although Return is automatically bound to \fIprocess-newline\fP, the various
2335 ^C\ ... must be explicitly bound in your (or your system administrator's)
2336 customization. The effects of Return (\fIprocess-newline\fP) in various
2337 circumstances have already been described above. The effects of ^C\ ^\fBx\fP
2338 for various \fBx\fP are equivalent to sending ^\fBx\fP to the shell,
2339 assuming the customary bindings as set up by \fIstty\fP. Observe that
2340 ^\fBx\fP without a preceding ^C will have some other effect in \s-2JOVE\s0
2341 (for example, ^D is still bound to \fIdelete-next-character\fP).
2342 .HH 3 "DBX in interactive windows"
2343 .LP
2344 If the debugging program \fIdbx\fP is provided with your
2345 .UX
2346 system, you may of course run it in an interactive window. Before doing
2347 this, you should turn on the dbx minor mode. The effect of this is
2348 that, every time \fIdbx\fP halts with a message line specifying a filename and
2349 linenumber (at every breakpoint, for example), \fIfind-file\fP will
2350 automatically be called on that filename, it will appear in another window,
2351 and point will be moved to that line. Thus you may easily follow the
2352 progress of the program being debugged.
2353 .HH 2 "Non-interactive Processes"
2354 .LP
2355 The reason these are called non-interactive processes is that you
2356 can't type any input to them; you can't interact with them; they can't
2357 ask you questions because there is no way for you to answer.
2358 Remember that \s-2JOVE\s0 (not the process in the window)
2359 is listening to your keyboard,
2360 and \s-2JOVE\s0 waits until the process dies before it looks at
2361 what you type.
2362 .TS
2363 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2364 ^X\ ! shell-command Run a \s-1UNIX\s0 command in a buffer.
2365 shell-command-no-buffer Run a \s-1UNIX\s0 command without any buffer.
2366 shell-command-to-buffer Run a \s-1UNIX\s0 command in a named buffer.
2367 shell-command-with-typeout T{
2368 Run a \s-1UNIX\s0 command sending output to the screen.
2369 T}
2370 .TE
2371 .LP
2372 To run a
2373 .UX
2374 command from \s-2JOVE\s0 just type ^X\ ! <command-name><return>.
2375 For example,
2376 to get a list of all the users on the system,
2377 you do:
2378 .DS I
2379 ^X\ ! who<return>
2380 .DE
2381 Then \s-2JOVE\s0 picks a buffer in which the output from the
2382 command will be placed, named after the command.
2383 E.g.,
2384 \*Qwho\*U uses a buffer called \fBwho\fP;
2385 \*Qps alx\*U uses \fBps\fP;
2386 and \*Qegrep -n foo \(**.c\*U uses \fBegrep\fP.
2387 If \s-2JOVE\s0
2388 wants to use a buffer that already exists it first erases the old contents.
2389 If the buffer it selects holds a file,
2390 not output from a previous shell command,
2391 you must first delete that buffer with ^X\ K (\fIdelete-buffer\fP).
2392 There are variants of the command where there is no buffer, where you can
2393 name your own buffer, and where the output is direct to the screen (see the
2394 section on typeout at the start of this manual).
2395 .LP
2396 Once \s-2JOVE\s0 has picked a buffer it puts that buffer in a window so you
2397 can see the command's output as it is running.
2398 If there is only one window \s-2JOVE\s0 will automatically make another one.
2399 Otherwise,
2400 \s-2JOVE\s0
2401 tries to pick the most convenient window other than the current one.
2402 .LP
2403 It is not a good idea to type anything while the command is running because
2404 \s-2JOVE\s0 won't see the characters (and thus won't execute them) until the
2405 command finishes,
2406 so you may forget what you have typed.
2407 If you really want to carry on with other editing tasks while it is
2408 running, it is better to use the \fIi-shell-command\fP described previously.
2409 .LP
2410 If you want to interrupt the command for some reason (perhaps you
2411 mistyped it, or you changed your mind) you can type ^] (or whatever else has
2412 been put in the variable \fIinterrupt-character\fP).
2413 Typing this
2414 inside \s-2JOVE\s0 while a process is running is the same as typing ^C when
2415 you are outside \s-2JOVE\s0,
2416 namely the process is interrupted.
2417 .LP
2418 When the command finishes, \s-2JOVE\s0 puts you back in the window in which
2419 you started.
2420 Then it prints a message indicating whether or not the command
2421 completed successfully in its (the command's) opinion.
2422 That is,
2423 if the command had what it considers an error
2424 (or you interrupt it with ^])
2425 \s-2JOVE\s0 will print an appropriate message.
2426 .HH 3 "Applications of Non-Interactive Processes"
2427 .LP
2428 ^X\ ! (\fIshell-command\fP) is useful for running commands that do some
2429 output and then exit. So you could type ^X\ ! spell <filename> and it would
2430 create a buffer \*Qspell\*U, fill it with all the spelling mistakes in
2431 <filename> and display it in a window. However, as we have already seen,
2432 there is a built-in \s-2JOVE\s0 command to do this job (and more) which,
2433 behind the scenes, issues exactly that \fIshell-command\fP. Thus, the built
2434 in usage of this facility by \s-2JOVE\s0 itself is as important as any use
2435 you might invent for yourself.
2436 .LP
2437 You could run a program through a compiler using \fIshell-command\fP,
2438 but again \s-2JOVE\s0 provides a special command for the job.
2439 This is the ^X\ ^E (\fIcompile-it\fP) command.
2440 If you run \fIcompile-it\fP with no argument
2441 it runs the
2442 .UX
2443 \fImake\fP
2444 program into a buffer.
2445 If you need a special command or want to pass arguments to \fImake\fP,
2446 run \fIcompile-it\fP with any argument (^U is good enough) and you
2447 will be prompted for the command to execute.
2448 If any error messages are produced, they are treated specially by \s-2JOVE\s0.
2449 That treatment is the subject of the next section.
2450 .LP
2451 Another useful example of using the \fIshell-command\fP would be to type
2452 ^X\ ! egrep\ -l <identifier>\ \(**.c, to give you a list of all your .c files
2453 containing that <identifier>.
2454 .HH 4 "Error Message Parsing"
2455 .TS
2456 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2457 parse-errors Prepare to exhibit the errors listed in the buffer.
2458 parse-spelling-errors-in-buffer Prepare to exhibit the listed spelling errors.
2459 ^X\ ^N next-error Move to the next listed error.
2460 ^X\ ^P previous-error Move to the previous listed error.
2461 current-error Move to the current listed error.
2462 .TE
2463 .LP
2464 When you have your error
2465 messages in a buffer as produced by the \fIshell-command\fP, you run the
2466 \fIparse-errors\fP command (this happens automatically after a
2467 \fIcompile-it\fP). Each line in this buffer should specify a filename and a
2468 linenumber (\s-2JOVE\s0 knows how to interpret the error messages from many
2469 .UX
2470 commands; in particular from \fIcc\fP,
2471 \fIgrep\ -n\fP and \fIlint\fP). \fIParse-errors\fP then does a
2472 \fIfind-file\fP on the first such filename and a \fIgoto-line\fP on its
2473 linenumber. When you have dealt with the error on that line (perhaps
2474 editing lines elsewhere in your program in the process) you can type ^X\ ^N
2475 (\fInext-error\fP) to move to the next error (perhaps in a different file).
2476 Or you can type ^X\ ^P (\fIprevious-error\fP) or ESC\ X \fIcurrent-error\fP.
2477 The rules \s-2JOVE\s0 uses to interpret error message in a buffer are
2478 specified in the variable \fIerror-format-string\fP.
2479 .LP
2480 The action following the \s-2JOVE\s0 command \fIspell\fP is similar, except
2481 that it calls (automatically) the command
2482 \fIparse-spelling-errors-in-buffer\fP instead of \fIparse-errors\fP.
2483 .LP
2484 If you already have a file called
2485 \fIerrs\fP containing, say, C compiler messages then you can get \s-2JOVE\s0
2486 to interpret the messages by invoking it as:
2487 .DS I
2488 .I
2489 % jove \-p errs
2490 .R
2491 .DE
2492 .HH 4 "Filtering"
2493 .TS
2494 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2495 filter-region T{
2496 Pass the region through a command and replace it
2497 with the output.
2498 T}
2499 .TE
2500 .LP
2501 Suppose your buffer contains a table. You make this table the region (put
2502 mark at the start of it and point at the end). Type ESC\ X
2503 \fIfilter-region\fP \fIsort\fP<return> (or any other
2504 .UX
2505 command). Your table will be passed through the
2506 .UX
2507 \fIsort\fP command and be
2508 replaced by the sorted version of itself. The old version is placed in the
2509 kill ring, and you can restore the status quo by obeying the \fIyank-pop\fP
2510 command.
2511 .HH 1 "Directory Handling"
2512 .LP
2513 To save having to use absolute pathnames when you want to edit a nearby file
2514 \s-2JOVE\s0 maintains a \fIcurrent directory\fP and allows you to move
2515 around the
2516 .UX
2517 filesystem just as a shell would.
2518 .TS
2519 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2520 cd \fRdir Change to the specified directory.
2521 pushd \fR[dir] T{
2522 Like \fIcd\fP, but saves the old directory on the directory stack.
2523 With no directory argument, simply exchanges the top two directories
2524 on the stack and \fIcd\fPs to the new top.
2525 T}
2526 pushlibd T{
2527 Does a \fIpushd\fP on the directory containing all
2528 of \s-2JOVE\s0's standard customization files.
2529 T}
2530 popd T{
2531 Take the current directory off the stack and restore the
2532 previous one.
2533 T}
2534 dirs Display the contents of the directory stack.
2535 .TE
2536 .LP
2537 The names and behavior of these commands were chosen to mimic those in the c-shell.
2538 .HH 1 "Major and Minor Modes"
2539 .HH 2 "Major Modes"
2540 .LP
2541 To help with editing particular types of file, say a document or a C program,
2542 \s-2JOVE\s0 has several \fImajor modes\fP. Each mode defines rules as to
2543 which characters constitute a \*Qword\*U (for the purposes of
2544 regular-expressions, language identifiers, abbreviations, and
2545 double-clicking in
2546 \fIxjove\fP), how indentation is to be
2547 performed, and maybe other specialized services.
2548 These are currently as follows:
2549 .HH 3 "Fundamental Mode"
2550 .LP
2551 This is the simplest mode, with no frills, and is used when you are
2552 operating within the message line at the bottom of the screen (hence it is
2553 the mode of the Minibuf).
2554 .HH 3 "Text mode"
2555 .LP
2556 This is the default major mode. Nothing special is done beyond making
2557 apostrophe (') be a word character.
2558 .HH 3 "C mode"
2559 .LP
2560 In this mode, \*Q$\*U and \*Q_\*U are word characters, and there are special
2561 facilities for indentation.
2562 Using the \fIauto-execute-command\fP command, you can make \s-2JOVE\s0 enter
2563 \fIC Mode\fP whenever you edit a file whose name ends in \fI.c\fP.
2564 .HH 4 "Indentation Commands"
2565 .LP
2566 To save having to lay out C programs \*Qby hand\*U, \s-2JOVE\s0
2567 has an idea of the correct indentation of a line,
2568 based on the surrounding context.
2569 When you are in C Mode, \s-2JOVE\s0 treats tabs specially \(em
2570 typing a Tab at the beginning of a new line means
2571 \*Qindent to the right place\*U
2572 (actually, it just goes back to the line containing the nearest unmatched
2573 \*Q{\*U, and indents 1 Tab more than that line).
2574 The indentation will be in multiples of the variable
2575 \fIc-indentation-increment\fP (which defaults to 8).
2576 Closing braces are also handled specially, and are indented
2577 to match the corresponding open brace.
2578 .LP
2579 If you Tab in the middle of a (\^...\^) (for example, you call a function
2580 whose actual-parameters stretch over many lines) then you have a choice
2581 depending on the variable \fIc-argument-indentation\fP. If its value is \-1,
2582 you will be aligned with the corresponding actual-parameter on the line
2583 above. Otherwise, \fIc-argument-indentation\fP gives the extra number of
2584 characters by which to indent this continuation line.
2585 .LP
2586 If you really want a Tab to mean a single Tab on some particular occasion,
2587 you can always precede it by a ^Q (\fIquoted-insert\fP).
2588 .HH 4 "Parenthesis and Brace Matching"
2589 .TS
2590 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2591 show-match-mode Toggle the \fIShow Match\fP minor mode.
2592 ESC\ ^N forward-list Move forwards over a (\^...\^).
2593 ESC\ ^P backward-list Move backwards over a (\^...\^).
2594 ESC\ ^D down-list Move forward to just inside the next (\^...\^).
2595 ESC\ ^U backward-up-list T{
2596 Move backwards to the start of the enclosing (\^...\^).
2597 T}
2598 .TE
2599 .LP
2600 To check that parentheses and braces match the way you think they do, turn
2601 on the \fIShow Match\fP minor mode (ESC\ X \fIshow-match-mode\fP). Then,
2602 whenever you type a close brace or parenthesis, the cursor moves momentarily
2603 to the matching opener, if it is currently visible. If it's not visible,
2604 \s-2JOVE\s0 displays the line containing the matching opener on the message
2605 line.
2606 .LP
2607 If your parenthesized expressions are already typed, then you may find
2608 ESC\ ^N and ESC\ ^P useful to find a closing parenthesis to match an opening
2609 one somewhere just after point, or a closing one to match an opening one
2610 somewhere just before point. Note that these commands handle all kinds of
2611 parentheses ((\^...\^), [\^...\^] and {\^...\^}) and properly matched
2612 internal pairs are skipped over. These two commands take arguments and go in
2613 the opposite direction if the argument is negative. Likewise, the commands
2614 ESC\ D (\fIdown-list\fP) and ESC\ U (\fIbackward-up-list\fP) may be used to
2615 find more or less (respectively) deeply nested parentheses.
2616 .HH 4 "C Tags"
2617 .LP
2618 Often when you are editing a C program,
2619 especially someone else's code,
2620 you see a function call and wonder what that function does.
2621 So you have to suspend the edit,
2622 \fIgrep\fP for the function-name in every .c file that might contain it,
2623 and finally visit the appropriate file.
2624 .LP
2625 To avoid this diversion or the need to remember which
2626 function is defined in which file,
2627 many
2628 .UX
2629 systems provide a program called \fIctags(1)\fP, which
2630 takes a set of source files and looks for function
2631 definitions, producing a file called \fItags\fP as its output.
2632 .TS
2633 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2634 ^X\ T find-tag Find the file/line where the specified tag is declared.
2635 find-tag-at-point Find the tag immediately following point.
2636 .TE
2637 .LP
2638 \s-2JOVE\s0 has a command called ^X\ T (\fIfind-tag\fP)
2639 that prompts you for the name of a function (a \fItag\fP), looks up
2640 the tag reference in the previously constructed \fItags\fP file,
2641 then performs a \fIfind-file\fP on the file containing that tag,
2642 with point positioned at the definition of the function.
2643 There is another version of this command, \fIfind-tag-at-point\fP,
2644 that uses the identifier at point.
2645 .LP
2646 So, when you've added new functions to a module, or moved some old
2647 ones around, run the \fIctags\fP program to regenerate the \fItags\fP file.
2648 \s-2JOVE\s0 looks in the file specified by the variable \fItag-file\fP. The
2649 default is \*Q\fB.\fP\^/\^tags\*U, i.e. the tag file in the current
2650 directory. If you wish to use an alternate tag file you use ^U\ ^X\ T and
2651 \s-2JOVE\s0 will prompt for a file name.
2652 .LP
2653 To begin an editing session looking for a particular tag, use
2654 the \fI\-t tag\fP command line option to \s-2JOVE\s0.
2655 For example, say you wanted to look at the file containing the tag
2656 \fISkipChar\fP, you would invoke \s-2JOVE\s0 as:
2657 .DS I
2658 .I
2659 % jove \-t SkipChar
2660 .R
2661 .DE
2662 .HH 3 "Lisp mode"
2663 .LP
2664 In this mode, any of the characters
2665 \*Q!\^$\^%\^&\^\(**\^+\^\-\^/\^:\^<\^=\^>\^?\^^\^_\^{\^|\^}\^\s+2~\s0\*U and
2666 Delete are word characters (in other words, \*Qwords\*U are Lisp atoms).
2667 The mode is analogous to \fIC Mode\fP,
2668 but performs the indentation needed to lay out Lisp programs properly.
2669 .HH 4 "Parenthesis Matching"
2670 .LP
2671 In addition to the parenthesis matching commands available under C mode, we
2672 have:
2673 .TS
2674 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2675 ESC\ ^F forward-s-expression Move backward over an atom or list.
2676 ESC\ ^B backward-s-expression Move forward over an atom or a list.
2677 grind-s-expression Re-indent an s-expression.
2678 ESC\ ^K kill-s-expression Kill from point to the end of an s-expression.
2679 .TE
2680 .LP
2681 In fact the first two of these commands work in other modes also, but for
2682 \*Qatom\*Q read \*Qidentifier\*U.
2683 .HH 2 "Minor Modes"
2684 .LP
2685 In addition to the major modes,
2686 \s-2JOVE\s0 has a set of minor modes whose state is controlled by the
2687 following commands:
2688 .TS
2689 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2690 auto-indent-mode
2691 auto-fill-mode
2692 dbx-mode
2693 over-write-mode
2694 read-only-mode
2695 show-match-mode
2696 word-abbrev-mode
2697 .TE
2698 .LP
2699 With no argument, these commands toggle the mode. With a zero argument they
2700 turn it \fIoff\fP, and with any other argument they turn it \fIon\fP.
2701 .HH 3 "Auto Indent"
2702 .LP
2703 In this mode,
2704 \s-2JOVE\s0 indents each line the same way as that above it. That is,
2705 the Return key in this mode acts as the Linefeed key ordinarily does.
2706 This mode is only likely to be useful if you are afflicted with a keyboard
2707 without a Linefeed key.
2708 .HH 3 "Auto Fill"
2709 .LP
2710 In \fIAuto Fill\fP mode,
2711 a newline is automatically inserted when the line length
2712 exceeds the right margin.
2713 This way,
2714 you can type a whole paragraph without having to use the Return key.
2715 .HH 3 "DBX"
2716 .LP
2717 This mode is useful if dbx is being run in an interactive window.
2718 It is described in the section on interactive windows.
2719 .HH 3 "Over Write"
2720 .LP
2721 In this mode,
2722 any text typed in will replace the previous contents
2723 (the default is for new text to be inserted and \*Qpush\*U the old along).
2724 This is useful for editing an already-formatted diagram in which you
2725 want to change some things without moving other things around on the
2726 screen.
2727 .HH 3 "Read Only"
2728 .LP
2729 In this mode, modifying the buffer is inhibited. This mode is set
2730 automatically on any attempt to read a file for which you do not have write
2731 permission.
2732 .HH 3 "Show Match"
2733 .LP
2734 Move the cursor momentarily to the matching opening parenthesis when a closing
2735 parenthesis is typed.
2736 .HH 3 "Word Abbrev"
2737 .LP
2738 In this mode, every word you type is compared to a list of word
2739 abbreviations; whenever you type an abbreviation, it is replaced
2740 by the text that it abbreviates.
2741 This can save typing if a particular word or phrase must be entered
2742 many times. For example, your programming language might have reserved words
2743 that you customarily type in upper case (identifiers etc. being in lower
2744 case). So you might define B as an abbreviation for BEGIN, E for END, P for
2745 PROCEDURE, and so on.
2746 .TS
2747 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2748 define-global-word-abbrev Define a new global abbreviation.
2749 define-word-abbrev T{
2750 Define a new abbreviation within the current major mode.
2751 T}
2752 edit-word-abbrev Edit the list of abbreviations.
2753 write-word-abbrev-file Write the list of abbreviations to a file.
2754 read-word-abbrev-file Read a list of abbreviations from a file.
2755 .TE
2756 .LP
2757 The abbreviations and their expansions are held in a list that looks like:
2758 .DS I
2759 abbrev:phrase
2760 .DE
2761 for example
2762 .DS
2763 jove:jonathan's own version of EMACS
2764 .DE
2765 Use \fIdefine-global-word-abbrev\fP to add an entry that is to be effective in
2766 all buffers and \fIdefine-word-abbrev\fP for an entry that is to be
2767 effective only in buffers of the same major mode as the selected buffer. Use
2768 \fIedit-word-abbrev\fP to edit the list (it enters a recursive edit on a
2769 buffer containing the list \(em use ^X\ ^C (\fIexit jove\fP) when you are
2770 finished). Use \fIwrite-word-abbrev-file\fP to write the list to a file and
2771 \fIread-word-abbrev-file\fP to read it back again (this command might be
2772 used in your \fB.joverc\fP file) .
2773 .LP
2774 If the variable \fIauto-case-abbrev\fP is \fIon\fP, and the abbreviations in the
2775 list are all in lower case (as in the \*Qjove\*U example above) then,
2776 whenever you type \*Qjove\*U you will get
2777 .DS
2778 jonathan's own version of EMACS
2779 .DE
2780 but if you type \*QJove\*U you will get
2781 .DS
2782 Jonathan's own version of EMACS
2783 .DE
2784 and if you type \*QJOVE\*U (with at least 2 upper case letters) you will get
2785 .DS
2786 Jonathan's Own Version Of EMACS
2787 .DE
2788 .LP
2789 On the other hand, if the variable \fIauto-case-abbrev\fP is \fIoff\fP (as it
2790 should be for the reserved word example) the case of the abbreviation is
2791 significant and must be matched exactly.
2792 .HH 1 "Macros"
2793 .TS
2794 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2795 ^X\ ( begin-kbd-macro Start recording your commands.
2796 ^X\ ) end-kbd-macro Stop recording your commands.
2797 ESC\ I make-macro-interactive Call for a parameter to be typed at this point.
2798 ^X\ E execute-kbd-macro Replay the recording.
2799 name-kbd-macro Name the recording.
2800 define-macro Define a named macro.
2801 execute-macro Execute a named macro.
2802 write-macros-to-file Write all named macros to a file.
2803 bind-macro-to-key Bind named macro to a key-sequence.
2804 bind-macro-to-word-abbrev Bind named macro to an abbrev.
2805 .TE
2806 .LP
2807 Although \s-2JOVE\s0 has many powerful commands,
2808 you often find that you have a task that no individual command can do.
2809 \s-2JOVE\s0 allows you to define your own commands from sequences
2810 of existing ones. The easiest way to do this is \*Qby example\*U.
2811 .HH 2 "Keyboard Macros"
2812 .LP
2813 First you type ^X\ ( (\fIbegin-kbd-macro\fP).
2814 Next you \*Qperform\*U the commands which will constitute the body of the
2815 macro (they are executed as well as being remembered).
2816 Then you type ^X\ ) (\fIend-kbd-macro\fP).
2817 You now have a \fIkeyboard macro\fP.
2818 .LP
2819 To run this command sequence again,
2820 type ^X\ E (\fIexecute-keyboard-macro\fP).
2821 .LP
2822 If your macro needs a parameter (a filename to be opened, perhaps), include
2823 the command needing the parameter (e.g. ^X\ ^F) at the appropriate place in
2824 the macro followed immediately by ESC\ I (\fImake-macro-interactive\fP).
2825 When the macro is executed, you will be given an opportunity to type in the
2826 actual-parameter at this point.
2827 .HH 2 "Named Macros"
2828 .LP
2829 You may give the keyboard macro a name using the
2830 \fIname-keyboard-macro\fP command (or you may create a named macro from
2831 scratch using the \fIdefine-macro\fP command).
2832 We're still not finished because all this hard work will be lost
2833 if you leave \s-2JOVE\s0.
2834 What you do next is to save your macros into a file
2835 with the \fIwrite-macros-to-file\fP command.
2836 To retrieve your macros in the next editing session,
2837 you can simply execute the \fIsource\fP command on that file, or include
2838 that file in your personal \fB.joverc\fP file.
2839 .LP
2840 A named macro can be executed by typing ESC\ X \fIexecute-macro\fP
2841 <macro-name><return>. It is unfortunate that macro names are kept in a
2842 different name space than command names, so that you cannot type ESC\ X
2843 <macro-name>. This may well be changed in a future release.
2844 .HH 2 Binding Macros to Keys
2845 .LP
2846 Finally, if you find all this bothersome to type and re-type,
2847 there is a way to bind the macro to a key.
2848 The binding is made with the \fIbind-macro-to-key\fP command, or
2849 alternatively the \fIbind-macro-to-word-abbrev\fP command (in which case the
2850 macro will be executed upon typing the abbrev word you have specified \(em
2851 it will get expanded as well unless it was an abbreviation for nothing).
2852 .HH 1 "Customizing Jove"
2853 .HH 2 "The jove.rc and .joverc files"
2854 .LP
2855 \s-2JOVE\s0 is aware of a directory, the \fIsharedir\fP, in which
2856 system-wide customization files are kept. Chief amongst these is the file
2857 \fBjove.rc\fP which is read each time \s-2JOVE\s0 is started up
2858 (\fBjove.rc\fP may then initiate the reading of other files in the sharedir,
2859 such as initialization files for specific terminals). After that,
2860 \s-2JOVE\s0 reads your personal \fB.joverc\fP in your $HOME directory, if
2861 you have one. And if all that is not enough, you may at any time read other
2862 customization files using the \fIsource\fP command.
2863 .LP
2864 The \s-2JOVE\s0 distribution comes with a recommended \fBjove.rc\fP file
2865 together with specific \fBjove.rc.TERM\fP files for various terminals. It is
2866 up to system administrators to decide whether to use these as they stand or
2867 to modify them to accord with local conventions. Note that these files are
2868 well commented and worthy of study by those who decide to \*Qroll their
2869 own\*U.
2870 .LP
2871 There are command-line options that can be used when \s-2JOVE\s0 is started
2872 to substitute a different \fIsharedir\fP or to suppress reading of the
2873 \fBjove.rc\fP or \fB.joverc\fP files or both \(em see the Man page for
2874 \s-2JOVE\s0. Thus everything is ultimately under the control of the
2875 individual \s-2JOVE\s0 user.
2876 .HH 2 "The source Command"
2877 .LP
2878 Type ESC\ X \fIsource\fP <filename><return> to read and obey the commands in
2879 <filename>. If a numeric argument is supplied to \fIsource\fP, it will
2880 silently ignore a request for a non-existent file (otherwise an error
2881 message will be produced). The format of the \fIsource\fPd file, as of the
2882 \fBjove.rc\fP and \fB.joverc\fP files, is as follows.
2883 .LP
2884 Each line consists of a command name (no need to precede it with ESC\ X)
2885 followed by whatever parameters that command requires. To give a numeric
2886 argument to the command, simply precede the command name by a number. Thus
2887 it is possible to to do anything that the user could do while \s-2JOVE\s0 is
2888 running.
2889 .LP
2890 .KS
2891 But there is more than this. You can say
2892 .RS
2893 \fIif\fP <shell-command>
2894 .RS
2895 <command>
2896 .br
2897 <command>
2898 .RE
2899 \fIelse\fP
2900 .RS
2901 <command>
2902 .br
2903 <command>
2904 .RE
2905 \fIendif\fP
2906 .RE
2907 .KE
2908 The <shell-command> is run, and if it succeeds the first lot of <command>s
2909 is obeyed, and otherwise the second lot (the \fIelse\fP part is optional).
2910 Another variant of this feature allows you to say, in place of \fIif\fP
2911 <shell-command>,
2912 \fIifenv\fP <environment-variable> <pattern>, which succeeds if
2913 <environment-variable> exists and if its value matches the regular
2914 expression <pattern> (an anchored match from the beginning
2915 of the variable value). There
2916 is a similar variant
2917 \fIifvar\fP <jove-variable> <pattern>, which succeeds if the specified
2918 \s-2JOVE\s0 variable exists and if its value matches <pattern>. These
2919 conditional commands can be nested in the usual way; also indentation and
2920 empty lines have no effect. Finally, any line
2921 that starts with a \*Q#\*U is treated as a comment and is ignored by \s-2JOVE\s0.
2922 .LP
2923 Here are some examples taken from the provided \fBjove.rc\fP.
2924 .KS
2925 .RS
2926 pushlibd
2927 .sp .5n
2928 # This is for the shell window. Supports sh, csh and ksh.
2929 .br
2930 set process-prompt ^[\^^%$#]\(**[%$#]
2931 .sp .5n
2932 # Modern terminals do not need ^S/\^^Q for flow control.
2933 .br
2934 # The exceptions (e.g. vt100) should turn it off again in jove.rc.TERM.
2935 .br
2936 set allow-^S-and-^Q on
2937 .sp .5n
2938 # source any TERMinal-specific rc file
2939 .br
2940 1 source jove.rc.$TERM
2941 .sp .5n
2942 popd
2943 .RE
2944 .KE
2945 .LP
2946 The \fIpushlibd\fP ensures that any files it tries to read will be taken
2947 from the \fIsharedir\fP (observe the matching \fIpopd\fP at the end). Then
2948 follow some settings of variables such as
2949 \fIprocess-prompt\fP (see the discussion of interactive processes earlier in
2950 this manual). Observe how environment variables such as $TERM are honored
2951 within parameters, and note how that \fIsource\fP command was given a
2952 numeric argument so that there would be no complaint if the file
2953 \fBjove.rc.$TERM\fP did not exist.
2954 .LP
2955 On the other hand, if \fBjove.rc.$TERM\fP does exist for the particular
2956 terminal specified in $TERM, that file will now be \fIsource\fPd. It will
2957 likely set many key bindings particular to that terminal, and then say
2958 .KS
2959 .RS
2960 define-macro keychart ^[xpushlibd\^^M
2961 .RS
2962 ^U\^^[Xshell-command-with-typeout cat keychart.$TERM\^^M
2963 .br
2964 ^[Xpopd\^^M
2965 .RE
2966 # except that should really have been all on one line
2967 .br
2968 bind-macro-to-key keychart ^[\^[\^\s+2~\s0
2969 .RE
2970 .KE
2971 .LP
2972 Quite some mouthful! What it does is to define a macro \fIkeychart\fP (the
2973 hard way) and bind it to ESC\ [\ \s+2~\s0. In general, any terminal for
2974 which extensive key bindings are provided ought to define this macro and
2975 bind it to a suitable key (preferably the one inscribed \*QHelp\*U). When
2976 this key is pressed, it will cause the file \fBkeychart.$TERM\fP to be
2977 displayed on the screen in \fItypeout\fP style. This file should exhibit a
2978 map of the terminal's keyboard, showing what has been bound to each key. The
2979 \fIsharedir\fP contains several such keychart files.
2980 .LP
2981 Although Control characters may be stored as themselves in these files (as
2982 produced by the \fIquoted-insert\fP command, for example), it is better to
2983 store them using an explicit \*Q\^^\^\*U (e.g. as ^C), since this form is
2984 accepted by the \fIsource\fP command, and editing files in this form is much
2985 easier.
2986 .HH 2 "Key Re-binding"
2987 .LP
2988 Many of the commands built into \s-2JOVE\s0 are not bound to
2989 specific keys. You must type ESC\ X <command-name>
2990 (\fIexecute-named-command\fP) in order to invoke these commands.
2991 Also, many of the keys to which commands \fIare\fP bound are hard to
2992 remember (although at least compatible across all terminals) whilst all sorts
2993 of interesting keys on the particular keyboard remain unused. For both these
2994 reasons, \s-2JOVE\s0 makes it possible to \fIbind\fP commands to keys.
2995 .TS
2996 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
2997 bind-to-key Bind a command to a key-sequence.
2998 bind-macro-to-key Bind a named macro to a key-sequence.
2999 bind-macro-to-word-abbrev Bind a named macro to an abbrev.
3000 bind-keymap-to-key Bind an extra key-sequence to a keymap.
3001 describe-bindings Exhibit all key bindings as a screen typeout.
3002
3003 local-bind-to-key T{
3004 As bind-to-key, for use in the selected buffer only.
3005 T}
3006 local-bind-macro-to-key T{
3007 As bind-macro-to-key, for use in the selected buffer only.
3008 T}
3009 local-bind-keymap-to-key T{
3010 As bind-keymap-to-key, for use in the selected buffer only.
3011 T}
3012
3013 process-bind-to-key T{
3014 Bind interactive process command to a key-sequence.
3015 T}
3016 process-bind-macro-to-key T{
3017 Bind a macro within interactive processes only.
3018 T}
3019 process-bind-keymap-to-key T{
3020 Bind a keymap within interactive processes only.
3021 T}
3022 .TE
3023 .LP
3024 Although these commands can be typed in by the user, they are mostly
3025 intended for use in \fIsource\fPd files. Here are some more examples from
3026 \fBjove.rc\fP.
3027 .KS
3028 .RS
3029 # if you have job control, this puts Jove out of the way temporarily.
3030 .br
3031 bind-to-key pause-jove ^[S
3032 .br
3033 bind-to-key pause-jove ^[s
3034 .sp .5n
3035 # The following apply to shell windows. Note the use of ^C\^^C, ^C\^^D etc.,
3036 .br
3037 process-bind-to-key interrupt-process ^C\^^C
3038 .br
3039 process-bind-to-key eof-process ^C\^^D
3040 .sp .5n
3041 # This makes the arrow keys work on most terminals.
3042 .br
3043 bind-to-key previous-line ^[[A
3044 .br
3045 bind-to-key next-line ^[[B
3046 .RE
3047 .KE
3048 .LP
3049 When a command is
3050 \fIbound\fP to a key any future hits on that key will invoke that command.
3051 All the printing characters are initially bound to the
3052 command \fIself-insert\fP.
3053 Thus, typing any printing character causes it to be inserted into the text.
3054 To unbind a key, simply bind it to the fictitious command \fIunbound\fP.
3055 .LP
3056 Observe how key-sequences are often derived from common prefixes, such as
3057 ^X\ ..., ESC\ ... (to be typed as ^[\ ... in binding commands) and
3058 ESC\ [\ ... (or ^[\ [\ ...). Internally, \s-2JOVE\s0 creates tables for each
3059 prefix encountered, but it cannot create a new prefix from a manually
3060 entered \fIbind-\fP command (it does not know when you have finished your
3061 binding). To overcome this, give the \fIbind-\fP command an argument and
3062 terminate it with a Return (this applies automatically within \fIsource\fPd
3063 files).
3064 Obviously, you must not have two bindings where one is a prefix of the other.
3065 .LP
3066 Very rarely, you may want two prefixes to be regarded as equivalent for all
3067 commands (for example, you have a keyboard with no ESC key, and it would be
3068 tedious to have to rebind every command in the system with a different
3069 prefix). In this case, you can type ESC\ X \fIbind-keymap-to-key\fP
3070 <named-keymap> <prefix-key-sequence>. The only recognized <named-keymap>s
3071 are \*QESC-map\*U and \*QCtlx-map\*U, and the customary replacement for ESC
3072 is \*Q`\*U.
3073 .LP
3074 For historical reasons, the Escape key is often referred to as \*QMeta\*U.
3075 Indeed, if your terminal has a Meta-key which forces the 8th-bit of a
3076 character, and if the variable \fImeta-key\fP is \fIon\fP, you may type Y whilst
3077 holding the Meta-key down to achieve the same effect as when typing ESC\ Y.
3078 .HH 3 "The Provided Terminal Bindings"
3079 .LP
3080 The terminals for which keybindings have been provided are a mixed bunch (we
3081 would welcome suggestions for other common terminals). However, there are
3082 certain principles which were followed in setting them up.
3083 .IP 1.
3084 Groupings of keys that are found in bindings for other terminals
3085 were adhered to so far as possible. Rather than saying that the F1 key
3086 always does so-and-so, groupings of Function Keys that are physically
3087 associated on the keyboard were mapped onto similar groupings on other
3088 keyboards, even though the engravings on them might be quite different.
3089 .IP 2
3090 Keys which do related things should be close together.
3091 .IP 3
3092 Keys which customarily do certain things under other editors normally
3093 used with that keyboard should do the same (or similar) things under
3094 \s-2JOVE\s0.
3095 .IP 4
3096 Keys which have suggestive engravings on them should do what the
3097 engravings suggest. Sometimes, this necessitated the creation of a macro
3098 where no \s-2JOVE\s0 command existed to do precisely that job (for example,
3099 the macro \fIkill-line\fP).
3100 .HH 2 "Auto-execution of Commands"
3101 .LP
3102 It is useful, when a file is recognized as being in a particular programming
3103 language, for the appropriate major mode and other relevant facilities to be
3104 set up automatically in any buffer into which such a file is read.
3105 .TS
3106 L2w(10)fR L2w(20)fI Lw(\n(Ww)fR .
3107 auto-execute-command T{
3108 Obey the given command for each filename matched by the given
3109 regular-expression.
3110 T}
3111 auto-execute-macro Obey the given macro likewise.
3112 .TE
3113 .LP
3114 Here is an example taken from \fBjove.rc\fP.
3115 .KS
3116 .RS
3117 # set various language modes.
3118 .br
3119 1 auto-execute-command c-mode .\(**\.[chy]$
3120 .br
3121 1 auto-execute-command lisp-mode .\(**\.l$\|.\(**\.lisp$\|.\(**\.scm$
3122 .br
3123 # all the languages need show-match-mode.
3124 .br
3125 1 auto-execute-command show-match-mode .\(**\.[lchyfp]$\|.\(**\.lisp$\|.\(**\.scm$
3126 .RE
3127 .KE
3128 .LP
3129 The effect of this is that whenever a filename matches the
3130 regular-expression \*Q.\(**\.[chy]$\*U the command \fIc-mode\fP is obeyed in
3131 the buffer into which the file is being read, and similarly for
3132 \fIlisp-mode\fP. An attempt is then made to set \fIshow-match-mode\fP for
3133 both C and Lisp programs. Observe that all the \fIauto-execute-command\fPs
3134 in this example have an argument of 1. This argument is passed on to the
3135 obeyed command so that, for example, it is ensured that \fIc-mode\fP is
3136 definitely set to be \fIon\fP, rather than merely being toggled.
3137 .HH 2 "Customizing the Mode Line"
3138 .LP
3139 The format of the mode line is controlled by the variable \fImode-line\fP.
3140 Here is a suggested setting.
3141 .DS
3142 %[Jove%]%w%w%c(%M)%3c[%b:%n]%2c"%f"%2c%m\(**-%m\(**-%2c%p%2s%(%d%e(%t)%)
3143 .DE
3144 .LP
3145 and here is what it all means.
3146 .IP %[\^...\^%] 12n
3147 Puts brackets around Jove when in a recursive edit.
3148 .IP %w%w
3149 Warns with >> if the window is scrolled left.
3150 .IP (%M)
3151 Gives the current major and minor modes.
3152 .IP [%b:%n]
3153 Shows the buffer name and number.
3154 .IP """%f"""
3155 Shows the filename.
3156 .IP %m\(**\-%m\(**\-
3157 Displays \(**\(** if the buffer is modified, \-\- if not.
3158 .IP %p
3159 In process windows only, shows the status of the process.
3160 .IP %d
3161 Shows the current directory.
3162 .IP (%t)
3163 Shows the time of day.
3164 .LP
3165 Everything else is layout. See the full description of the \fImode-line\fP
3166 variable for further details.
3167 .HH 1 "Xjove and Xterm"
3168 .LP
3169 If you run \s-2JOVE\s0 on a workstation equipped with the X-Windows system
3170 from M.I.T., then it is advised to run \s-2JOVE\s0 under one of the terminal
3171 emulators \fIxjove\fP or \fIxterm\fP. \fIXterm\fP is provided as a standard
3172 part of the X-Windows system, but the facilities provided are a small subset
3173 of those available with \fIxjove\fP, which was written especially to support
3174 \s-2JOVE\s0. However, \fIxjove\fP suffers from the disadvantage that it must
3175 be compiled under the XView Toolkit which, although available free from
3176 M.I.T., may not be available on your system. Note that, in either case,
3177 special keybindings must be provided (see the files \fBjove.rc.sun-cmd\fP and
3178 \fBjove.rc.xterm\fP). See the Man page for \fIxjove\fP for how to call it
3179 and the flags and options available.
3180 .HH 2 "Basic Mouse Operations"
3181 .LP
3182 When running under \fIxjove\fP or \fIxterm\fP you may click the LEFT
3183 mouse button in order to set the position of point, and the MIDDLE mouse
3184 button to set the position of point and mark. If you hold the MIDDLE button
3185 down, you may sweep it along, leaving mark where you started and point where
3186 you finished, thus defining the region. If you hold the Control key down
3187 while you are doing this, the region is copied to the kill ring, as with the
3188 \fIcopy-region\fP command, and if you hold both the Control and Shift keys
3189 down, the region is killed (and sent to the kill ring) as with the
3190 \fIkill-region\fP command. To have the killed text yanked at some other
3191 point, click the LEFT mouse button there, holding the Control key down at
3192 the same time.
3193 .LP
3194 To switch to a different window, simply click either button in the window
3195 you want to be in (note that this does not affect point or mark in that
3196 window \(em it takes two clicks to change windows and then change point).
3197 .LP
3198 To scroll rapidly to a different part of the buffer, simply click either
3199 mouse button in the mode line at a position corresponding to the percentage
3200 way down the file you want to be. It helps to have set the variable
3201 \fIscroll-bar\fP \fIon\fP so that you can see by the uninverted part of the
3202 mode line which part of the buffer is currently visible in the window. When
3203 you have finished, the mouse pointer should be exactly in the middle of the
3204 uninverted region.
3205 .HH 2 "Additional Xjove Features"
3206 .LP
3207 When running under \fIxjove\fP there are some additional facilities.
3208 Firstly, the setting when pointing into the mode line is more sensitive,
3209 because it notes the mouse position to the nearest pixel instead of the
3210 nearest character, and it is possible to hold the mouse button down and
3211 watch the window scrolling as you drag it (although this can consume
3212 considerable machine resources and it may have difficulty in keeping up). Also,
3213 it is possible to follow the position of point in real time as you drag the
3214 mouse around when delineating a region.
3215 .LP
3216 If you do a double click with the MIDDLE button in \fIxjove\fP, it will set
3217 the region spanning the word you were over (or spanning the gap if you were
3218 between words). Note that the definition of \*Qword\*U here follows the
3219 major mode. If you do a triple click, it will likewise select the whole
3220 line. These operations may be combined with the Control key, or the Control
3221 and Shift keys together, to obtain copying and killing as before.
3222 .LP
3223 If your keyboard has keys marked Paste and Cut, it
3224 is possible to bring text from another part of the buffer (even from a
3225 different window) without changing the position of point (this is useful if
3226 you are constructing text at some point, bringing in fragments from other
3227 places \(em you would prefer not to have to keep moving point to those other
3228 places to acquire some text for the kill ring, only to have to move it back
3229 again before yanking). To do this, with point where you want the text to be
3230 inserted, you hold the Paste key down while you select a region with the
3231 MIDDLE button (multi-clicking or dragging as usual). When you have finished,
3232 a copy of the region you selected will appear at point, with point moved
3233 beyond it (since it went via the kill ring, this text is also available for
3234 conventional yanking subsequently). If you change your mind in mid
3235 stream, let go of Paste before releasing MIDDLE. Likewise, if you do the
3236 same thing holding the Cut key down, the text will also be killed from its
3237 original position.
3238 .LP
3239 Finally, if you press the RIGHT mouse button, you will be offered a menu
3240 which enables you to issue any \s-2JOVE\s0 command or set any \s-2JOVE\s0
3241 variable. Particularly useful if you need some obscure and rarely used
3242 command, and cannot remember exactly what it is called.
3243 .HH 1 "Recovering from system/editor crashes"
3244 .LP
3245 \s-2JOVE\s0 does not have an \fIAuto Save\fP mode, but it does provide a way
3246 to recover your work in the event of a system or editor crash. \s-2JOVE\s0
3247 saves information about the files you are editing every \fIsync-frequency\fP
3248 changes to a special buffer, so as to make recovery possible. Since a
3249 relatively small amount of information is involved it is hardly even
3250 noticeable when
3251 \s-2JOVE\s0 does this. The variable \fIsync-frequency\fP says how often to
3252 save the necessary information, and the default is every 50 changes. 50 is
3253 a very reasonable number: if you are writing a paper you will not lose more
3254 than the last 50 characters you typed, which is less than the average length
3255 of a line.
3256 .LP
3257 If \s-2JOVE\s0, or the operating system, crashes, you may now use the
3258 \s-2JOVE\s0 \fIrecover\fP program to get back your files. You invoke this by
3259 running \s-2JOVE\s0 with the -r flag. See the Man page for \s-2JOVE\s0 for
3260 further details.
3261 .LP
3262 Another worthwhile precaution you can take is to set the variable
3263 \fImake-backup-files\fP \fIon\fP. Then, whenever you save a file with
3264 \fIsave-file\fP it will leave behind the original version of that file with
3265 the name \*Q#\fIfilename\fP\s+2~\s0\*U.
3266 .bp
3267 .HH 1 "Alphabetical List of Commands and Variables"
3268 .LP
3269 In this chapter, the standard binding is shown for each command which has
3270 one. Generally, these are the built-in bindings, but occasionally they are
3271 ones taken from the provided \fBjove.rc\fP file.