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