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