edt.texi 35 KB

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