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