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