(ielm-dynamic-return, inferior-emacs-lisp-mode): Fix spellings in docstrings.
[bpt/emacs.git] / etc / edt-user.doc
1 File: edt-user.doc --- EDT Emulation User Instructions
2
3 For GNU Emacs 19
4
5 Copyright (C) 1986, 1992, 1994, 1995, 1999, 2000 Free Software Foundation, Inc.
6
7 Author: Kevin Gallagher <kevingal@onramp.net>
8 Maintainer: Kevin Gallagher <kevingal@onramp.net>
9 Keywords: emulations
10
11 This file is part of GNU Emacs.
12
13 GNU Emacs is free software; you can redistribute it and/or modify it under the
14 terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2, or (at your option) any later version.
16
17 GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY
18 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
19 PARTICULAR PURPOSE. See the GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License along with
22 GNU Emacs; see the file COPYING. If not, write to the Free Software
23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
25 ============================================================================
26 \f
27 I. OVERVIEW:
28
29 This is Version 4.0 of the EDT Emulation for Emacs 19 and above.
30 It comes with special functions which replicate nearly all of EDT's
31 keypad mode behavior. It sets up default keypad and function key
32 bindings which closely match those found in EDT. Support is
33 provided so that users may reconfigure most keypad and function key
34 bindings to their own liking.
35
36 NOTE: Version 4.0 contains several enhancements. See the
37 Enhancements section below for the details.
38
39
40 Quick Start:
41
42 To start the EDT Emulation, first start Emacs and then enter
43
44 M-x edt-emulation-on
45
46 to begin the emulation. After initialization is complete, the
47 following message will appear below the status line informing you
48 that the emulation has been enabled: "Default EDT keymap active".
49
50 You can have the EDT Emulation start up automatically, each time
51 you initiate a GNU Emacs session, by adding the following line to
52 your .emacs file:
53
54 (add-hook term-setup-hook 'edt-emulation-on)
55
56 IMPORTANT: Be sure to read the rest of this file. It contains very
57 useful information on how the EDT Emulation behaves and how
58 to customize it to your liking.
59
60 The EDT emulation consists of the following files:
61
62 edt-user.doc - User Instructions and Sample Customization File
63 edt.el - EDT Emulation Functions and Default Configuration
64 edt-lk201.el - Built-in support for DEC LK-201 Keyboards
65 edt-vt100.el - Built-in support for DEC VT-100 (and above) terminals
66 edt-pc.el - Built-in support for PC 101 Keyboards under MS-DOS
67 edt-mapper.el - Create an EDT LK-201 Map File for Keyboards Without
68 Built-in Support
69
70 Enhancements:
71
72 Version 4.0 contains the following enhancements:
73
74 1. Scroll margins at the top and bottom of the window are now
75 supported. (The design was copied from tpu-extras.el.) By
76 default, this feature is enabled with the top margin set to
77 10% of the window and the bottom margin set to 15% of the
78 window. To change these settings, you can invoke the function
79 edt-set-scroll-margins in your .emacs file. For example, the
80 following line
81
82 (edt-set-scroll-margins "20%" "25%")
83
84 sets the top margin to 20% of the window and the bottom margin
85 to 25% of the window. To disable this feature, set each
86 margin to 0%. You can also invoke edt-set-scroll-margins
87 interactively while EDT Emulation is active to change the
88 settings for that session.
89
90 NOTE: Another way to set the scroll margins is to use the
91 Emacs customization feature (not available in Emacs 19) to set
92 the following two variables directly:
93
94 edt-top-scroll-margin and edt-bottom-scroll-margin
95
96 Enter the Emacs `customize' command. First select the Editing
97 group and then select the Emulations group. Finally, select
98 the Edt group and follow the directions.
99
100 2. The SUBS command is now supported and bound to GOLD-Enter by
101 default. (This design was copied from tpu-edt.el.) Note, in
102 earlier versions of EDT Emulation, GOLD-Enter was assigned to
103 the Emacs function `query-replace'. The binding of
104 `query-replace' has been moved to GOLD-/. If you prefer to
105 restore `query-replace' to GOLD-Enter, then use an EDT user
106 customization file, edt-user.el, to do this. See edt-user.doc
107 for details.
108
109 3. EDT Emulation now also works in XEmacs, including the
110 highlighting of selected text.
111
112 4. If you access a workstation using an X Server, observe that
113 the initialization file generated by edt-mapper.el will now
114 contain the name of the X Server vendor. This is a
115 convenience for those who have access to their Unix account
116 from more than one type of X Server. Since different X
117 Servers typically require different EDT emulation
118 initialization files, edt-mapper.el will now generate these
119 different initialization files and save them with different
120 names. Then, the correct initialization file for the
121 particular X server in use is loaded correctly automatically.
122
123 5. Also, edt-mapper.el is now capable of binding an ASCII key
124 sequence, providing the ASCII key sequence prefix is already
125 known by Emacs to be a prefix. As a result of providing this
126 support, some terminal/keyboard/window system configurations,
127 which don't have a complete set of sensible function key
128 bindings built into Emacs in `function-key-map', can still be
129 configured for use with EDT Emulation. (Note: In a few rare
130 circumstances this does not work properly. In particular, it
131 does not work if a subset of the leading ASCII characters in a
132 key sequence are recognized by Emacs as having an existing
133 binding. For example, if the keypad 7 (KP-7) key generates
134 the sequence \"<ESC>Ow\" and \"<ESC>O\" is already bound to a
135 function, pressing KP-7 when told to do so by edt-mapper.el
136 will result in edt-mapper.el incorrectly mapping \"<ESC>O\" to
137 KP-7 and \"w\" to KP-8. If something like this happens to
138 you, it is probably a bug in the support for your keyboard
139 within Emacs OR a bug in the Unix termcap/terminfo support for
140 your terminal OR a bug in the terminal emulation software you
141 are using.)
142
143 6. The edt-quit function (bound to GOLD-q by default) has been
144 modified to warn the user when file-related buffer
145 modifications exist. It now cautions the user that those
146 modifications will be lost if the user quits without saving
147 those buffers.
148
149
150 Goals:
151
152 1. Emulate EDT Keypad Mode commands closely so that current EDT users
153 will find that it easy and comfortable to use GNU Emacs with a
154 small learning curve;
155
156 2. Make it easy for a user to customize EDT emulation key bindings
157 without knowing much about Emacs Lisp;
158
159 3. Make it easy to switch between the original EDT default bindings
160 and the user's customized EDT bindings, without having to exit
161 Emacs.
162
163 4. Provide support for some TPU/EVE functions not supported in EDT.
164
165 5. Provide an easy way to restore ALL original Emacs key bindings,
166 just as they existed before the EDT emulation was first invoked.
167
168 6. Support GNU Emacs 19 and higher. (GNU Emacs 18 and below is no
169 longer supported.) XEmacs 19, and above, is also supported.
170
171 7. Supports highlighting of marked text within the EDT emulation on
172 all platforms on which Emacs supports highlighting of marked text.
173
174 8. Handle terminal configuration interactively for most terminal
175 configurations, when the emulation is invoked for the first time.
176
177 9. Support a PC AT keyboard under MS-DOS.
178
179 \f
180 II. TERMINALS/KEYBOARDS SUPPORTED:
181
182 Keyboards used under a Window System are supported via the edt-mapper function.
183 The first time you invoke the emulation under a window system, the edt-mapper
184 function is run automatically and the user is prompted to identify which keys
185 the emulation is to use for the standard keypad and function keys EDT expects
186 (e.g., PF1, PF2, KP0, KP1, F1, F2, etc.). This configuration is saved to disk
187 read each time the emulation is invoked.
188
189 In character oriented connections not running a window manager, built-in
190 support for the following terminals/keyboards is provided:
191
192 (1) DEC VT-100 series and higher. This includes well behaved VT clones and
193 emulators. If you are using a VT series terminal, be sure that the term
194 environment variable is set properly before invoking emacs.
195
196 (2) PC AT keyboard under MS-DOS.
197
198 Be sure to read the SPECIAL NOTES FOR SOME PLATFORMS sections to see if those
199 notes apply to you.
200
201 \f
202 III. STARTING THE EDT EMULATION:
203
204 Start up GNU Emacs and enter "M-x edt-emulation-on" to begin the emulation.
205 After initialization is complete, the following message will appear below the
206 status line informing you that the emulation has been enabled:
207
208 Default EDT keymap active
209
210 You can have the EDT Emulation start up automatically, each time you initiate
211 a GNU Emacs session, by adding the following line to your .emacs file:
212
213 (add-hook term-setup-hook 'edt-emulation-on)
214
215 A reference sheet is included (later on) listing the default EDT Emulation key
216 bindings. This sheet is also accessible on line from within Emacs by pressing
217 PF2, GOLD H, or HELP (when in the EDT Default Mode).
218
219 It is easy to customize key bindings in the EDT Emulation. (See CUSTOMIZING
220 section, below.) Customizations are placed in a file called edt-user.el. (A
221 sample edt-user.el file can be found in the CUSTOMIZING section.) If
222 edt-user.el is found in your GNU Emacs load path during EDT Emulation
223 initialization, then the following message will appear below the status line
224 indicating that the emulation has been enabled, enhanced by your own
225 customizations:
226
227 User EDT custom keymap active
228
229 Once enabled, it is easy to switch back and forth between your customized EDT
230 Emulation key bindings and the default EDT Emulation key bindings. (See the
231 sample edt-user.el file below. Look at the binding to GOLD Z.) It is also
232 easy to turn off the emulation (via the command edt-emulation-off). Doing so
233 completely restores the original key bindings in effect just prior to invoking
234 the emulation.
235
236 Emacs binds keys to ASCII control characters and so does the real EDT. Where
237 EDT key bindings and GNU Emacs key bindings conflict, the default GNU Emacs key
238 bindings are retained by the EDT emulation by default. If you are a diehard
239 EDT user you may not like this. The CUSTOMIZING section explains how to change
240 this so that the EDT bindings to ASCII control characters override the default
241 Emacs bindings.
242
243 \f
244 IV. SPECIAL NOTES FOR SOME PLATFORMS:
245
246 Sun Workstations running X:
247
248 Some earlier Sun keyboards do not have arrow keys separate from the keypad
249 keys. It is difficult to emulate the full EDT keypad and still retain use
250 of the arrow keys on such keyboards.
251
252 The Sun Type 5 and other more recent Sun keyboards, however, do have
253 separate arrow keys. This makes them candidates for setting up a
254 reasonable EDT keypad emulation.
255
256 Depending upon the configuration of the version of X installed on your
257 system, you may find the default X keynames for the keypad keys don't
258 permit Emacs to interpret some or all the keypad keys as something other
259 than arrow keys, numeric keys, Home, PgUP, etc. Both Sun and HP have been
260 particularly guilty of making bizarre keysym assignments to the keypad
261 keys.
262
263 In most cases, the X Windows command, xmodmap, can be used to correct the
264 problem. Here's a sample .xmodmaprc file which corrects this problem on
265 one Sun workstation configuration using an older SunOS release configured
266 with a Sun Type 5 keyboard:
267
268 ! File: .xmodmaprc
269 !
270 ! Set up Sun Type 5 keypad for use with the GNU Emacs EDT Emulation
271 !
272 keycode 53 = KP_Divide
273 keycode 54 = KP_Multiply
274 keycode 57 = KP_Decimal
275 keycode 75 = KP_7
276 keycode 76 = KP_8
277 keycode 77 = KP_9
278 keycode 78 = KP_Subtract
279 keycode 97 = KP_Enter
280 keycode 98 = KP_4
281 keycode 99 = KP_5
282 keycode 100 = KP_6
283 keycode 101 = KP_0
284 keycode 105 = F24
285 keycode 119 = KP_1
286 keycode 120 = KP_2
287 keycode 121 = KP_3
288 keycode 132 = KP_Add
289
290 If edt-mapper.el does not recognize your keypad keys as unique keys, use
291 the command
292
293 xmodmap -pke
294
295 to get a listing of the actual key codes and the keysyms mapped to them
296 and then generate you own custom .xmodmaprc similar to the one above.
297
298 Next, feed .xmodmaprc to the xmodmap command and all the Sun Type 5 keypad
299 keys will now be configurable for the emulation of an LK-201 keypad (less
300 the comma key). In this example, the line
301
302 keycode 105 = F24
303
304 changes the X Windows name of the keypad NumLock key to be known
305 internally as the F24 key. Doing so permits it to be configured to behave
306 as the PF1 (Gold) key.
307
308 The side effect of this change is that you will no longer have a NumLock
309 key. If you are using other software under X which requires a NumLock
310 key, then examine your keyboard and look for one you don't use and
311 redefine it to be the NumLock key. Basically, you need to clear the
312 NumLock key from being assigned as a modifier, assign it to the key of
313 your choice, and then add it back as a modifier. (See the "General Notes
314 on Using NumLock for the PF1 Key on a Unix System" section below for
315 further help on how to do this.)
316
317 PC users running MS-DOS:
318
319 By default, F1 is configured to emulate the PF1 (GOLD) key. But NumLock
320 can be used instead if you load a freeware TSR distributed with MS-Kermit,
321 call gold.com. This was once distributed in a file called gold22.zip and
322 came with the source code as well as a loadable binary image. (See
323 edt-pc.el in the Emacs lisp/emulation directory for more information.)
324
325 PC users running GNU/Linux:
326
327 The default X server configuration varies from distribution to
328 distribution and release to release of GNU/Linux. If your system fails to
329 recognize the keypad keys as distinct keys, change the NumLock state,
330 turning it on or off, as the case may be, then try again. If this doesn't
331 solve your problem, you may have to modify the X keysym mappings with
332 xmodmap.
333
334 On one distribution on an Intel PC, the following .xmodmaprc set things up
335 nicely.
336
337 ! File: .xmodmaprc
338 !
339 ! Set up PC keypad under GNU/Linux for the GNU Emacs EDT Emulation
340 !
341 clear mod2
342 keycode 77 = F12
343 keycode 96 = Num_Lock Pointer_EnableKeys
344 add mod2 = Num_Lock
345
346 In this example, after feeding the file to the xmodmap command, the PC
347 NumLock keypad key will be configurable for the emulation of the PF1 key.
348 The PC keypad can now emulate an LK-201 keypad (less the comma key), the
349 standard keyboard supplied with DEC terminals VT-200 and above. This
350 .xmodmaprc file switches the role of the F12 and NumLock keys. It has
351 been tested on RedHat GNU/Linux 5.2. Other versions of GNU/Linux may
352 require different keycodes. (See the "General Notes on Using NumLock for
353 the PF1 Key on a Unix System" section below for further help on how to do
354 this.)
355
356 NOTE: Remember, it may be necessary to have NumLock in one position (ON)
357 or the other (OFF) for the PC keypad to emulate the LK-201 keypad
358 properly.
359 \f
360 General Notes on Using NumLock for the PF1 Key on a Unix System:
361
362 Making the physical NumLock key available for use in the EDT
363 Emulation requires some modification to the default X Window
364 settings. Since the keycode assignments vary from system to
365 system, some investigation is needed to see how to do this on
366 a particular system.
367
368 You will need to look at the output generated by xmodmap invoked with the
369 "-pm" switch. examined. For example, on RedHat GNU/Linux 5.2 on a PC, we
370 get the following output when running xmodmap.
371
372 "xmodmap -pm" yields:
373
374 xmodmap: up to 2 keys per modifier, (keycodes in parentheses):
375
376 shift Shift_L (0x32), Shift_R (0x3e)
377 lock Caps_Lock (0x42)
378 control Control_L (0x25), Control_R (0x6d)
379 mod1 Alt_L (0x40), Alt_R (0x71)
380 mod2 Num_Lock (0x4d)
381 mod3
382 mod4
383 mod5 Scroll_Lock (0x4e)
384
385
386 Note that Num_Lock is assigned to the modifier mod2. This is
387 what hides Num_Lock from being seen by Emacs.
388
389 Now, "xmodmap -pke" yields:
390
391 .
392 .
393 .
394 keycode 77 = Num_Lock Pointer_EnableKeys
395 .
396 .
397 .
398 keycode 96 = F12
399 .
400 .
401 .
402
403 So, in RedHat GNU/Linux 5.2 on a PC, Num_Lock generates keycode
404 77. The following steps are taken:
405
406 1. clear the assignment of Num_Lock to mod2;
407 2. swap the keycodes assigned to F12 and Num_Lock;
408 3. assign Num_Lock back to mod2.
409
410 The .xmodmaprc file looks like this:
411
412 ! File: .xmodmaprc
413 !
414 ! Set up PC keypad under GNU/Linux for the GNU Emacs EDT Emulation
415 !
416 clear mod2
417 keycode 77 = F12
418 keycode 96 = Num_Lock Pointer_EnableKeys
419 add mod2 = Num_Lock
420
421 So, after executing "xmodmap .xmodmaprc", a press of the physical
422 F12 key looks like a Num_Lock keypress to X. Also, a press of the
423 physical NumLock key looks like a press of the F12 key to X.
424
425 Now, edt-mapper.el will see "f12" when the physical NumLock key
426 is pressed, allowing the NumLock key to be used as the EDT PF1
427 (Gold) key.
428 \f
429 V. HOW DOES THIS EDT EMULATION DIFFER FROM REAL EDT?:
430
431 In general, you will find that this emulation of EDT replicates most, but not
432 all, of EDT's most used Keypad Mode editing functions and behavior. It is not
433 perfect, but most EDT users who have tried the emulation agree that it is
434 quite good enough to make it easy for die-hard EDT users to move over to using
435 GNU Emacs.
436
437 Here's a list of the most important differences between EDT and this GNU Emacs
438 EDT Emulation. The list is short but you must be aware of these differences
439 if you are to use the EDT Emulation effectively.
440
441 1. Entering repeat counts works a little differently than in EDT.
442
443 EDT allows users to enter a repeat count before entering a command that
444 accepts repeat counts. For example, when using the real EDT, pressing
445 these three keys in sequence, GOLD 5 KP1, will move the cursor in the
446 current direction 5 words. This does NOT work in Emacs!
447
448 Emacs provides two ways to enter repeat counts and neither involves using
449 the GOLD key. First, repeat counts can be entered in Emacs by using the
450 ESC key. For example, pressing these keys in sequence, ESC 1 0 KP1, will
451 move the cursor in the current direction 10 words. Second, Emacs provides
452 another command called universal-argument that can be used to do the same
453 thing. Normally, in Emacs has this bound to C-u.
454
455 2. EDT's line mode commands and nokeypad mode commands are NOT supported
456 (with one important exception; see item 8 in the Highlights section
457 below). Although, at first, this may seem like a big omission, the set of
458 built-in Emacs commands provides a much richer set of capabilities which
459 more than make up for this omission.
460
461 To enter Emacs commands not bound to keys, you can press GOLD KP7 or the DO
462 key. Emacs will display its own command prompt "M-x". This stands for the
463 keypress Meta-x, where Meta is a special shift key. The Alt key is often
464 mapped to behave as a Meta key. So, you can also invoke this prompt by
465 pressing Meta-x. Typing the sequence "ESC x" will also invoke the prompt.
466
467 3. Selected text is highlighted ONLY on systems where Emacs supports the
468 highlighting of text.
469
470 4. Just like in TPU/EVE, the ENTER key is NOT used to terminate input when the
471 editor prompts you for input. The RETURN key is used, instead. (KP4 and
472 KP5 (the direction keys) do terminate input for the FIND command, just like
473 in EDT, however.)
474
475
476 \f
477
478 VI. SOME HIGHLIGHTS IN THIS EDT EMULATION, AND SOME COMPARISONS TO THE
479 ORIGINAL GNU EMACS EDT EMULATION:
480
481 1. The EDT define key command is supported (edt-define-key) and is bound to
482 C-k in the default EDT mode when EDT control sequence bindings are enabled
483 or one of the sample edt-user.el customization files is used. The TPU/EVE
484 learn command is supported but not bound to a key in the default EDT mode
485 but is bound in the sample edt-user.el file.
486
487 Unlike the TPU/EVE learn command, which uses one key to begin the learn
488 sequence, C-l, and another command to remember the sequence, C-r, this
489 version of the learn command (edt-learn) serves as a toggle to both begin
490 and to remember the learn sequence.
491
492 Many users who change the meaning of a key with the define key and the
493 learn commands, would like to be able to restore the original key binding
494 without having to quit and restart emacs. So a restore key command is
495 provided to do just that. When invoked, it prompts you to press the key
496 to which you wish the last replaced key definition restored. It is bound
497 to GOLD C-k in the default EDT mode when EDT control sequence bindings are
498 enabled or one of the sample edt-user.el customization files is used.
499
500 2. Direction support is fully supported.
501
502 3. All original Emacs bindings are fully restored when EDT emulation is turned
503 off. So, if a fellow worker comes over to your terminal to help you with a
504 software problem, for example, and is completely confused by your EDT
505 emulation bindings, just enter the command, edt-emulation-off, at the M-x
506 prompt and the original Emacs bindings will be restored. To resume the EDT
507 emulation, just enter edt-emulation-on.
508
509 4. User custom EDT bindings are kept separate from the default EDT bindings.
510 One can toggle back and forth between the custom EDT bindings and default
511 EDT bindings.
512
513 5. The Emacs functions in edt.el attempt to emulate, where practical, the
514 exact behavior of the corresponding EDT keypad mode commands. In a few
515 cases, the emulation is not exact, but we hope you will agree it is close
516 enough. In a very few cases, we chose to use the Emacs way of handling
517 things. As mentioned earlier, we do not emulate the EDT SUBS command.
518 Instead, we chose to use the Emacs query-replace function, which we find
519 to be easier to use.
520
521 6. Emacs uses the regexp assigned to page-delimiter to determine what marks a
522 page break. This is normally "^\f", which causes the edt-page command to
523 ignore form feeds not located at the beginning of a line. To emulate the
524 EDT PAGE command exactly, page-delimiter is set to "\f" when EDT emulation
525 is turned on, and restored to "^\f" when EDT emulation is turned off.
526 But, since some users prefer the Emacs definition of a page break, or may
527 wish to preserve a customized definition of page break, one can override
528 the EDT definition by placing
529
530 (setq edt-keep-current-page-delimiter t)
531
532 in your .emacs file. Or, you can used the Emacs customize command
533 to change its setting.
534
535 7. The EDT definition of a section of a terminal window is hardwired to be 16
536 lines of its one-and-only 24-line window (the EDT SECT command bound to
537 KP8). That's two-thirds of the window at a time. Since Emacs, like
538 TPU/EVE, can handle multiple windows of sizes of other than 24 lines, the
539 definition of section used here has been modified to two-thirds of the
540 current window. (There is also an edt-scroll-window function which you
541 may prefer over the SECT emulation.)
542
543 8. Cursor movement and deletion involving word entities is identical to EDT.
544 This, above all else, gives the die-hard EDT user a sense of being at
545 home. Also, an emulation of EDT's SET ENTITY WORD command is provided,
546 for those users who like to customize movement by a word at a time to
547 their own liking.
548
549 9. EDT's FIND and FNDNXT are supported.
550
551 10. EDT's APPEND, REPLACE, and SUBS commands are supported.
552
553 11. CHNGCASE is supported. It works on individual characters or selected
554 text, if SELECT is active. In addition, two new commands are provided:
555 edt-lowercase and edt-uppercase. They work on individual WORDS or
556 selected text, if SELECT is active.
557
558 12. Form feed and tab insert commands are supported.
559
560 13. A new command, edt-duplicate-word, is provided. If you experiment with
561 it, you might find it to be surprisingly useful and may wonder how you
562 ever got along without it! It is assigned to C-j in the sample
563 edt-user.el customization files.
564
565 14. TPU/EVE's Rectangular Cut and Paste functions (originally from the EVE-Plus
566 package) are supported. But unlike the TPU/EVE versions, these here
567 support both insert and overwrite modes. The seven rectangular functions
568 are bound to F7, F8, GOLD-F8, F9, GOLD-F9, F10, and GOLD-F10 in the
569 default EDT mode.
570
571 15. The original EDT emulation package set up many default regular and GOLD
572 bindings. We tried to preserve most (but not all!) of these, so users of
573 the original emulation package will feel more at home.
574
575 Nevertheless, there are still many GOLD key sequences which are not bound
576 to any functions. These are prime candidates to use for your own
577 customizations.
578
579 Also, there are several commands in edt.el not bound to any key. So, you
580 will find it worthwhile to look through edt.el for functions you may wish
581 to add to your personal customized bindings.
582
583 16. The VT200/VT300 series terminals steal the function keys F1 to F5 for
584 their own use. These do not generate signals which are sent to the host.
585 So, edt.el does not assign any default bindings to F1 through F5.
586
587 In addition, our VT220 terminals generate an interrupt when the F6 key is
588 pressed (^C or ^Y, can't remember which) and not the character sequence
589 documented in the manual. So, binding emacs commands to F6 will not work
590 if your terminal behaves the same way.
591
592 17. The VT220 terminal has no ESC, BS, nor LF keys, as does a VT100. So the
593 default EDT bindings adopt the standard DEC convention of having the F11,
594 F12, and F13 keys, on a VT200 series (and above) terminal, assigned to the
595 same EDT functions that are bound to ESC, BS, and LF on a VT100 terminal.
596
597 18. Each user, through the use of a private edt-user.el file, can customize,
598 very easily, personal EDT emulation bindings.
599
600 19. The EDT SELECT and RESET functions are supported. However, unlike EDT,
601 pressing RESET to cancel text selection does NOT reset the existing
602 setting of the current direction.
603
604 We also provide a TPU/EVE like version of the single SELECT/RESET
605 function, called edt-toggle-select, which makes the EDT SELECT function
606 into a toggle on/off switch. That is, if selection is ON, pressing SELECT
607 again turns selection off (cancels selection). This function is used in
608 the sample edt-user.el customization files.
609
610 20. EDT scroll margins are supported, but are disabled by default. (See
611 CUSTOMIZING section below for instructions on how to enable them.)
612 \f
613
614 VII. CUSTOMIZING:
615
616 Most EDT users, at one time or another, make some custom key bindings, or
617 use someone else's custom key bindings, which they come to depend upon just as
618 if they were built-in bindings. This EDT Emulation for GNU Emacs is designed
619 to make it easy to customize bindings.
620
621 If you wish to customize the EDT Emulation to use some of your own key
622 bindings, you need to make a private version of edt-user.el in your own
623 private lisp directory. There are two sample files edt-user.el1 and
624 edt-user.el2 for you to use as templates and for ideas. Look at
625 edt-user.el1 first. Unless you will be using two or more very different
626 types of terminals on the same system, you need not look at edt-user.el2.
627
628 First, you need to have your own private lisp directory, say ~/lisp, and
629 you should add it to the GNU Emacs load path.
630
631 NOTE: A few sites have different load-path requirements, so the above
632 directions may need some modification if your site has such special
633 needs.
634
635
636 Creating your own edt-user.el file:
637
638 A sample edt-user.el file is attached to the end of this user documentation.
639 You should use it as a guide to learn how you can customize EDT emulation
640 bindings to your own liking. Names used to identify the set of LK-201
641 keypad and function keys are:
642
643 Keypad Keys:
644 PF1 PF2 PF3 PF4
645 KP7 KP8 KP9 KP-
646 KP4 KP5 KP6 KP,
647 KP1 KP2 KP3
648 KP0 KPP KPE
649
650 Arrow Keys:
651 LEFT RIGHT DOWN UP
652
653 Function Keys:
654 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14
655 HELP DO F17 F18 F19 F20
656
657 FIND INSERT REMOVE
658 SELECT PREVIOUS NEXT
659
660 Note:
661 Many VT-200 terminals, and above, steal function keys F1 thru
662 F5 for terminal setup control and don't send anything to the
663 host if pressed. So customizing bindings to these keys may
664 not work for you.
665
666 There are three basic functions that do the EDT emulation custom bindings:
667 edt-bind-key, edt-bind-gold-key, and edt-bind-function-key.
668
669 The first two are for binding functions to keys which are standard across most
670 keyboards. This makes them keyboard independent, making it possible to define
671 these key bindings for all terminals in the file edt.el.
672
673 The first, edt-bind-key, is used typically to bind emacs commands to
674 control keys, although some people use it to bind commands to other keys, as
675 well. (For example, some people use it to bind the VT200 seldom used
676 back-tick key (`) to the function "ESC-prefix" so it will behave like an ESC
677 key.) The second function, edt-bind-gold-key, is used to bind emacs commands
678 to gold key sequences involving alpha-numeric keys, special character keys,
679 and control keys.
680
681 The third function, edt-bind-function-key, is terminal dependent and is defined
682 in a terminal specific file (see edt-vt100.el for example). It is used to bind
683 emacs commands to LK-201 function keys, to keypad keys, and to gold sequences
684 of those keys.
685
686
687 SPECIFYING WORD ENTITIES:
688
689 The variable edt-word-entities is used to emulate EDT's SET ENTITY WORD
690 command. It contains a list of characters to be treated as words in
691 themselves. If the user does not define edt-word-entities in his/her .emacs
692 file, then it is set up with the EDT default containing only TAB.
693
694 The characters are stored in the list by their numerical values, not as
695 strings. Emacs supports several ways to specify the numerical value of a
696 character. One method is to use the question mark: ?A means the numerical
697 value for A, ?/ means the numerical value for /, and so on. Several
698 unprintable characters have special representations:
699
700 ?\b specifies BS, C-h
701 ?\t specifies TAB, C-i
702 ?\n specifies LFD, C-j
703 ?\v specifies VTAB, C-k
704 ?\f specifies FF, C-l
705 ?\r specifies CR, C-m
706 ?\e specifies ESC, C-[
707 ?\\ specifies \
708
709 Here are some examples:
710
711 (setq edt-word-entities '(?\t ?- ?/)) ;; Specifies TAB, - , and /
712 (setq edt-word-entities '(?\t) ;; Specifies TAB, the default
713
714 You can also specify characters by their decimal ascii values:
715
716 (setq edt-word-entities '(9 45 47)) ;; Specifies TAB, - , and /
717
718
719 ENABLING EDT CONTROL KEY SEQUENCE BINDINGS:
720
721 Where EDT key bindings and GNU Emacs key bindings conflict, the default GNU
722 Emacs key bindings are retained by default. Some diehard EDT users may not
723 like this. So, if the variable edt-use-EDT-control-key-bindings is set to
724 true in a user's .emacs file, then the default EDT Emulation mode will enable
725 most of the original EDT control key sequence bindings. If you wish to do
726 this, add the following line to your .emacs file:
727
728 (setq edt-use-EDT-control-key-bindings t)
729
730
731 SETTING SCROLL MARGINS:
732
733 Scroll margins at the top and bottom of the window are now supported. (The
734 design was copied from tpu-extras.el.) By default, this feature is enabled
735 with the top margin set to 10% of the window and the bottom margin set to 15%
736 of the window. To change these settings, you can invoke the function
737 edt-set-scroll-margins in your .emacs file. For example, the following line
738
739 (edt-set-scroll-margins "20%" "25%")
740
741 sets the top margin to 20% of the window and the bottom margin to 25% of the
742 window. To disable this feature, set each margin to 0%. You can also invoke
743 edt-set-scroll-margins interactively while EDT Emulation is active to change
744 the settings for that session.
745
746 NOTE: Another way to set the scroll margins is to use the Emacs customization
747 feature (not available in Emacs 19) to set the following two variables
748 directly:
749
750 edt-top-scroll-margin and edt-bottom-scroll-margin
751
752 Enter the Emacs `customize' command. First select the Editing group and then
753 select the Emulations group. Finally, select the Edt group and follow the
754 directions.
755 \f
756 DEFAULT EDT Keypad
757
758 F7: Copy Rectangle +----------+----------+----------+----------+
759 F8: Cut Rect Overstrike |Prev Line |Next Line |Bkwd Char |Frwd Char |
760 G-F8: Paste Rect Overstrike | (UP) | (DOWN) | (LEFT) | (RIGHT) |
761 F9: Cut Rect Insert |Window Top|Window Bot|Bkwd Sent |Frwd Sent |
762 G-F9: Paste Rect Insert +----------+----------+----------+----------+
763 F10: Cut Rectangle
764 G-F10: Paste Rectangle
765 F11: ESC
766 F12: Beginning of Line +----------+----------+----------+----------+
767 G-F12: Delete Other Windows | GOLD | HELP | FNDNXT | DEL L |
768 F13: Delete to Begin of Word | (PF1) | (PF2) | (PF3) | (PF4) |
769 HELP: Keypad Help |Mark Wisel|Desc Funct| FIND | UND L |
770 G-HELP: Emacs Help +----------+----------+----------+----------+
771 DO: Execute extended command | PAGE | SECT | APPEND | DEL W |
772 C-g: Keyboard Quit | (7) | (8) | (9) | (-) |
773 G-C-g: Keyboard Quit |Ex Ext Cmd|Fill Regio| REPLACE | UND W |
774 C-h: Beginning of Line +----------+----------+----------+----------+
775 G-C-h: Emacs Help | ADVANCE | BACKUP | CUT | DEL C |
776 C-i: Tab Insert | (4) | (5) | (6) | (,) |
777 C-j: Delete to Begin of Word | BOTTOM | TOP | Yank | UND C |
778 C-k: Define Key +----------+----------+----------+----------+
779 G-C-k: Restore Key | WORD | EOL | CHAR | Next |
780 C-l: Form Feed Insert | (1) | (2) | (3) | Window |
781 C-n: Set Screen Width 80 | CHNGCASE | DEL EOL |Quoted Ins| !
782 C-r: Isearch Backward +---------------------+----------+ (ENTER) |
783 C-s: Isearch Forward | LINE | SELECT | !
784 C-t: Display the Time | (0) | (.) | Query |
785 C-u: Delete to Begin of Line | Open Line | RESET | Replace |
786 C-v: Redraw Display +---------------------+----------+----------+
787 C-w: Set Screen Width 132
788 C-z: Suspend Emacs +----------+----------+----------+
789 G-C-\: Split Window | FNDNXT | Yank | CUT |
790 | (FIND) | (INSERT) | (REMOVE) |
791 G-b: Buffer Menu | FIND | | COPY |
792 G-c: Compile +----------+----------+----------+
793 G-d: Delete Window |SELECT/RES|SECT BACKW|SECT FORWA|
794 G-e: Exit | (SELECT) |(PREVIOUS)| (NEXT) |
795 G-f: Find File | | | |
796 G-g: Find File Other Window +----------+----------+----------+
797 G-h: Keypad Help
798 G-i: Insert File
799 G-k: Toggle Capitalization Word
800 G-l: Lowercase Word or Region
801 G-m: Save Some Buffers
802 G-n: Next Error
803 G-o: Switch to Next Window
804 G-q: Quit
805 G-r: Revert File
806 G-s: Save Buffer
807 G-u: Uppercase Word or Region
808 G-v: Find File Other Window
809 G-w: Write file
810 G-y: EDT Emulation OFF
811 G-z: Switch to User EDT Key Bindings
812 G-1: Delete Other Windows
813 G-2: Split Window
814 G-%: Go to Percentage
815 G- : Undo (GOLD Spacebar)
816 G-=: Go to Line
817 G-`: What line
818 G-/: Query-Replace
819 \f
820 ;;; File: edt-user.el --- Sample User Customizations for the Enhanced
821 ;;; EDT Keypad Mode Emulation
822 ;;;
823 ;;; For GNU Emacs 19 and Above
824 ;;;
825 ;; Copyright (C) 1986, 1992, 1993, 2000 Free Software Foundation, Inc.
826
827 ;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com>
828 ;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com>
829 ;; Keywords: emulations
830
831 ;; GNU Emacs is free software; you can redistribute it and/or modify
832 ;; it under the terms of the GNU General Public License as published by
833 ;; the Free Software Foundation; either version 2, or (at your option)
834 ;; any later version.
835
836 ;; GNU Emacs is distributed in the hope that it will be useful,
837 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
838 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
839 ;; GNU General Public License for more details.
840
841 ;; You should have received a copy of the GNU General Public License
842 ;; along with GNU Emacs; see the file COPYING. If not, write to the
843 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
844 ;; Boston, MA 02111-1307, USA.
845
846 ;;; Commentary:
847
848 ;; This file contains GNU Emacs User Custom EDT bindings and functions.
849
850 ;;; Usage:
851
852 ;; See edt-user.doc in the emacs etc directory.
853
854 ;; ====================================================================
855 \f
856 ;;;;
857 ;;;; Setup user custom EDT key bindings.
858 ;;;;
859
860 (defun edt-setup-user-bindings ()
861 "Assigns user custom EDT Emulation keyboard bindings."
862
863 ;; PF1 (GOLD), PF2, PF3, PF4
864 ;;
865 ;; This file MUST contain a binding of PF1 to edt-user-gold-map. So
866 ;; DON'T CHANGE OR DELETE THE REGULAR KEY BINDING OF PF1 BELOW!
867 ;; (However, you may change the GOLD-PF1 binding, if you wish.)
868 (edt-bind-function-key "PF1" 'edt-user-gold-map 'edt-mark-section-wisely)
869 (edt-bind-function-key "PF2" 'query-replace 'other-window)
870 (edt-bind-function-key "PF4" 'edt-delete-entire-line 'edt-undelete-line)
871
872 ;; EDT Keypad Keys
873 (edt-bind-function-key "KP1" 'edt-word-forward 'edt-change-case)
874 (edt-bind-function-key "KP3" 'edt-word-backward 'edt-copy)
875 (edt-bind-function-key "KP6" 'edt-cut-or-copy 'yank)
876 (edt-bind-function-key "KP8" 'edt-scroll-window 'fill-paragraph)
877 (edt-bind-function-key "KP9" 'open-line 'edt-eliminate-all-tabs)
878 (edt-bind-function-key "KPP"
879 'edt-toggle-select 'edt-line-to-middle-of-window)
880 (edt-bind-function-key "KPE" 'edt-change-direction 'overwrite-mode)
881
882 ;; GOLD bindings for regular keys.
883 (edt-bind-gold-key "a" 'edt-append)
884 (edt-bind-gold-key "A" 'edt-append)
885 (edt-bind-gold-key "h" 'edt-electric-user-keypad-help)
886 (edt-bind-gold-key "H" 'edt-electric-user-keypad-help)
887
888 ;; Control bindings for regular keys.
889 ;;; Leave binding of C-c as original prefix key.
890 (edt-bind-key "\C-j" 'edt-duplicate-word)
891 (edt-bind-key "\C-k" 'edt-define-key)
892 (edt-bind-gold-key "\C-k" 'edt-restore-key)
893 (edt-bind-key "\C-l" 'edt-learn)
894 ;;; Leave binding of C-m to newline.
895 (edt-bind-key "\C-n" 'edt-set-screen-width-80)
896 (edt-bind-key "\C-o" 'open-line)
897 (edt-bind-key "\C-p" 'fill-paragraph)
898 ;;; Leave binding of C-r to isearch-backward.
899 ;;; Leave binding of C-s to isearch-forward.
900 (edt-bind-key "\C-t" 'edt-display-the-time)
901 (edt-bind-key "\C-v" 'redraw-display)
902 (edt-bind-key "\C-w" 'edt-set-screen-width-132)
903 ;;; Leave binding of C-x as original prefix key.
904 )
905 \f
906 ;;;
907 ;;; LK-201 KEYBOARD USER EDT KEYPAD HELP
908 ;;;
909
910 (defun edt-user-keypad-help ()
911 "
912 USER EDT Keypad Active
913
914 +----------+----------+----------+----------+
915 F7: Copy Rectangle |Prev Line |Next Line |Bkwd Char |Frwd Char |
916 F8: Cut Rect Overstrike | (UP) | (DOWN) | (LEFT) | (RIGHT) |
917 G-F8: Paste Rect Overstrike |Window Top|Window Bot|Bkwd Sent |Frwd Sent |
918 F9: Cut Rect Insert +----------+----------+----------+----------+
919 G-F9: Paste Rect Insert
920 F10: Cut Rectangle
921 G-F10: Paste Rectangle
922 F11: ESC +----------+----------+----------+----------+
923 F12: Beginning of Line | GOLD |Query Repl| FNDNXT |Del Ent L |
924 G-F12: Delete Other Windows | (PF1) | (PF2) | (PF3) | (PF4) |
925 F13: Delete to Begin of Word |Mark Wisel|Other Wind| FIND | UND L |
926 HELP: Keypad Help +----------+----------+----------+----------+
927 G-HELP: Emacs Help | PAGE |Scroll Win|Open Line | DEL W |
928 DO: Execute extended command | (7) | (8) | (9) | (-) |
929 C-a: Beginning of Line |Ex Ext Cmd|Fill Parag|Elim Tabs | UND W |
930 C-b: Switch to Buffer +----------+----------+----------+----------+
931 C-d: Delete Character | ADVANCE | BACKUP | CUT/COPY | DEL C |
932 C-e: End of Line | (4) | (5) | (6) | (,) |
933 C-f: Forward Character | BOTTOM | TOP | Yank | UND C |
934 C-g: Keyboard Quit +----------+----------+----------+----------+
935 G-C-g: Keyboard Quit | Fwd Word | EOL | Bwd Word | Change |
936 C-h: Electric Emacs Help | (1) | (2) | (3) | Direction|
937 G-C-h: Emacs Help | CHNGCASE | DEL EOL | COPY | |
938 C-i: Indent for Tab +---------------------+----------+ (ENTER) |
939 C-j: Duplicate Word | LINE |SELECT/RES| |
940 C-k: Define Key | (0) | (.) | Toggle |
941 G-C-k: Restore Key | Open Line |Center Lin|Insrt/Over|
942 C-l: Learn +---------------------+----------+----------+
943 C-n: Set Screen Width 80
944 C-o: Open Line +----------+----------+----------+
945 C-p: Fill Paragraph | FNDNXT | Yank | CUT |
946 C-q: Quoted Insert | (FIND)) | (INSERT) | (REMOVE) |
947 C-r: Isearch Backward | FIND | | COPY |
948 C-s: Isearch Forward +----------+----------+----------+
949 C-t: Display the Time |SELECT/RES|SECT BACKW|SECT FORWA|
950 C-u: Universal Argument | (SELECT) |(PREVIOUS)| (NEXT) |
951 C-v: Redraw Display | | | |
952 C-w: Set Screen Width 132 +----------+----------+----------+
953 C-z: Suspend Emacs
954 G-C-\\: Split Window
955
956 G-a: Append to Kill Buffer
957 G-b: Buffer Menu
958 G-c: Compile
959 G-d: Delete Window
960 G-e: Exit
961 G-f: Find File
962 G-g: Find File Other Window
963 G-h: Keypad Help
964 G-i: Insert File
965 G-k: Toggle Capitalization Word
966 G-l: Lowercase Word or Region
967 G-m: Save Some Buffers
968 G-n: Next Error
969 G-o: Switch Windows
970 G-q: Quit
971 G-r: Revert File
972 G-s: Save Buffer
973 G-u: Uppercase Word or Region
974 G-v: Find File Other Window
975 G-w: Write file
976 G-y: EDT Emulation OFF
977 G-z: Switch to Default EDT Key Bindings
978 G-2: Split Window
979 G-%: Go to Percentage
980 G- : Undo (GOLD Spacebar)
981 G-=: Go to Line
982 G-`: What line
983 G-/: Query-Replace"
984
985 (interactive)
986 (describe-function 'edt-user-keypad-help))