comparison lisp/=tpu-doc.el @ 4421:95bb7e28d761

Initial revision
author Richard M. Stallman <rms@gnu.org>
date Mon, 02 Aug 1993 19:11:20 +0000
parents
children 325bc5407213
comparison
equal deleted inserted replaced
4420:8113d9ba472e 4421:95bb7e28d761
1 ;;; tpu-doc.el --- Documentation for TPU-edt
2
3 ;; Copyright (C) 1993 Free Software Foundation, Inc.
4
5 ;; Author: Rob Riepel <riepel@networking.stanford.edu>
6 ;; Maintainer: Rob Riepel <riepel@networking.stanford.edu>
7 ;; Keywords: tpu-edt
8
9 ;; GNU Emacs is distributed in the hope that it will be useful,
10 ;; but WITHOUT ANY WARRANTY. No author or distributor
11 ;; accepts responsibility to anyone for the consequences of using it
12 ;; or for whether it serves any particular purpose or works at all,
13 ;; unless he says so in writing. Refer to the GNU Emacs General Public
14 ;; License for full details.
15
16 ;; Everyone is granted permission to copy, modify and redistribute
17 ;; GNU Emacs, but only under the conditions described in the
18 ;; GNU Emacs General Public License. A copy of this license is
19 ;; supposed to have been given to you along with GNU Emacs so you
20 ;; can know your rights and responsibilities. It should be in a
21 ;; file named COPYING. Among other things, the copyright notice
22 ;; and this notice must be preserved on all copies.
23 ;;
24
25 ;;; Revision: $Id: tpu-doc.el,v 3.2 1993/08/01 21:36:48 riepel Exp $
26 (defconst tpu-doc-revision "$Revision: 3.2 $"
27 "TPU-edt documentation revision number.")
28
29
30 ;; This is documentation for the TPU-edt editor for GNU emacs. Major
31 ;; sections of this document are separated with lines that begin with
32 ;; ";; %% <topic>", where <topic> is what is discussed in that section.
33
34
35 ;; %% Contents
36
37 ;; % Introduction
38 ;; % Terminal Support
39 ;; % X-windows Support
40 ;; % Differences Between TPU-edt and the Real Thing
41 ;; % Starting TPU-edt
42 ;; % TPU-edt Default Editing Keypad, Control and Gold Key Bindings
43 ;; % Optional TPU-edt Extensions
44 ;; % Customizing TPU-edt using the Emacs Initialization File
45 ;; % Compiling TPU-edt
46 ;; % Regular expressions in TPU-edt
47 ;; % Etcetera
48
49
50 ;; %% Introduction
51
52 ;; TPU-edt is based on tpu.el by Jeff Kowalski. TPU-edt endeavors
53 ;; to be even more like TPU's EDT emulation than the original tpu.el.
54 ;; Considerable effort has been expended to that end. Still, emacs
55 ;; is emacs and there are differences between TPU-edt and the real
56 ;; thing. Please read the "Differences Between TPU-edt and the Real
57 ;; Thing" and "Starting TPU-edt" sections before running TPU-edt.
58
59
60 ;; %% Terminal Support
61
62 ;; TPU-edt, like it's VMS cousin, works on VT-series terminals with
63 ;; DEC style keyboards. VT terminal emulators, including xterm with
64 ;; the appropriate key translations, work just fine too.
65
66
67 ;; %% X-windows Support
68
69 ;; Starting with version 19 of emacs, TPU-edt works with X-windows.
70 ;; This is accomplished through a TPU-edt X keymap. The emacs lisp
71 ;; program tpu-mapper.el creates this map and stores it in a file.
72 ;; Tpu-mapper will be run automatically the first time you invoke
73 ;; the X-windows version of emacs, or you can run it by hand. See
74 ;; the commentary in tpu-mapper.el for details.
75
76
77 ;; %% Differences Between TPU-edt and the Real Thing (not Coke (r))
78
79 ;; Emacs (version 18.58) doesn't support text highlighting, so selected
80 ;; regions are not shown in inverse video. Emacs uses the concept of
81 ;; "the mark". The mark is set at one end of a selected region; the
82 ;; cursor is at the other. The letter "M" appears in the mode line
83 ;; when the mark is set. The native emacs command ^X^X (Control-X
84 ;; twice) exchanges the cursor with the mark; this provides a handy
85 ;; way to find the location of the mark.
86
87 ;; In TPU the cursor can be either bound or free. Bound means the
88 ;; cursor cannot wander outside the text of the file being edited.
89 ;; Free means the arrow keys can move the cursor past the ends of
90 ;; lines. Free is the default mode in TPU; bound is the only mode
91 ;; in EDT. Bound is the only mode in the base version of TPU-edt;
92 ;; optional extensions add an approximation of free mode.
93
94 ;; Like TPU, emacs uses multiple buffers. Some buffers are used to
95 ;; hold files you are editing; other "internal" buffers are used for
96 ;; emacs' own purposes (like showing you help). Here are some commands
97 ;; for dealing with buffers.
98
99 ;; Gold-B moves to next buffer, including internal buffers
100 ;; Gold-N moves to next buffer containing a file
101 ;; Gold-M brings up a buffer menu (like TPU "show buffers")
102
103 ;; Emacs is very fond of throwing up new windows. Dealing with all
104 ;; these windows can be a little confusing at first, so here are a few
105 ;; commands to that may help:
106
107 ;; Gold-Next_Scr moves to the next window on the screen
108 ;; Gold-Prev_Scr moves to the previous window on the screen
109 ;; Gold-TAB also moves to the next window on the screen
110
111 ;; Control-x 1 deletes all but the current window
112 ;; Control-x 0 deletes the current window
113
114 ;; Note that the buffers associated with deleted windows still exist!
115
116 ;; Like TPU, TPU-edt has a "command" function, invoked with Gold-KP7 or
117 ;; Do. Most of the commands available are emacs commands. Some TPU
118 ;; commands are available, they are: replace, exit, quit, include, and
119 ;; Get (unfortunately, "get" is an internal emacs function, so we are
120 ;; stuck with "Get" - to make life easier, Get is available as Gold-g).
121
122 ;; Support for recall of commands, file names, and search strings was
123 ;; added to emacs in version 19. For version 18 of emacs, optional
124 ;; extensions are available to add this recall capability (see "Optional
125 ;; TPU-edt Extensions" below). The history of strings recalled in both
126 ;; versions of emacs differs slightly from TPU/edt, but it is still very
127 ;; convenient.
128
129 ;; Help is available! The traditional help keys (Help and PF2) display
130 ;; a three page help file showing the default keypad layout, control key
131 ;; functions, and Gold key functions. Pressing any key inside of help
132 ;; splits the screen and prints a description of the function of the
133 ;; pressed key. Gold-PF2 invokes the native emacs help, with it's
134 ;; zillions of options. Gold-Help shows all the current key bindings.
135
136 ;; Thanks to emacs, TPU-edt has some extensions that may make your life
137 ;; easier, or at least more interesting. For example, Gold-r toggles
138 ;; TPU-edt rectangular mode. In rectangular mode, Remove and Insert work
139 ;; on rectangles. Likewise, Gold-* toggles TPU-edt regular expression
140 ;; mode. In regular expression mode Find, Find Next, and the line-mode
141 ;; replace command work with regular expressions. [A regular expression
142 ;; is a pattern that denotes a set of strings; like VMS wildcards.]
143
144 ;; Emacs also gives TPU-edt the undo and occur functions. Undo does
145 ;; what it says; it undoes the last change. Multiple undos in a row
146 ;; undo multiple changes. For your convenience, undo is available on
147 ;; Gold-u. Occur shows all the lines containing a specific string in
148 ;; another window. Moving to that window, and typing ^C^C (Control-C
149 ;; twice) on a particular line moves you back to the original window
150 ;; at that line. Occur is on Gold-o.
151
152 ;; Finally, as you edit, remember that all the power of emacs is at
153 ;; your disposal. It really is a fantastic tool. You may even want to
154 ;; take some time and read the emacs tutorial; perhaps not to learn the
155 ;; native emacs key bindings, but to get a feel for all the things
156 ;; emacs can do for you. The emacs tutorial is available from the
157 ;; emacs help function: "Gold-PF2 t"
158
159
160 ;; %% Starting TPU-edt
161
162 ;; In order to use TPU-edt, the TPU-edt editor definitions, contained
163 ;; in tpu-edt.el, need to be loaded when emacs is run. This can be
164 ;; done in a couple of ways. The first is by explicitly requesting
165 ;; loading of the TPU-edt emacs definition file on the command line:
166
167 ;; prompt> emacs -l /path/to/definitions/tpu-edt.el
168
169 ;; If TPU-edt is installed on your system, that is, if tpu-edt.el is in
170 ;; a directory like /usr/local/emacs/lisp, along with dozens of other
171 ;; .el files, you should be able to use the command:
172
173 ;; prompt> emacs -l tpu-edt
174
175 ;; If you like TPU-edt and want to use it all the time, you can load
176 ;; the TPU-edt definitions using the emacs initialization file, .emacs.
177 ;; Simply create a .emacs file in your home directory containing the
178 ;; line:
179
180 ;; (load "/path/to/definitions/tpu-edt")
181
182 ;; or, if (as above) TPU-edt is installed on your system:
183
184 ;; (load "tpu-edt")
185
186 ;; Once TPU-edt has been loaded, you will be using an editor with the
187 ;; interface shown in the next section (A section that is suitable for
188 ;; cutting out of this document and pasting next to your terminal!).
189
190
191 ;; %% TPU-edt Default Editing Keypad, Control and Gold Key Bindings
192 ;;
193 ;; _______________________ _______________________________
194 ;; | HELP | Do | | | | | |
195 ;; |KeyDefs| | | | | | |
196 ;; |_______|_______________| |_______|_______|_______|_______|
197 ;; _______________________ _______________________________
198 ;; | Find |Insert |Remove | | Gold | HELP |FndNxt | Del L |
199 ;; | | |Sto Tex| | key |E-Help | Find |Undel L|
200 ;; |_______|_______|_______| |_______|_______|_______|_______|
201 ;; |Select |Pre Scr|Nex Scr| | Page | Sect |Append | Del W |
202 ;; | Reset |Pre Win|Nex Win| | Do | Fill |Replace|Undel W|
203 ;; |_______|_______|_______| |_______|_______|_______|_______|
204 ;; |Move up| |Forward|Reverse|Remove | Del C |
205 ;; | Top | |Bottom | Top |Insert |Undel C|
206 ;; _______|_______|_______ |_______|_______|_______|_______|
207 ;; |Mov Lef|Mov Dow|Mov Rig| | Word | EOL | Char | |
208 ;; |StaOfLi|Bottom |EndOfLi| |ChngCas|Del EOL|SpecIns| Enter |
209 ;; |_______|_______|_______| |_______|_______|_______| |
210 ;; | Line |Select | Subs |
211 ;; | Open Line | Reset | |
212 ;; |_______________|_______|_______|
213 ;; Control Characters
214 ;;
215 ;; ^A toggle insert and overwrite ^L insert page break
216 ;; ^B recall ^R remember, re-center
217 ;; ^E end of line ^U delete to beginning of line
218 ;; ^G cancel current operation ^V quote
219 ;; ^H beginning of line ^W refresh
220 ;; ^J delete previous word ^Z exit
221 ;; ^K learn ^X^X exchange point and mark
222 ;;
223 ;;
224 ;; Gold-<key> Functions
225 ;; -----------------------------------------------------------------
226 ;; W Write - save current buffer
227 ;; K Kill buffer - abandon edits and delete buffer
228 ;;
229 ;; E Exit - save current buffer and ask about others
230 ;; X eXit - save all modified buffers and exit
231 ;; Q Quit - exit without saving anything
232 ;;
233 ;; G Get - load a file into a new edit buffer
234 ;; I Include - include a file in this buffer
235 ;;
236 ;; B next Buffer - display the next buffer (all buffers)
237 ;; N Next file buffer - display next buffer containing a file
238 ;; M buffer Menu - display a list of all buffers
239 ;;
240 ;; U Undo - undo the last edit
241 ;; C Recall - edit and possibly repeat previous commands
242 ;;
243 ;; O Occur - show following lines containing REGEXP
244 ;; S Search and substitute - line mode REPLACE command
245 ;;
246 ;; ? Spell check - check spelling in a region or entire buffer
247 ;;
248 ;; R Toggle Rectangular mode for remove and insert
249 ;; * Toggle regular expression mode for search and substitute
250 ;;
251 ;; V Show TPU-edt version
252 ;; -----------------------------------------------------------------
253
254
255 ;; %% Optional TPU-edt Extensions
256
257 ;; Several optional packages have been included in this distribution
258 ;; of TPU-edt. The following is a brief description of each package.
259 ;; See the {package}.el file for more detailed information and usage
260 ;; instructions.
261
262 ;; tpu-extras - TPU/edt scroll margins and free cursor mode.
263 ;; tpu-recall - String, file name, and command history.
264 ;; vt-control - VTxxx terminal width and keypad controls.
265
266 ;; Packages are normally loaded from the emacs initialization file
267 ;; (discussed below). If a package is not installed in the emacs
268 ;; lisp directory, it can be loaded by specifying the complete path
269 ;; to the package file. However, it is preferable to modify the
270 ;; emacs load-path variable to include the directory where packages
271 ;; are stored. This way, packages can be loaded by name, just as if
272 ;; they were installed. The first part of the sample .emacs file
273 ;; below shows how to make such a modification.
274
275
276 ;; %% Customizing TPU-edt using the Emacs Initialization File
277
278 ;; .emacs - a sample emacs initialization file
279
280 ;; This is a sample emacs initialization file. It shows how to invoke
281 ;; TPU-edt, and how to customize it.
282
283 ;; The load-path is where emacs looks for files to fulfill load requests.
284 ;; If TPU-edt is not installed in a standard emacs directory, the load-path
285 ;; should be updated to include the directory where the TPU-edt files are
286 ;; stored. Modify and un-comment the following section if TPU-ed is not
287 ;; installed on your system - be sure to leave the double quotes!
288
289 ;; (setq load-path
290 ;; (append (list (expand-file-name "/path/to/tpu-edt/files"))
291 ;; load-path))
292
293 ;; Load TPU-edt
294 (load "tpu-edt")
295
296 ;; Load the optional goodies - scroll margins, free cursor mode, command
297 ;; and string recall. But don't complain if the file aren't available.
298 (load "tpu-extras" t)
299 (load "tpu-recall" t)
300
301 ;; Uncomment this line to set scroll margins 10% (top) and 15% (bottom).
302 ;(tpu-set-scroll-margins "10%" "15%")
303
304 ;; Load the vtxxx terminal control functions, but don't complain if
305 ;; if the file is not found.
306 (load "vt-control" t)
307
308 ;; TPU-edt treats words like EDT; here's how to add word separators.
309 ;; Note that backslash (\) and double quote (") are quoted with '\'.
310 (tpu-add-word-separators "]\\[-_,.\"=+()'/*#:!&;$")
311
312 ;; Emacs is happy to save files without a final newline; other Unix programs
313 ;; hate that! This line will make sure that files end with newlines.
314 (setq require-final-newline t)
315
316 ;; Emacs has the ability to automatically run code embedded in files
317 ;; you edit. This line makes emacs ask if you want to run the code.
318 (setq inhibit-local-variables t)
319
320 ;; Emacs uses Control-s and Control-q. Problems can occur when using emacs
321 ;; on terminals that use these codes for flow control (Xon/Xoff flow control).
322 ;; These lines disable emacs' use of these characters.
323 (global-unset-key "\C-s")
324 (global-unset-key "\C-q")
325
326 ;; top, bottom, bol, eol seem like a waste of Gold-arrow functions. The
327 ;; following section re-maps up and down arrow keys to top and bottom of
328 ;; screen, and left and right arrow keys to pan left and right (pan-left,
329 ;; right moves the screen 16 characters left or right - try it, you'll
330 ;; like it!).
331
332 ;; Re-map the Gold-arrow functions
333 (define-key GOLD-CSI-map "A" 'tpu-beginning-of-window) ; up-arrow
334 (define-key GOLD-CSI-map "B" 'tpu-end-of-window) ; down-arrow
335 (define-key GOLD-CSI-map "C" 'tpu-pan-right) ; right-arrow
336 (define-key GOLD-CSI-map "D" 'tpu-pan-left) ; left-arrow
337 (define-key GOLD-SS3-map "A" 'tpu-beginning-of-window) ; up-arrow
338 (define-key GOLD-SS3-map "B" 'tpu-end-of-window) ; down-arrow
339 (define-key GOLD-SS3-map "C" 'tpu-pan-right) ; right-arrow
340 (define-key GOLD-SS3-map "D" 'tpu-pan-left) ; left-arrow
341
342 ;; Re-map the Gold-arrow functions for X-windows TPU-edt (emacs version 19)
343 (cond
344 ((and tpu-emacs19-p window-system)
345 (define-key GOLD-map [up] 'tpu-beginning-of-window) ; up-arrow
346 (define-key GOLD-map [down] 'tpu-end-of-window) ; down-arrow
347 (define-key GOLD-map [right] 'tpu-pan-right) ; right-arrow
348 (define-key GOLD-map [left] 'tpu-pan-left))) ; left-arrow
349
350 ;; The emacs universal-argument function is very useful for native emacs
351 ;; commands. This line maps universal-argument to Gold-PF1
352 (define-key GOLD-SS3-map "P" 'universal-argument) ; Gold-PF1
353
354 ;; Make KP7 move by paragraphs, instead of pages.
355 (define-key SS3-map "w" 'tpu-paragraph) ; KP7
356
357 ;; TPU-edt assumes you have the ispell spelling checker;
358 ;; Un-comment this line if you don't.
359 ;(setq tpu-have-spell nil)
360
361 ;; Display the TPU-edt version.
362 (tpu-version)
363
364 ;; End of .emacs - a sample emacs initialization file
365
366 ;; After initialization with the .emacs file shown above, the editing
367 ;; keys have been re-mapped to look like this:
368
369 ;; _______________________ _______________________________
370 ;; | HELP | Do | | | | | |
371 ;; |KeyDefs| | | | | | |
372 ;; |_______|_______________| |_______|_______|_______|_______|
373 ;; _______________________ _______________________________
374 ;; | Find |Insert |Remove | | Gold | HELP |FndNxt | Del L |
375 ;; | | |Sto Tex| | U Arg |E-Help | Find |Undel L|
376 ;; |_______|_______|_______| |_______|_______|_______|_______|
377 ;; |Select |Pre Scr|Nex Scr| |Paragra| Sect |Append | Del W |
378 ;; | Reset |Pre Win|Nex Win| | Do | Fill |Replace|Undel W|
379 ;; |_______|_______|_______| |_______|_______|_______|_______|
380 ;; |Move up| |Forward|Reverse|Remove | Del C |
381 ;; |Tscreen| |Bottom | Top |Insert |Undel C|
382 ;; _______|_______|_______ |_______|_______|_______|_______|
383 ;; |Mov Lef|Mov Dow|Mov Rig| | Word | EOL | Char | |
384 ;; |PanLeft|Bscreen|PanRigh| |ChngCas|Del EOL|SpecIns| Enter |
385 ;; |_______|_______|_______| |_______|_______|_______| |
386 ;; | Line |Select | Subs |
387 ;; | Open Line | Reset | |
388 ;; |_______________|_______|_______|
389
390 ;; Astute emacs hackers will realize that on systems where TPU-edt is
391 ;; installed, this documentation file can be loaded to produce the above
392 ;; editing keypad layout. In fact, to get all the changes in the sample
393 ;; initialization file, you only need a one line initialization file:
394
395 ;; (load "tpu-doc")
396
397 ;; wow!
398
399
400 ;; %% Compiling TPU-edt
401
402 ;; It is not necessary to compile (byte-compile in emacs parlance)
403 ;; TPU-edt to use it. However, byte-compiled code loads and runs
404 ;; faster, and takes up less memory when loaded. To byte compile
405 ;; TPU-edt, use the following command.
406
407 ;; emacs -batch -f batch-byte-compile tpu-edt.el
408
409 ;; This will produce a file named tpu-edt.elc. This new file can be
410 ;; used in place of the original tpu-edt.el file. In commands where
411 ;; the file type is not specified, emacs always attempts to use the
412 ;; byte-compiled version before resorting to the source.
413
414
415 ;; %% Regular expressions in TPU-edt
416
417 ;; Gold-* toggles TPU-edt regular expression mode. In regular expression
418 ;; mode, find, find next, replace, and substitute accept emacs regular
419 ;; expressions. A complete list of emacs regular expressions can be
420 ;; found using the emacs "info" command (it's somewhat like the VMS help
421 ;; command). Try the following sequence of commands:
422
423 ;; DO info <enter info mode>
424 ;; m regex <select the "regular expression" topic>
425 ;; m directives <select the "directives" topic>
426
427 ;; Type "q" to quit out of info mode.
428
429 ;; There is a problem in regular expression mode when searching for
430 ;; empty strings, like beginning-of-line (^) and end-of-line ($).
431 ;; When searching for these strings, find-next may find the current
432 ;; string, instead of the next one. This can cause global replace and
433 ;; substitute commands to loop forever in the same location. For this
434 ;; reason, commands like
435
436 ;; replace "^" "> " <add "> " to beginning of line>
437 ;; replace "$" "00711" <add "00711" to end of line>
438
439 ;; may not work properly.
440
441 ;; Commands like those above are very useful for adding text to the
442 ;; beginning or end of lines. They might work on a line-by-line basis,
443 ;; but go into an infinite loop if the "all" response is specified. If
444 ;; the goal is to add a string to the beginning or end of a particular
445 ;; set of lines TPU-edt provides functions to do this.
446
447 ;; Gold-^ Add a string at BOL in region or buffer
448 ;; Gold-$ Add a string at EOL in region or buffer
449
450 ;; There is also a TPU-edt interface to the native emacs string
451 ;; replacement commands. Gold-/ invokes this command. It accepts
452 ;; regular expressions if TPU-edt is in regular expression mode. Given
453 ;; a repeat count, it will perform the replacement without prompting
454 ;; for confirmation.
455
456 ;; This command replaces empty strings correctly, however, it has its
457 ;; drawbacks. As a native emacs command, it has a different interface
458 ;; than the emulated TPU commands. Also, it works only in the forward
459 ;; direction, regardless of the current TPU-edt direction.
460
461
462 ;; %% Etcetera
463
464 ;; That's TPU-edt in a nutshell...
465
466 ;; Please send any bug reports, feature requests, or cookies to the
467 ;; author, Rob Riepel, at the address shown by the tpu-version command
468 ;; (Gold-V).
469
470 ;; Share and enjoy... Rob Riepel 7/93
471
472 ;;; tpu-doc.el ends here