Google
 

Trailing-Edge - PDP-10 Archives - mit_emacs_170_teco_1220 - emacs/vt100.emacs
There are no other files named vt100.emacs in the archive.
!* -*- TECO -*- !
!* <EMACS>VT100.EMACS.41, 15-Jul-82 08:50:56, Edit by GERGELY!

!~Filename~:! !A library for hacking EMACS on VT100's!
VT100
!& Setup VT100 Library:! !Things to do when this library loads
Define keypad handler, Redefine ^X), etc... !

    [0 [1

    0fo..q Exit_to_Inferior_hooku1 
    fq1"l :i1'
    @:i*`1wm(m.m VT100_Normal_Keypad)`m.v Exit_to_Inferior_Hook

    0fo..q Exit_to_Superior_Hooku1 
    fq1"l :i1'
    @:i*`1wm(m.m VT100_Normal_Keypad)`m.v Exit_to_superior_hook

    0fo..q Return_From_Superior_hooku1 
    fq1"l :i1'
    @:i*`1wm(m.m VT100_Alternate_Keypad)`m.vReturn_From_Superior_hook

    0fo..q Return_From_Inferior_hooku1 
    fq1"l :i1'
    @:i*`1wm(m.m VT100_Alternate_Keypad)`m.vReturn_From_Inferior_Hook

    m(m.m VT100_Alternate_Keypad)	    !* Put terminal in alt keypad mode!
0"n
    fs osteco"n
      m(m.aTRMTYP#_Trmtyp_VT100V)-fsrgetty"'e+(
      m(m.aTRMTYP#_Trmtyp_VT100X)-fsrgetty"'e)"n
        FT VT100_library_works_with_terminal_in_ANSII_mode_only.
	   Use_terminal_type_VT100_or_VT100W.'''
    m.v VT100_Dispatch_Table
    128m(m.m Make_Prefix_Char)VT100_Dispatch_Tableu..O
    qVT100_Dispatch_Table[0
    qPrefix_Char_List[3
    :iPrefix_Char_List3 Keypad__qVT100_Dispatch_Table

    m.m ^R_Up_Real_Lineu:0(A)    !* Uparrow!
    m.m ^R_Down_Real_Lineu:0(B)  !* Downarrow!
    2fs^R Init u:0(D)	    !* Leftarrow = C-B.!
    6fs^R Init u:0(C)	    !* Rightarrow = C-F.!
    m.m ^R_VT100_Define_KBD_Mac u:0(M)    !* Enter starts or stops keyboard macro.!
    m.m ^R_VT100_Comma u:0(l)   !* Comma!
    m.m ^R_VT100_Minus u:0(m)    !* Minus sign on numeric keypad.!
    m.m ^R_Documentation u:0(n)  !* Dot!
    m.m ^R_VT100_Arg_Digit[1
    p-1[2
    10< q1u:0(%2) >		    !* Digits on numeric keypad.!
    0fo..q VT100_Setup_Hooku1
    q1"n m1'
    
!VT100 Alternate Keypad:! !C Sets alternate keypad mode for VT100's
When this command is executed, the numeric keypad can be used to enter
arguments for the following function.  Numbers are entered as themselves,
dot and "enter" key on the pad are also changed.!

 :I*=[?1hFS IMAGE OUT	    !* Put VT100 in application mode !
!VT100 Normal Keypad:! !C Undos alternate keypad mode for VT100's
When this command is executed from a VT100, the keys on the keypad become
functionally identical to the standard digit keys.  See VT100 Alternate Keypad
for a description of the alternative.!

 :I*[?1l>FS IMAGE OUT
!^R VT100 Define Kbd Macro:! !^R Start or Stop defining kbd macro.
When stopping, we ask for a key to to place the kbd macro on.!

    fs tyi sink"e		    !* If not defining something, !
      F@:m(m.m ^R_Start_Kbd_Macro)'	    !*  Start definition !
    "#
      1m(m.m ^R_End_Kbd_Macro)	    !* Else stop defining!
      m(m.mName_Kbd_Macro)'	    !* and put the definition somewhere.!
    
!^R VT100 Minus:! !^R Negate numeric argument.!
     -u..1 :m(q..1+200.@fs^R Init)
!^R VT100 Arg Digit:! !^R Digit of numeric argument.!
     q..1-p+0u..0 :m(q..0+200.@fs^R Init)
!^R VT100 Comma:! !^R Run precomma arg!

    0fs^RArg 0fs^RArgp			      !* Zero argument !
    ,@m(@fif(f(fs^Rlastw)u..0)@fs^RCmacro)@v  !* Call first char specially !
    <fs^RLast:@;				      !* Loop macroing chars !
    ,(fs^RArgp"n
	 fs^RArgp&2"nfs^RArgp&4"n-1*'(fs^Rarg)'"#1[0fs^RExpt<q0*4u0>q0(]0)'(
	 )')@m(@fif(f(fs^Rlastw)u..0)@fs^RCmacro)@v>
    0
!C132 Mode:! !C Put VT100 in 132 column mode and change ^S/^Q
^R Incremental search becomes ^\. ^Q inside search becomes ^^.
Outside of searches, you must use ^^Q to quote a character.!

     m(m.mVT100_Page_Mode)	    !* Set new incremental search cmds!
     :i*[?3hfs image out	    !* Set 132 column mode!
     131fs width
     -1fs pjatyf+		    !* Need to refresh whole screen!
!C80 Mode:! !C Put Vt100 in 80 column mode (see C132 Mode)!

     -1m(m.mVT100_Page_Mode)	    !* Set new incremental search cmds!
     :i*[?3lfs image out	    !* Set 80 column mode!
     79fs width
     -1 fs pjatyf+		    !* Refresh screen!
!VT100 Page Mode:! !C Set Page Mode and change incremental search cmds.
 C-X C-S becomes C-X S
 C-X C-Q becomes C-X ~
 C-S becomes C-\
 C-Q within a search becomes C-^
 C-Q outside a search becomes C-^ Q (or C-` Q on VT100 kbd).

To insert a bare ^Q type M-*.

A negative arg turns this lossage off.!

    fsrunt&1"E !"! :FT You_poor_loser!
Haven't_you_learned_YET_never_to_buy_DEC_terminals?'
    "# :FT You_should_sell_this_piece_of_junk
and_buy_an_Ann_Arbor_Ambassador!'
    FT

    90 0U..H
    "L
      Q.S FO..Q Search_CommandU.S
      M.V Search_Quote
      m.m^R_Quoted_InsertU.Q
      Q.B U
      1fstt pag wfsttyinit
      '
    -1fstt pag mode		    !* Disable Xon/Xoff processing!
    :i*-1fstt pag modeU.S	    !* If EMACS drops page mode - this will!
    :i*-1fstt pag modeU.Q	    !*  re-init it (I hope).!
    0fo..qSearch_Command"e
     m.vSearch_Command'
    0fo..qSearch_Quote"e
     m.vSearch_Quote'	    !* C-^ becomes search quote.!
    QSearch_CommandU.\	    !* C-\ is search command.!
    Q:.X()U:.X(S)		    !* C-X C-S becomes C-X S!
    Q:.X()U:.X(~)		    !* C-X C-Q becomes C-X ~!
    :i*21.iU..*		    !* M-* inserts bare ^Q!
    m.m^R_Quoted_Insert,8fs^R CMAC    !* Backspace becomes C-Q!
    
!* 
/ Local Modes: \
/ MM Compile: 1:<M(M.MDate Edit)>
M(M.M^R Save File)
M(M.MGenerate Library)VT100VT100
1:<M(M.MDelete File)VT100.COMPRS>W \
/ End: \
!