home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / modes / edt / edt-user.doc < prev    next >
Encoding:
Text File  |  1991-10-25  |  19.3 KB  |  427 lines

  1. File:  edt-user.doc, v 1.5
  2.  
  3.                -----   -----------   -------   -----------------
  4.                E D T   K e y p a d   M o d e   E m u l a t i o n
  5.                -----   -----------   -------   -----------------
  6.  
  7.                        -------   -----------------------
  8.                        U s e r   I n s t r u c t i o n s
  9.                        -------   -----------------------
  10.  
  11.                         BETA Distribution Version 0.5
  12.                       Copyright (C) 1991 Kevin Gallagher
  13.                          (kgallagh@digi.lonestar.org)
  14.  
  15. STARTING EDT EMULATION:
  16.  
  17. Start up emacs and enter "M-x edt-emulation-on" to begin the emulation.  If
  18. you placed the file edt-user.el in your load path, then a message will appear
  19. stating that your User Custom EDT emulation has been enabled.  If you do not
  20. have an edt-user.el in your load path, then a message will appear stating that
  21. the default EDT emulation has been enable.  (See CUSTOMIZING section, below.)
  22.  
  23. Of course, you can have this done automatically, when you start emacs, by
  24. adding the following line to your .emacs file:
  25.  
  26.         (setq term-setup-hook 'edt-emulation-on)
  27.  
  28. A reference sheet is included in this file (edt-user.doc) listing the default
  29. EDT Emulation key bindings.  This sheet is also accessible on line from within
  30. Emacs (PF2 or GOLD H, in the EDT Default Mode).
  31.  
  32.  
  33.  
  34. HOW DOES THIS EDT EMULATION DIFFER FROM REAL EDT?:
  35.  
  36. In general, you will find that this emulation of EDT replicates most, but not
  37. all, of EDT's most used editing functions and behavior.  It is not perfect,
  38. but most agree that it is good enough to make it easy for die-hard EDT users
  39. to move over to using GNU Emacs.
  40.  
  41. Here's a list of SOME of the most important differences between EDT and this
  42. GNU Emacs EDT Emulation.
  43.  
  44. 1.  Entering repeat counts works a little differently than in EDT.
  45.  
  46.     EDT allows users to enter a repeat count before entering a command that
  47.     accepts repeat counts.  For example, when in EDT, pressing these three
  48.     keys in sequence, GOLD 5 KP1, will move the cursor in the current
  49.     direction 5 words.
  50.  
  51.     Emacs provides two ways to enter repeat counts, though neither involves
  52.     using the GOLD key.  In Emacs, repeat counts can be entered by using the 
  53.     ESC key.  For example, pressing these keys in sequence, ESC 1 0 KP1, will
  54.     move the cursor in the current direction 10 words. 
  55.  
  56.     Emacs provides another command called universal-argument that can do the
  57.     same thing, plus a few other things.  Normally, Emacs has this bound to
  58.     C-u.  But this conflicts with the EDT binding to C-u.  So, unless one
  59.     chooses to customize a binding of the command universal-argument to a key,
  60.     EDT emulation users can use ESC.
  61.  
  62. 2.  The EDT SUBS command is NOT supported.  The built-in Emacs query-replace
  63.     command is bound to GOLD ENTER, instead.  It is more convenient to use
  64.     than SUBS.
  65.  
  66. 3.  EDT's line mode commands and nokeypad mode commands are NOT supported.
  67.     Although, at first, this may seem like a big omission, the set of built-in
  68.     Emacs commands provides a much richer set of capabilities which more than
  69.     make up for this omission.
  70.  
  71.     To enter Emacs commands not bound to keys, press GOLD KP7.  This provides
  72.     the Meta-x (M-x) prompt, which accepts any valid Emacs command.  (The
  73.     normal Emacs way to get this prompt is to press ESC x, by the way.)
  74.  
  75. 4.  Selected text is not highlighted.  Support for highlighting selected text
  76.     requires code changes to the GNU Emacs C source.  This support has been
  77.     added to the X windows beta test version of GNU Emacs (Epoch) and is
  78.     planned for Emacs 19.  So, right now, the EDT Emulation does not highlight
  79.     selected text.
  80.  
  81. 5.  Just like TPU/EVE, The ENTER key is NOT used to terminate input when the
  82.     editor prompts you for input.  The RETURN key is used, instead.  (KP4 and
  83.     KP5 do terminate input for the FIND command, just like in EDT, however.)
  84.  
  85.  
  86.  
  87.  
  88. SOME HIGHLIGHTS IN THIS EDT EMULATION, AND SOME COMPARISONS TO THE ORIGINAL
  89. GNU EMACS EDT EMULATION:
  90.  
  91. 1.  The EDT define key command is supported (edt-define-key) and is bound to
  92.     C-k in the default EDT mode.  The TPU/EVE learn command is supported but
  93.     not bound to a key at this time.  (But unlike the TPU/EVE learn command,
  94.     which uses one command to begin the learn sequence (usually C-l) and
  95.     another command to remember the sequence (usually C-r), the same command
  96.     (edt-learn) is used as a toggle to both begin and to remember the learn
  97.     sequence.
  98.  
  99.     We also supply a restore key command which will restore the last replaced
  100.     definition to a key (whether done by edt-define-key or edt-learn).  It is
  101.     bound to GOLD C-k in the default EDT mode.
  102.  
  103. 2.  Direction support is fully supported.  It is no longer accomplished by
  104.     re-defining keys each time the direction is changed.  Thus, commands
  105.     sensitive to the current direction setting may be bound easily to any key.
  106.  
  107. 3.  All original emacs bindings are fully restored when EDT emulation is
  108.     turned off.
  109.  
  110. 4.  User custom EDT bindings are kept separate from the default EDT bindings.
  111.     One can toggle back and forth between the custom EDT bindings and default
  112.     EDT bindings.
  113.  
  114. 5.  The Emacs functions in edt.el attempt to emulate, where practical, the
  115.     exact behavior of the corresponding EDT keypad mode commands.  In a few
  116.     cases, the emulation is not exact, but we hope you will agree it is close
  117.     enough.  In a very few cases, we chose to use the Emacs way of handling
  118.     things.  For example, we do not emulate the EDT SUBS command.  Instead, we
  119.     chose to use the Emacs query-replace function, which we find to be easier
  120.     to use.
  121.  
  122. 6.  Emacs uses the regexp assigned to page-delimiter to determine what
  123.     marks a page break.  This is normally "^\f", which causes the edt-page
  124.     command to ignore form feeds not located at the beginning of a line.  To
  125.     emulate the EDT PAGE command exactly, page-delimiter is set to "\f" when
  126.     EDT emulation is turned on, and restored to "^\f" when EDT emulation is
  127.     turned off.  But this can be overridden if the EDT definition is not
  128.     desired by placing
  129.  
  130.             (setq edt-keep-current-page-delimiter t)
  131.  
  132.     in your .emacs file.
  133.  
  134. 7.  EDT definitions of a section is hardwired to be 16 lines of its one and
  135.     only 24-line window.  That's two-thirds of the window at a time.  Since
  136.     Emacs, like TPU/EVE, can handle window of sizes of other than 24 lines,
  137.     our definition of section is set to two-thirds of the current window.
  138.     (There is also an edt-scroll-window function which you may prefer over the
  139.     SECT emulation.)
  140.  
  141. 8.  Cursor movement and deletion involving word entities is identical to EDT.
  142.     An emulation of EDT's SET ENTITY WORD command is provided.
  143.  
  144. 9.  FIND and FNDNXT are supported.
  145.  
  146. 10. EDT's APPEND and REPLACE commands are supported.
  147.  
  148. 11. CHNGCASE is supported.  It works on individual characters or selected
  149.     text, if SELECT is active.  In addition, two new commands are provided:
  150.     edt-lowercase and edt-uppercase.  They work on individual WORDS or
  151.     selected text, if SELECT is active.
  152.  
  153. 12. Form feed and tab insert commands are supported.
  154.  
  155. 13. Movement by sentences and paragraphs is supported, a feature not supported
  156.     in EDT.
  157.  
  158. 14. A new command, edt-duplicate-word, is provided.  I find it to be
  159.     surprisingly useful.
  160.  
  161. 15. Retangular Cut and Paste in both insert and overwrite modes is supported.
  162.     Another feature not supported in EDT.
  163.  
  164. 16. The original EDT emulation package set up many default regular and GOLD
  165.     bindings.  We tried to preserve most (but not all!) of these, so users of
  166.     the original emulation package will feel more at home.  Many GOLD key
  167.     sequences are not bound to functions.  We are open to suggestions here.
  168.     There are several commands in edt.el not bound to any key, at this time.
  169.     So, you may find it worthwhile to look through edt.el for functions you
  170.     may wish to use in your personal customized bindings.
  171.  
  172. 17. The VT200/VT300 series terminals steal the function keys F1 to F5 for
  173.     their own use.  These do not generate signals which are sent to the host.
  174.     So, edt.el does not assign any default bindings to F1 through F5.
  175.  
  176.     In addition, our VT220 terminals generate an interrupt when the F6 key is
  177.     pressed (^C or ^Y, can't remember which) and not the character sequence
  178.     documented in the manual.  So, binding emacs commands to F6 will not work
  179.     if your terminal behaves the same way.
  180.  
  181. 18. The VT220 terminal has no ESC, BS, nor LF keys, as does a VT100.  So the
  182.     default EDT bindings adopt the standard DEC convention of interpreting
  183.     F11 as ESC, F12 as BS, and F13 as LF on VT200 series terminals.  (See
  184.     vt-esc-sub.el for more information.)
  185.  
  186. 19. Each user, through the use of a private edt-user.el file, can customize
  187.     his/her own EDT emulation bindings to suit their own personal preferences.
  188.  
  189. 20. The EDT SELECT and RESET functions are supported.  However, unlike EDT,
  190.     pressing RESET to cancel text selection does NOT affect the setting of the
  191.     current direction.
  192.  
  193.     We also provide a TPU/EVE like version of SELECT/RESET called
  194.     edt-toggle-select which makes the EDT SELECT function into a toggle on/off
  195.     switch.  That is, if selection is ON, pressing SELECT again turns
  196.     selection off (cancels selection).
  197.  
  198.  
  199.  
  200. CUSTOMIZING:
  201.  
  202. Most EDT users, at one time or another, make some custom key bindings, or
  203. use someone else's custom key bindings, which they come to depend upon just as
  204. if they were built-in bindings.  This EDT Emulation for GNU Emacs is designed
  205. to make it easy to customize bindings.
  206.  
  207. If you wish to customize the EDT Emulation to use some of your own key
  208. bindings, you need to make a private version of edt-user.el in your own
  209. private lisp directory.  There are two sample files edt-user.el-1 and
  210. edt-user.el-2 for you to use for ideas.  Look at edt-user.el-1
  211. first.  Unless you will be using two or more very different types of
  212. terminals, you need not look at edt-user.el-2.
  213.  
  214. First, you need to add your private lisp directory to the Emacs load path in
  215. your .emacs setup file.
  216.  
  217. For example, if "~/lisp" is your personel emacs lisp directory, then the
  218. following line in your .emacs file will work:
  219.  
  220.         (set-variable 'load-path '("~/lisp" "/emacs/lisp" ))
  221.  
  222. If, on your system, Emacs fails to expand ~ correctly, then try
  223.  
  224.     (set-variable 'load-path '((expand-file-name "~/lisp") "/emacs/lisp" ))
  225.  
  226. VMS users will find that the following line will work after one replaces
  227. "userdisk" and "username" with the appropriate information:
  228.  
  229.  (set-variable 'load-path '("userdisk:[username.LISP]" "EMACS_LIBRARY:[LISP]"))
  230.  
  231.  
  232. NOTE:  A few sites have different load-path requirements, so the above
  233.        directions may need some modification if your site has such special
  234.        needs. 
  235.  
  236.  
  237. CREATING YOUR OWN EDT-USER.EL FILE:
  238.  
  239. You should use the edt-user.el-1 file as a guide to learn how you can
  240. customize EDT emulation bindings to your own liking.  Names used to identify
  241. the set of VT100/VT200 keypad and function keys are:
  242.  
  243. Keypad Keys:   
  244.                 PF1 PF2 PF3 PF4
  245.                 KP7 KP8 KP9 KP-
  246.                 KP4 KP5 KP6 KP,
  247.                 KP1 KP2 KP3 
  248.                 KP0     KPP KPE
  249.  
  250. Arrow Keys:
  251.                 LEFT RIGHT DOWN UP
  252.  
  253. Function Keys:
  254.                 F6 F7 F8 F9 F10  F11 F12 F13 F14  DO HELP  F17 F18 F19 F20
  255.                 FIND   INSERT   REMOVE 
  256.                 SELECT PREVIOUS NEXT
  257.  
  258. There are three basic functions that do the EDT emulation bindings:
  259. edt-bind-standard-key, edt-bind-gold-key, and edt-bind-function-key.
  260.  
  261. The first two are for binding keys standard across most keyboards, so they are
  262. keyboard independent and are defined in edt.el.
  263.  
  264. The first, edt-bind-standard-key, is used typically to bind emacs commands to
  265. control keys, although some people use it to bind commands to other keys, as
  266. well.  (For example, some people use it to bind the VT200 seldom used
  267. back-tick key (`) to the function "ESC-prefix" so it will behave like an ESC
  268. key.)  The second function, edt-bind-gold-key, is used to bind emacs commands
  269. to gold key sequences involving alpha-numeric keys, special character keys,
  270. and control keys.
  271.  
  272. The third function, edt-bind-function-key, is terminal dependent and is
  273. defined in the terminal specific file (see edt-vt100.el and edt-apollo.el for
  274. examples).  It is used to bind emacs commands to function keys, to keypad
  275. keys, and to gold sequences of those keys.
  276.  
  277. WARNING:  Each of these three functions has an optional last argument.  The
  278.           optional argument should NOT be used in edt-user.el!  When the
  279.           optional argument is missing, each function knows to make the
  280.           key binding part of the user's EDT custom bindings.
  281.  
  282.       The EDT default bindings are set up in edt.el by calling these same
  283.       functions with the optional last argument set to "t".  So, if you
  284.       decide to copy such function calls from edt.el to edt-user.el, BE
  285.       SURE TO DELETE THE "t" AT THE END OF EACH PARAMETER LIST!
  286.  
  287.  
  288. SPECIFYING WORD ENTITIES:
  289.  
  290. The variable edt-word-entities is used to emulate EDT's SET ENTITY WORD
  291. command.  It contains a list of characters to be treated as words in
  292. themselves.  If the user does not define edt-word-entities in his/her .emacs
  293. file, then it is set up with the EDT default containing only TAB.
  294.  
  295. The characters are stored in the list by their numerical values, not as
  296. strings.  Emacs supports several ways to specify the numerical value of a
  297. character.  One method is to use the question mark: ?A means the numerical
  298. value for A, ?/ means the numerical value for /, and so on.  Several
  299. unprintable characters have special representations:
  300.  
  301.             ?\b  specifies  BS, C-h
  302.             ?\t  specifies  TAB, C-i
  303.             ?\n  specifies  LFD, C-j
  304.             ?\v  specifies  VTAB, C-k
  305.             ?\f  specifies  FF, C-l
  306.             ?\r  specifies  CR, C-m
  307.             ?\e  specifies  ESC, C-[
  308.             ?\\  specifies  \
  309.  
  310. Here are some examples:
  311.  
  312.      (setq edt-word-entities '(?\t ?- ?/)) ;; Specifies TAB, - , and /
  313.      (setq edt-word-entities '(?\t)        ;; Specifies TAB, the default
  314.  
  315. You can also specify characters by their decimal ascii values:
  316.  
  317.      (setq edt-word-entities '(9 45 47))   ;; Specifies TAB, - , and /
  318.  
  319.  
  320. PRESERVING ORIGINAL GNU EMACS CONTROL KEY SEQUENCE BINDINGS:
  321.  
  322. Some users of GNU Emacs, who miss primarily the use of their EDT keypad
  323. trained right hand, prefer to have access to all the standard Emacs key
  324. bindings and just want the EDT Emulation to bind commands to the keypad keys,
  325. PF keys, and the other function keys.  So, where EDT bindings and GNU Emacs
  326. bindings conflict (control key sequences) these users perfer to retain the
  327. Emacs bindings.
  328.  
  329. If the variable edt-use-emacs-control-sequence-bindings is set to true in
  330. a user's .emacs file, then the default EDT Emulation mode will retain all
  331. the original GNU Emacs control key sequence bindings.  If you wish to do this,
  332. add the following line to your .emacs file:
  333.  
  334.         (setq edt-use-emacs-control-sequence-bindings t)
  335.  
  336.  
  337.  
  338. The following page contains some solutions to problems encountered by some GNU
  339. Emacs users.  Though not specifically EDT Emulation related, they are often
  340. needed by those who are interested in using the EDT Emulation.
  341.  
  342. HANDLING FLOW CONTROL PROBLEMS:
  343.  
  344. If you are using a DEC VT-series terminal, or similar terminal, which insists
  345. upon using ^S and ^Q for flow control, then you will probably want to add the
  346. following to your .emacs file:
  347.  
  348.         (setq terminal-uses-flow-control-chars
  349.               '("vt200" "vt100" "vt102"))
  350.  
  351. after modifying it to contain the list of terminals you expect to use which
  352. have this flow control problem.  This causes a special Emacs function,
  353. evade-flow-control, to be called when you are using any of the terminals
  354. specified in the list.  This function does two things: it tells Emacs to pass
  355. all ^S and ^Q characters received from the terminal onto the OS for handling
  356. AND it sets up a translate table which causes Emacs to treat a ^\ as if a ^S
  357. were entered from the keyboard and to treat a ^^ as if a ^Q were entered.
  358. This frees up ^S and ^Q to be used exclusively as flow control characters.
  359.  
  360.  
  361. VT TERMINALS WITH NO ESC KEY:
  362.  
  363. Support for using F11 as an ESC key is provided.  See vt-esc-sub.el for
  364. details. 
  365.  
  366.  
  367.                               DEFAULT EDT Keypad
  368.  
  369.    F7: Copy Rectangle             +----------+----------+----------+----------+
  370.    F8: Cut Rect Overstrike        |Prev Line |Next Line |Bkwd Char |Frwd Char |
  371.  G-F8: Paste Rect Overstrike      |   (UP)   |  (DOWN)  |  (LEFT)  | (RIGHT)  |
  372.    F9: Cut Rect Insert            |Window Top|Window Bot|Bkwd Sent |Frwd Sent |
  373.  G-F9: Paste Rect Insert          +----------+----------+----------+----------+
  374.   F11: ESC                       
  375.   F12: Begining of Line           +----------+----------+----------+----------+
  376. G-F12: Delete Other Windows       |   GOLD   |   HELP   |  FNDNXT  |  DEL L   |
  377.   F13: Delete to Begin of Word    |   (PF1)  |   (PF2)  |   (PF3)  |  (PF4)   |
  378.  HELP: Emacs Help                 |Mark Wisel|Desc Funct|   FIND   |  UND L   |
  379.    DO: Execute extended command   +----------+----------+----------+----------+
  380.                                   |   PAGE   |   SECT   |  APPEND  |  DEL W   |
  381.   C-g: Keyboard Quit              |    (7)   |    (8)   |    (9)   |   (-)    |
  382. G-C-g: Keyboard Quit              |Ex Ext Cmd|Fill Regio| REPLACE  |  UND W   |
  383.   C-h: Beginning of Line          +----------+----------+----------+----------+
  384. G-C-h: Emacs Help                 |  ADVANCE |  BACKUP  |   CUT    |  DEL C   |
  385.   C-i: Tab Insert                 |    (4)   |    (5)   |    (6)   |   (,)    |
  386.   C-j: Delete to Begin of Word    |   BOTTOM |    TOP   |   Yank   |  UND C   |
  387.   C-k: Define Key                 +----------+----------+----------+----------+
  388. G-C-k: Restore Key                |   WORD   |    EOL   |   CHAR   |   Next   |
  389.   C-l: Form Feed Insert           |    (1)   |    (2)   |    (3)   |  Window  |
  390.   C-n: Set Screen Width 80        | CHNGCASE |  DEL EOL |Quoted Ins|          !
  391.   C-r: Isearch Backward           +---------------------+----------+  (ENTER) |
  392.   C-s: Isearch Forward            |         LINE        |  SELECT  |          !
  393.   C-t: Display the Time           |         (0)         |    (.)   |   Query  |
  394.   C-u: Delete to Begin of Line    |      Open Line      |  RESET   |  Replace |
  395.   C-v: Redraw Display             +---------------------+----------+----------+
  396.   C-w: Set Screen Width 132       
  397.   C-z: Suspend Emacs                    +----------+----------+----------+
  398. G-C-\: Split Window                     |  FNDNXT  |   Yank   |   CUT    |
  399.                                         |  (FIND)) | (INSERT) | (REMOVE) |
  400.   G-b: Buffer Menu                      |   FIND   |          |   COPY   |
  401.   G-c: Compile                          +----------+----------+----------+
  402.   G-d: Delete Window                    |SELECT/RES|SECT BACKW|SECT FORWA|
  403.   G-e: Exit                             | (SELECT) |(PREVIOUS)|  (NEXT)  |
  404.   G-f: Find File                        |          |          |          |
  405.   G-g: Find File Other Window           +----------+----------+----------+
  406.   G-h: Keypad Help
  407.   G-i: Insert File
  408.   G-k: Toggle Capitalization Word
  409.   G-l: Lowercase Word or Region
  410.   G-m: Save Some Buffers
  411.   G-n: Next Error
  412.   G-o: Switch to Next Window
  413.   G-q: Quit
  414.   G-r: Revert File
  415.   G-s: Save Buffer
  416.   G-u: Uppercase Word or Region
  417.   G-v: Find File Other Window
  418.   G-w: Write file
  419.   G-y: EDT Emulation OFF
  420.   G-z: Switch to User EDT Key Bindings
  421.   G-1: Delete Other Windows
  422.   G-2: Split Window
  423.   G-%: Go to Percentage
  424.   G- : Undo  (GOLD Spacebar)
  425.   G-=: Go to Line
  426.   G-`: What line
  427.