From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 15-FEB-1991 03:44:19.24
To:	ARISIA::EVERHART
CC:	
Subj:	Useful edtini.ini file and a Summary

From:	RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.83)
	 id AA22614; Fri, 15 Feb 91 03:27:45 EST
Received: From UCBVAX.BERKELEY.EDU by CRVAX.SRI.COM with TCP; Thu, 14 FEB 91 20:26:32 PST
Received: by ucbvax.Berkeley.EDU (5.63/1.42)
	id AA07482; Thu, 14 Feb 91 20:08:31 -0800
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 15 Feb 91 04:05:17 GMT
From: usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!davis@ucsd.edu  ("John E. Davis")
Organization: "Dept. of Physics, The Ohio State University"
Subject: Useful edtini.ini file and a Summary
Message-Id: <DAVIS.91Feb14230517@pacific.mps.ohio-state.edu>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

Hi,

   Included below is an edtini.edt file in which I wrote.  This edtini.edt
file has the following features:

1.  Keypad keys are untouched (default setting).
2.  Extensive Gold/control key definitions (makes keypad obsolete)
3.  Some emacs emulation.
4.  Special modes:  Fortran_mode, Dcl_mode, Text_mode, No_mode
5.  Extensive online help (control h and Gold ?)
5.  New editing functions (double current line, transpose lines,etc)
6.  Set Mark and return to mark to remember buffer position.
7.  Insertion of control chars made easy (eg. GOLD `a RET ===> ^A)
8.  A special macro (eval_line) for developing .edt files
9.  Better File and Buffer manipulation support.
10. The screen can scroll left and right to edit beyond physical terminal
     screen width (GOLD left arrow and GOLD right arrow).

For example, In Fortran_Mode, the RETURN key (^M) inserts a return and indents
to column 7.  Control-J inserts a return and puts a continuation character (&)
in colum 6 and leaves the cursor in column 8. `GOLD c' puts a `C' in column 1
of the next line.  This way, the key combination `GOLD 10 GOLD c' effectively
comments out the next 10 lines of code. Finally, the key `GOLD r' inserts a
ruler above the current line showing columns 5,6,7 and 72.

The key `GOLD ?' gives a short help screen on the current mode.


Bugs:  The only problems in which I am aware are due to edt's lack of
conditional processing.  For example, if one sets a mark some place in the
buffer then never returns to the mark, the mark is left in the file.  To
combat this problem, I have made a mark which will blink <mark> when the file
is typed out.  Because of this same limitation, the special modes are not all
that powerful.
   In addition, although edt says that the control-x key is definable the
terminal driver will not allow edt to see it.  To avoid this, one has to do a
`set terminal/passthru' at the dcl level.  I do this for myself then define
control-x as gold.  However, I leave this decision up to you so I have not set
the gold key in the file below.  I personally see this as a bug in the change
mode of edt.  It would be nice if the passthru option were allowed with edt's
`set terminal' line mode command.

Finally I want to thank the following people for sending me sample .edt files
and responding to my edt questions:

 wallyk%bicycle.wv.tek.com, 2wsa070@gc.bitnet, sigler@wheel.enet.dec.com,
 fox@rudolf.nscl.msu.edu, mcmahon@grin1.bitnet, xberri@arecibo.aero.org,
 ternent@wkuvx1.bitnet, pawhite@admin.okanagan.bc, kenw@noah.arc.ab.ca  
 don@zl2tnm.gp.co.nz, hapritch@mwvms.mitre.org, carl@sol1.gps.caltech.edu,
 forveill@frgag51.bitnet
    
Any questions should be sent to me:
bitnet: davis@ohstpy
internet: davis@pacific.mps.ohio-state.edu

Good Luck.  The help file follows then the edtini.edt file.  Be sure to make
the edtini.edt file point to where the help file is kept.

-----------------(cut here for help file)---------------------------------
				HELP:
	      hit GOLD <space_bar> to return to editing
		   Use arrow keys for moving around
		      Ctrl==CONTROL  Gld == GOLD

		       ----BASIC MOVEMENTS----
TAB    :== tab set to 4 spaces
Ctrl a :== beginning of line         Ctrl e   :== end of line
Gld UP :== top of buffer             Gld DOWN :== bottom of buffer
Gld <  :== top of buffer             Gld > :== bottom of buffer
Gld v :== page down                  Ctrl v :== page up
Gld m :== mark this spot             Gld RET :== return to mark
Gld RIGHT :== shift screen right 40 columns
Gld LEFT  :== shift screen left 40 columns 
Gld l :== goto line
		      ----DELETE--CUT--PASTE---
Ctrl d :== delete character          Gld w :== copy region to paste buffer
Gld Ctrl w :== cut region            Ctrl p :== paste
Ctrl k :== delete thru eol to paste buffer
Ctrl @ :== select
		      ----SEARCH and REPLACE----
Ctrl f :== find forward    Gld f :== find backward   Gld q :== query replace
		      ----FILES and BUFFERS----
Gld b :== switch buffers                      Gld i :== insert file
Gld Ctrl w :== write file                     Gld Ctrl f :== get new file
Gld r :== write region
			     ----MISC----
Gld d :== execute line edit command        Gld ? :== describe mode
Ctrl r :== redraw screen                   Gld t :== transpose two lines
Gld ` :== Insert Control Char              Gld e :== exit saving buffer
Gld Ctrl l :== duplicate line              Ctrl h:== this help
			    ----MODES----
There are currently 4 modes:
fortran_mode  : for editing fortran files
dcl_mode      : for editing dcl .com files
text_mode     : for editing text files (default)
no_mode       : useful for other languages

To enter a mode, hit 'Gld d' and enter the mode name.
eg.  'Gld d fortran_mode' will enter fortran_mode
Note that 'Gld ?' is help for a particular mode
			 ----SPECIAL HINT----
'Gld n command'   repeats command n times.
e.g.  'Gld 10 Gld Ctrl l '  inserts 10 copies of current line
      'Gld 50 d'            inserts 50 d's

---------------- hit GOLD <space_bar> to return to editing------------

-----(end of help file)------(cut here)----------------------------------

-----(edtini.edt)------------(cut here)---------------------------------
!                      -- Edt startup file --
!
!      modes: fortran_mode, dcl_mode, no_mode, text_mode (default)
!
!                     --John E. Davis 2/13/91--
!
include dev$user:[davis.edit]edt.help =help_buffer  !help file
set nonumbers
set cursor 0:21                        !curser moves on full screen
set search ci                          !case insensitive
define key control i as "i    ^Z."     !tab set to 4 spaces
!
! define key control x as 'gold'  !only if do 'set terminal/pasthru at dcl level'
!
!  basic buffer movements
!
define key gold 12 as "br."            !top of buffer    (gold up arrow)
define key gold < as "br."             !top of buffer    
define key gold 13 as "er."            !bottom of buffer (gold down arrow)
define key gold > as "er."             !bottom of buffer
define key control a as "+l -l."       !beginning of line
define key control e as "el."          !end of line
define key control v as "(-20l)."      !page up
define key gold v as "(20l)."          !page down
define key gold l as "br+?*'line: 'l." !goto line
!
!  basic deletion/insertion commands
!
define key control d as "dc."          !delete character
define key control k as "sel+l cutsr." !delete through eol to paste buffer
define key gold control l as "(+l -l sel el adv c cutsr paste paste -l)."
                                       !duplicate line
define key gold t as "+l -l sel+l cutsr -v +l -l paste +v."
                                       !transpose two lines
!
!  cut paste commands
!
define key gold control w as "cutsr."          !cut region
define key gold control @ as "sel."            !select
define key gold w as "cutsr paste."            !copy region to paste buffer
define key control p as "paste."               !paste
!
!  search and replace
!
define key control f as "'?*'f Find: ''."      !find forward
define key gold f as "-'?*'b Find: ''."        !find backward
define key gold q as "+ext subs/?*'replace: '/?*'   with: '/rest/q." ! query replace
!
!  basic file commands
!
define key gold control w as "ext write ?*'write file: '."           !write file
define key gold r as "ext write ?*'write region to file: ' select."  !write region
define key gold i as "ext incl ?*'insert file: '."                   !insert file
!
!  buffer commands
!
define key gold b as "ext find=?*'switch to buffer: '.."       !switch buffers
define key gold control f as "ext incl ?*'file: ' =?*' buffer: ';change; br."   !get new file
!
!  misc commands
!
define key gold ` as '^?*.'              !insert control char
define key gold e as "ext exit."         !exit saving buffer
define key control r as "ref."           !redraw screen
define key gold 14 as "(5shl)."          !shift screen right 5x8 columns
define key gold 15 as "(5shr)."          !shift screen left 5x8 
define key gold d as "ext ?*'command: '."!execute line edit command
!
!  help
!   
define key gold ? as "ext describe_mode."  !describe mode
define key control h as "ext do_help."     !this help
!
!  macros
!
define macro describe_mode
  find=describe_mode
  insert ;find =mode_help
  insert ;define key gold " " as "ext find last ; def key gold ' ' as '.'."
define macro do_help
  find=do_help
  insert ;find =help_buffer
  insert ;define key gold " " as "ext find last ; def key gold ' ' as '.'."
define macro eval_line         !evaluates current line of .edt file
  insert=eval_line             !useful for debugging
  define macro test_edt_
  copy to =test_edt_ 
  test_edt_
  clear test_edt_
^Z
!
!  mode macros
!
define macro dcl_mode
  find=dcl_mode
  insert ; clear mode_help
  insert ; find  =mode_help
  insert ; insert ; DCL Mode: specialized mode for editing DCL .COM files.  Normal
  insert ; insert ; editing keys except:
  insert ; insert ;     
  insert ; insert ; <RET>  : inserts a newline then puts '$ ' in column 1
  insert ; insert ;
  insert ; insert ;           Hit gold <space> to return to editing
  insert ; define key control m as "^M i$ ^Z."
  insert ; set prompt line "dcl_mode: " 
  insert ; find last 
!
define macro fortran_mode
  find=fortran_mode
  insert ; clear mode_help
  insert ; find  =mode_help
  insert ; insert ; Fortran Mode: specialized mode for editing FORTRAN files.  Normal
  insert ; insert ; editing keys except:
  insert ; insert ;     
  insert ; insert ; <RET>  : inserts a newline and indents to column 7.
  insert ; insert ; ^J     : inserts '&' as a continuation card in column 6
  insert ; insert ; gold r : puts a ruler in line above the present one
  insert ; insert ; gold c : Inserts comment char 'C' on next line
  insert ; insert ;
  insert ; insert ;           Hit gold <space> to return to editing
  insert ; define key control m as "^M i      ^Z."
  insert ; define key gold c as "(+l iC ^Z)." 
  insert ; set prompt line "fortran_mode: " 
  insert ; set wrap 72
  insert ; define key gold r as "+l -l iC   567^Z +62(i ^z)i72|^z^m."
define key gold r as "+l -l iC   567^Z +62(i ^z)i72|^z^m."
  insert ; define key control j as "(^M i     &  ^Z)."
  insert ; find last 
define macro text_mode
  find=text_mode
  insert ; clear mode_help
  insert ; find  =mode_help
  insert ; insert ; TEXT Mode: specialized mode for editing plain text files.  Normal
  insert ; insert ; editing keys except lines are wrapped at column 74:
  insert ; insert ;     
  insert ; insert ;           Hit gold <space> to return to editing
  insert ; define key control m as "^M."
  insert ; set wrap 74
  insert ; set prompt line "text_mode: " 
  insert ; find last 
define macro no_mode                                !generic mode
  find=no_mode
  insert ; clear mode_help
  insert ; find  =mode_help
  insert ; insert ; No Mode: not specialized to edit anything in particular. Normal
  insert ; insert ; editing keys except there is no wrap and lines are truncated.
  insert ; insert ;     
  insert ; insert ;           Hit gold <space> to return to editing
  insert ; define key control m as "^M."
  insert ; set nowrap
  insert ; set truncate
  insert ; set prompt line "no_mode: " 
  insert ; find last 
!
!  marking commands
!
define key gold m as 'i[5m<ma^Z irk>[0m^Z.'             !mark spot
define key gold control m as 'br "[5m<mark>[0m" 15dc.'  !return to mark
!
!  and now....
!
text_mode
find=main
set mode change
!      "dew."         !delete word
-------------------------------------(cut here)---------------------------
--
John

  bitnet: davis@ohstpy
internet: davis@pacific.mps.ohio-state.edu

