home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / jove-4.16-src.tgz / tar.out / bsd / jove / doc / intro.nr < prev    next >
Text File  |  1996-09-28  |  138KB  |  3,254 lines

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