Trailing-Edge
-
PDP-10 Archives
-
mit_emacs_170_teco_1220
-
emacs/zed.tec
There are no other files named zed.tec in the archive.
! ZED is a collection of ^R macros, and a few auxiliary macros. Some of
these communicate with each other, defining ZED's language. Others
(such as <space>,<tab> and \ (or backspace)) have little interaction
with the rest of the system other than to keep it up-to-date on what has
changed. The user who wants to incorporate his own macros into ZED can do so,
whether or not they communicate with ZED. ZED does not destroy
the contents of Q-registers with 0 or 1 period in their name.
The user may set flags for various options by setting bits in Q..U.
User flags:
2: silence **SAVING**.
8: manual fill.
16: turn on ^H hack.
32: can save into other directories.
64: dev:area; sticky.
Q-REGISTER USAGE:
..3 Flags set by command modifiers:
1 UNDERLINE 2 UNDERLINE-REMOVE
4 KASE-LOWER 8 KASE-UPPER
16 JUSTIFILL 32 JUSTIFY
64 DUMP 128 DUMP-OUT
256 ERASE 512 ERASE-OVERLAY
1024 RIGHT-END-OF 2048 DIGIT SEEN
4096 HOLE 8192 NEGATIVE
16384 ^ SEEN
..4 Sign for ..5 (normally plus or minus 1, but BB -> -2)
..5 Numeric argument (>0, sign in ..4)
..6 String defining what is a paragraph
..7 Other end of OBJECT
..8 This end of OBJECT
..9 ZED's idea of . (not always TECO's)
..R The Read-user-string macro
..S Flag specifying whether in insert mode, and how to exit
..T The tidy-up-afterwards macro
..U User flags
..X The eXecute macro
..Y Where Undo gets the old version from
DQRS ZED'S Q-registers (for DUMP and GET)
DQRP currently selected ZED-Q-register
MODIF 0 -> ZED (not TECO) has modified buffer
UndoLO Low end of what Undo should remove
UndoHI High " " "
UndoPTR Where . should go on Undo
EXIT 0 or a TECO command string executed on leaving the file
!
FTLOADING ZED
[0[1[2[B
! Macro to build symbol tables !
^:ID= Q..Q[..O
[0 :I0
[1 :FO..Q0U1
Q1"L -Q1*5J 10,0I
10R Q0,.FSWORD' ]1]0]..O=
! ZED's own Q-registers !
MD..J MDDQRS MDDQRP MDMODIF MDUndoLO MDUndoHI MDUndoPTR MDHDRPOS
MDEXIT MDSLOW MDCTS MDCTSN MDNTS MDSPW MDSAVINT MDSTDFONTS MDSTDMAP
MDOWIDTH MDFORMAT MDHPOS MDJCL MDFILELOCS MDDIRLOC
! Initialization !
^:I..L\.,(FJ.)FXJCL
GJCL I 0,1F=(0,.K)"E
:IJCL[ZED].TEM EI 1FS^ LINSERTW PW EF[ZED].TEM HK'
Z"N .(J GJCL
"#.*(I 0,2F=
)*(0,3F=PS:(0,.K ))"E )J '' )J'
1FS^ L INSERTW 0FS^ MPRINTW -FS^ HPRINTW 79FSADLINEW 0FSLINESW 1FS^RECHOW
FSTTY INITW -FS^IDISABLEW -FSNOOPALTMODESW FSRGETTYFSTTMODEW
:I*M..FFSCLKMACROW 18000FSCLKINTERVALW 18000USAVINTW 0UHPOSW
:ISTDFONTS;KSET XFONT;TIMES 12SAIL, FONTS;S30GRK, XFONT;TIMES 12ITAL, FONTS2;12SCRP, FONTS;35VRB, FONTS2;SYMBOL
^:ISTDMAP|:*r-!-*, _:*r-!-*, :*-!-*u,
^:*-!-*u, %:-!- , `:1:<FWL>WI ,
@:1:<FWL>WI , $:-!- , &::CWI , #:C,|
500FSQVECTORUDQRS 1UDQRP 1UMODIF
0UUndoLO 0UUndoHI 0UUndoPTR 7UHDRPOS 0UEXIT 0UOWIDTH
0USLOW FSRGETTY-9"N 1USLOW' FSOSPEED-600"G 1USLOW'
100FSQVECTORUCTS 16USPW
! Now set up ^H$%'-./[]{|}_ in ..D !
HK G..D 40JDIA 180JDI 185JDI 195JDIA 225JDIA 230JDI 236JDIA
456JDI( 466JDI) 616JDI( 621JDIA 626JDI) HFX..D
^:I..6|
|
HK 0U..3 0U..9
-FSFNW ETX
1:<ERZED.INIT>"E @Y 1UMODIF
[B HFXB MB ]B'
:I..JAlter Mode Visiting dir Default:
Q..JU..J
J 0,0X..B
GJCL <14,0A-14; -D> 0,0A-."E-D'
0,1F="E 0,.K I[ZED].TEM'
FSMSNAMEUA 0,FQAF=A"E .-FQA(0,FQAK)J'
."G .+(J 0,54G..J 54)J 72-."G 71-.,32I' 0,.FX..J
[..R 0,0X..R MV 0U..H ]..R'
"# HK 1:<EM>W
J <:L -S,; :K L .-Z"E0;'>
J <S,; R F C FSHPOS-24"L 9I FSHPOS-24"L 9I''"# <24-(FSHPOS); -D>' L>
J <S,; R F >
J FS MSNAMF6
I
File Name Size Created Last Referenced
'
FSRGETTY"E :I..AO#$
^:I..B=FS^RMODE"E Q..H"N 0U..H 0''[0[1[2[3 FF"E 20U0 20U1'
"#FF-1"EFU0Q0U1'"#FU1U0''
.U2FSSHPOSU3 0L Q3-Q0"G 1:<0,Q3-Q0:FM>"N Q2J 0L Q2-Q0-."G Q2-Q0J''' I
Q2+2J FSSHPOSU3 :L
FSSHPOS-Q3-Q1"G Q2+2J 1:<0,Q3+Q1:FM>"N Q2+2J :L .-Q2-Q1"G Q2+Q1J''' I
Q2+2J
1A-13"N Q3,32I Q3R 3<0FSIMAGEOUT> FT
' T0T 1A-13"N Q3D' :LK 0:LK Q2J = M..BW'"#0,0X..B'
! Default paragraph identification !
Q..9J Q..9U..7 Q..9U..8 -U..S
Q..BU.B M..TW \
!******** Auxiliary Macros ********!
! Macro To Save File Automatically !
^:I..F|QSAVINTFSCLKINTERVALW F?
[0[1[..J FSDFILEU0 FNET0 0
FSRGETTY"E FF"E Q..U&2"E IFT
0T0 FK ^FX..N'''
FS^ RMDLYFS^ RMCNTW
22,46G..J
.+FK(FK :FB:;<"L Q..U&32"E 13 :FB_MAIL_ _EDIT_"E )J 24D 0'''
)J 24 X0 -FSFN(ET0)FSFN
24 (1:<FWL FKC>W -FSBOTHC(4 :FBDIR ([0)U0)FSBOTHCW Q0(]0)"L
10 :FB "E )K 0'')K
Z"N QMODIF&1"E EIPWEF Q..S"L 1UMODIF'
Q..U&2"E FS O FILE:F6U0 ^ FT
++Saving 0++'
! 1A-."E 2A-0'"#1' (2D) "E
0FSFN(ER.<)FSFNW .,(EG).(-3:L 0X0 -FWL Q1-(\)U1)K
Q1-3"G Q..U&2"E ^ FT--Deleting 0--' ED' ET>'
!
Q..U&2"E ^ FT
0^ V'' 0'
"# 1:<ER>"L EC FF"E ^ FT
No prior version saved on directory.
' 0'
@Y ^ V HU..8U..7 0U..3 QMODIF1UMODIF
FS I FILE:F6U0
<^ FT
Reviving 0. keep or delete ?
1F<!TOP!M..R>"E 54,60G..JFK FX1
F~1DELETE"E ^ FT --deleted-- ED HK 0U..7 0U..8 0;'
F~1KEEP"E ^ FT ++kept++ 0'' FG ^ FT???
>'0 |
! The Read-string macro !
^:I..R|[0[..J IRead Mode 12,999G..JFK-12 FX..J QSLOW"N FR' ^ FT:
:FI-"E FIW 54,999G..JFK FX0 ^ FT0'"# 0,54G..JFK FX..J
<FIU0 Q0-127"E FQ..J-55"L ^FT **Cancelled**
M..TW 0FS^RTHROW'
G..J R FK+1 FX..J 1AFSECHO OUT D'
"# Q0-"E:FI'"#Q0'FSECHOOUTW Q0-"E 0;' Q0-"E FIU0'
Q0-13"E 10FSREREADW'
Q0I - ^ FX..J'>'
]0 0,12G0FK(12,999G..JFK) FX..J ]0 QSLOW"N Q..JU..J FR'"#
:^I*/Y/FSIM 55-(FSECHOL)FSIM 86FSIM 54,999:G..JFSIM :^I*/K/FSIM' |
! The Tidy macro !
^:I..T| 1:<FSRGETTY"N^ FT
' Q..3&4096"N Q..9J '
1UDQRP 0U..3 1U..4 1U..5 Q..SFS^RSUPW FSHPOSUHPOS .FSPUSHPTW>W0 |
! The eXecute macro !
^:I..X|Q..5-1"N^ FTs' Q..3&1777."E M..B :M..T'
Q..3&1477."N 0UMODIF' Q..7,Q..8F FSBOUW Q..3&1577."N HX..Y'
Q..3&1"NJ Q..U&4"E<:C;(0A-8)*(0A-)"G0A-_"NI_''>'"#25IZJ24I''
Q..3&2"NJ Q..U&4"E<S_;>'"#<S;-D>''
Q..3&4"N HFC'
Q..3&8"N H^FC'
Q..3&16"N J <S.
; 2R 32I> H^ FA'
Q..3&32"NJ<S ;2RD>J<S. ? ! ; 32I>HFA'
Q..3&64"N QDQRP-100"L Q..3&63"N HX*'"#Q..Y'U:DQRS(QDQRP)'
"#FG ^ FT The limit is 99''
Q..3&128"NFT
HTFT
'
Q..3&256"NHK'
Q..3&512"NZJ0L:<2R0K>WZJ0L:<1A-8*(1A-13)"GD'"#C'>W'
BUUndoLO ZUUndoHI Q..9UUndoPTR
Q..9-B"G Q..9-B-FQ..Y+1"G H +Q..9-FQ..YU..9'"#Q..9-B*(H )/(FQ..Y)+BU..9''
Q..8-Q..7"L HU..8U..7'"# HU..7U..8' Q..8J 0,FSZFSBOU(Z"E M..F'
M..TW M..BW FSRGETTY"E )W0'"#)'|
! The Formatting Macro !
^:IFORMAT{250FSQVECTOR[7 250FSQVECTOR[8
M..FW Q..O[0 F[BBIND Q..OU9 G0
-FSBOTHCASE[1
0[2 0[3 128[T 200[L 124[B 6[V 31[F -100[P 0[T 0[S 0[E 1[Q 0[G 0[C 0[D 0[X 11[Z
! Process trailer info!
ZJ 4:RW -:S
"N FKC 0,1A--"E 0,2A--"E L
.(:SSTD"N 1UP 1UX 200UT QTUB :IS :IE
:SMAP"E ZJ IMAP '"# 999:S:W :S
"N ZJ'"#FKC' I, ' GSTDMAP')J
.(:STOP"N SWR :\UT')J
.(:SLFT"N SWR :\UL')J
.(:SBOT"N SWR :\UB')J
.(:ST&B"N SWR :\UTQTUB')J
.(:SVSP"N SWR :\UV')J
.(:SFSP"N SWR :\UF')J
.(:SPAG"N SWR :\UP')J
.(:STAB"N SWR :\UG')J
.(:SSIZ"N SWR :\UZ')J
.(:SULS "N .,(<S W R 0A-?"N 0;' -D C>).XS')J
.(:SULE "N .,(<S W R 0A-?"N 0;' -D C>).XE')J
.(:SSQU"N 0,2A-0"E 0UQ'"#1UQ'')J
.(:SFFC"N 1UC')J
.(:SDAT"N 1UD')J
.(:SDEL"N 0,2A-0"E 0UX'"#1UX'')J
QV+QFUF
F-2"E.+(
:SFONTFNTKSET"L R FWL G(X*(J I;KSET))'
"#:SSTD"N J GSTDFONTS'"# J''
QT-128"N I;TOPMAR QT-(QD"NQF'"#0')\ 13I10I'
QL-200"N I;LFTMAR QL\ 13I10I'
QB+QP-24"N I;BOTMAR QP+100"G 0'"#QB'\ 13I10I'
QV-6"N I;VSP QV\ 13I10I'
QZ-11"N I;SIZE QZ\ 13I10I'
QQ"N I;SQUISH 13I10I'
QC"N I;FFCUT 1 13I10I'
QD"N I;HEADER . QHDRPOS,9I FSDATEFSFDCONVERTW -3D 13I10I'
QX"N I;DELETE 13I10I'
."G I;SKIP 1
'
.)J'
:SMAP"L
.,.X3
<S:; -S ,
; C
.[0 Q2"G 15I'
<(1A-2)*(1A-14)*(1A-15)*(1A-17)*(1A-24)"E 17I'
C 1A-:"E 0A-?"N 0;'"#-D''>
Q0,.^X3 ]0
C .,(73I :S, ,
-!-"L FKC'"#:L' 27I .)^X:7(%2) 0,1A--"N 0U:8(Q2)'"#
3C .,(73I :S, ,
"L FKC'"#:L' 27I .)^X:8(Q2)'>'
ZJ -S
--W L.,ZK J :S
W'"#J''"#J''"#J' Q1FSBOTHCASEW .U1
! Process file !
! Convert tabs to spaces if requested !
QG"N 0S W J
<:S;-DQG-(FSSHPOS-(FSSHPOS/QG*QG)),32I>'
! Convert underlines if requested !
QS"N <S_;-2A-20"G3RGS:<2A-8"N0;'3A-_"N0;'CDD>WGE'> Q1J'
! Apply map !
Q3"N <:S3[2 Q2"E ]2 ;'
-A-127*(-2A-127&777.+(-A&774.))"N
FKD Q:8(-Q2)"EM:7(-Q2)'
"#M:7(-Q2) .[X
<.,.+1:FB3;>
1A-40"E 1:<.(FLL-D.[R)JDQR-1J]R>"NC''"#:CW'
M:8(-Q2) QXJ ]X'' ]2>Q1J'
! set tabs !
0J F<!X! 0UCTSN !<! :S. >
"N -L <:S
.<!>!+1; FSHP-1*QSPW+QL U:CTS(QCTSN) %CTSN> -K' .(!<! :S. >
"E ZJ'"# -L' .UNTS)J <:S |
"E F;X' 2R .-QNTS"G QNTSJ 0;'
-2D QNTS-2UNTS .[0 0L 0[1
<I Q:CTS(Q1)U2 Q2/128I Q2I Q0+5U0 QNTS+5UNTS
%1W Q1-QCTSN;
<0,1A-9"N0;' D Q0-1U0 QNTS-1UNTS>
S ; R .-Q0;
<0,1A-9"N 0;' D Q0-1U0 QNTS-1UNTS>> ]1 ]0>>
! paginate !
QP+100"G Q1J QP-1UP [9 <%P-1"G FSADLINE/2-1,32I QP\' I
.,(192*QZ-(QT+QB)/QF-2:S
U9 .):FB
"E
Q9; .-Z; 1,1A"E S
;R'
"#0,1A-13"E S
;R' ! forbid 0_ , 11_0 , 0101_, 011_ where 0 = blank line, _ = here !
1,1A"E -4L -S
; 3L -S
; L'
"#3<0,-2A-10"E !01_! -2L 0,1A-13*(1,1A)"E 2L !001_ or 01_! 0;' !1_01! 0,-2A-10"N 2L !1101_! 0;' !01_01! C
'"#L 0,1A(-L)-13"N !11_1! -2L 0,1A(2L)-13"N !111_1! 0;'!011_1!'!11_0!' -S
;C>''
12I'> ]9'
Q..U&64"E .,(FSMSNAMEF6W).FX0 ET0;DSK:'
FS IF FN1:F6U0 :I*FORMAT[1 F-2"E:I*XGPU1' EIPWEF0 1
F-2"E FS IF SNAME:F6U1 :XGP 1;0 XGP
XGP' ]1 M..TW 0 {
!******** End of auxiliary macros ********!
300FS^ RMDLYW ! Save the world every n characters typed !
! Flush ~R mode commands !
SFS^RCMACROUA 0U0 512<QA,Q0FS^RCMACROW%0W>
! Digits !
0U0 10<^:IB|Q..3&2048"E 0U..5 Q..32048U..3 ^ FT '
^ FT0 FSIB*Q..5+0 U..5 0 |
QB,Q0FS^ RCMACROW :ICW GB FK ^ FXC QC,Q0+128FS^ RCMACRO W %0W>
HK
!******** ZED's vocabulary ********!
^I
.
A-Undo (undoes last operation)
0U..3 0UMODIF QUndoPTR(.UUndoPTR 1:<G(Q..Y (QUndoLO,QUndoHIFX..Y))>
.UUndoHI FK+.UUndoLO
QUndoLOU..8 QUndoHIU..7)J M..TW M..BW Q..8,Q..7
.
Back (ZED's minus sign)
Q..3&8192"E Q..38192U..3 -U..4 '"# Q..4-1U..4' 0
.
Character
.U..7 Q..4*Q..5:C "E Q..4"L J '"# ZJ ''
"# 1:<0A-13"E1A-10"EQ..4"LR'"#C'''
Q..U&16"N <0A-8*(1A-8)"N0;'Q..4"LR'"#C'>'>W' .U..8 :M..X
.
Dump (dump to TTY)
Q..3&767777"N MIW '
Q..3&16384"NQ..3&37777.U..3 ^ FT-out 128'
"#Q..5UDQRP
1U..4 1U..5 -2049&Q..3U..3 64'Q..3U..3 0
.
Erase
Q..3&727477."N 0U..3 MIW '
Q..3&16384"NQ..3&37777.U..3 ^ FT-overlay 512'"#256'Q..3U..3 0
.
File (i.e. the whole buffer)
Q..3&4096"N 0U..7 '"# .U..7 ' Q..4"L J '"# ZJ ' .U..8 :M..X
.
Get (gets last object Dumped, making it the new object)
Q..5-99"G FG ^ FT The limit is 99'
"#.U..8 .UUndoPTR .UUndoLO G:DQRS(Q..5) .UUndoHI .U..7 Q..8J .,.X..Y
0UMODIF'
0U..3 M..TW M..BW Q..7,Q..8
.
Hole (i.e. wHole)
Q..34096U..3 0
.
Insert (enters insert mode, fixes left end of new object)
#IInsert Mode 12,999G..JFK-12 FX..J QSLOW"N Q..JU..J'"#
:^I*/Y/FSIM 55-(FSECHOL)FSIM :^I*/ Insert/FSIM'
.U..7 512U..S 0FS^RECHOW
0U..3 0UMODIF :M..T
.
Justif
Q..3&767777"N MIW '
Q..3&16384"NQ..3&37777.U..3 ^ FTy 32'"#^ FTill 16'Q..3U..3 0
.
Kase- (change case to lower, ^ to upper)
Q..3&767777"N MIW '
Q..3&16384"NQ..3&37777.U..3 ^ FTupper 8'"#^ FTlower 4'Q..3U..3 0
.
Line
Q..3&4096"N 0L ' .U..7 Q..3&1024"E Q..4"L :RW Q..4*Q..5+1L '"# Q..4*Q..5L ''
"# Q..4"L Q..4*Q..5+1:L '"# :CW:CW Q..4*Q..5:L '' .U..8 :M..X
.
Make (make 1st string into 2nd string. uses hole, n and sign.)
[0[1[2[3[4[5 M..R [..J G..JFK+54 FX0 -54 FX..J ^ FT into M..R
Q..3&4096"N Q..7,Q..8F '"#Q..4"G.,Z'"#B,.''U2U1
Q..3&16384"N ^ FT <sp>=yes <del>=no <esc>=exit !=all'
Q..4"L Q2J Q1,Q2U1U2'"#Q1J'
Q..4:S0"LFKC .U..7
Q..5<.,Q2FB0;> .U..8
Q..7,Q..8F X..Y Q..7,Q..8F UUndoHIUUndoLO Q..8UUndoPTR
Q..7J ZU5
Q..5<.,Q2FB0; 0U3
Q..3&16384"N ^ V FIU4
Q4- "N Q4-"E 1U3'"#Q4-!"E Q..3-16384U..3'"# Q4-"E0;'''''
Q3"E FKD FK(54,999G..J)-FKU4 Q..4"LFKC'"#Q2+Q4U2''>
^ FT Done Z-Q5U5 .U..8 Q..4"L Q5+Q..7U..7' Q5+QUndoHIUUndoHI 0UMODIF'
]..J QSLOW"N Q..JU..J'"#
:^I*/Y/FSIM 55-(FSECHOL)FSIM 86FSIM 54,999:G..JFSIM :^I*/K/FSIM'
]5]4]3]2]1]0 0U..3 M..TW M..BW
.
Next (only useful in CTRL mode, to stop command numbers being self-inserting)
Q..3&8192"E Q..38192U..3 '"# %..4W' 0
.
Object (delimited by Q..7 and Q..8. Warning: Q..8<Q..7 half the time.)
1:<Q..7J> Q..7,Q..8 U..7 U..8 :M..X
.
Paragraph (a shameful kludge - would destroy any programmer's reputation)
Q..3&4096"N 0L:CW -:S..6"EJ'"#FKC 5:CW 0L'' .U..7
Q..3&1024"E Q..4"L :RW0L:C'"# 0L:R' '"# Q..4"L 0L3:C'"# <0,1A-13"N 0;' L>''
WQ..4*Q..5:S..6"E Q..4"LJ'"#ZJ''
"# 1-(Q..3&1024)*Q..4"L FKC' Q..3&1024"E 0L'
"# <0,0A-7*0,0A-14;R>'' .U..8 M..X
.
Quote: (inserts ANY character - <CR><LF> treated as one char)
#.U..9 FSRGETTY"N^FT Quote: '1FSNOQU(FSQU(FII 0AFSECHOOW)FSQUW)FSNOQU
0A-13"E 10I -1' (0U..3 0UMODIF M..TW) -1
.
Right-end-of (meaning depends on type of thing applied to)
Q..31024U..3 0
.
Text (like TECO's S)
[0[1 Q..3&16384"N -FSBOTHCU1'
M..R 54,999G..JFK FX0 Q..3&4096"N FQ0-1:CW -:S0"EJ'' .U..7
1(Q..4"LFQ0-2')(Q..3&1024"N-FQ0'):CW
1:<Q..4*Q..5S0>"L Q..7J FG'"# 1-(Q..3&1024)*Q..4+1"GFKC'' .U..8
Q..3&16384"N Q1FSBOTHCW' ]1]0 :M..X
.
Undo (undoes last operation)
0U..3 0UMODIF QUndoPTR(.UUndoPTR 1:<G(Q..Y (QUndoLO,QUndoHIFX..Y))>
.UUndoHI FK+.UUndoLO
QUndoLOU..8 QUndoHIU..7)J M..TW M..BW Q..8,Q..7
.
Visit (the only file operation)
M..R FQ..R"E 54,999G..JFK FX0 ^ FT: 0'
1M..F QEXIT"N MEXITW 0UEXIT'
QOWIDTH"N QOWIDTHFSADLINEW 0UOWIDTH'
.U0 22,46G..J .U1
Q0,Q0+4F~DIR (Q0,Q1K)"E Q0UDIRLOC'
"#.U0 GFILELOCS .U1
.,(G(FS D FILE) <0A-."E0;' -D> -D .)FXA
Q0,Q1:FBA "E Q1J Q1-Z+(GA I 0 13I10I Z)U1 3R'
Q1-Z+(:K Q0\ Z)U1
Q0,Q1FXFILELOCS'
Q..U&64"E .,(FSMSNAMEF6W).FX0 ET0;DSK:'
HK 0,22G..JFK(54,78G..J 24+FK,32I -24 X0
-24)(46,999G..JFK) FX..J -FSFN(ETX ET0)FSFN
22,46G..J -:S >+1*(EG -4:K -FSBOTHC( -6 :FBDIR..0([0)U0)FSBOTHCWQ0(]0))"N
HK 1:<EM>"L FGFGFG ^ FTNo such dir'
"#J <:L -S,; :K L .-Z"E0;'>
J <S,; R F C FSHPOS-24"L 9I FSHPOS-24"L 9I''"# <24-(FSHPOS); -D>' L>
J <S,; R F >
J FS D SNAMF6 ."E FS MSNAMF6'"# I> J FSDDEVF6 I:< S>'
I
File Name Size Created Last Referenced
J 0,0X..B QDIRLOCU2'
J'
"# 1:<ER>"N HK 0U2'
"# .U0 GFILELOCS .U1
.,(G(FS D FILE) <0A-."E0;' -D> -D .)FXA
Q0,Q1:FBA "E Q1J Q1-Z+(GA I 0 13I10I Z)U1 3R' \U2
Q0,Q1FXFILELOCS
@Y ''
J Q2U..8 Q2U..7 0U..3 1UMODIF Q..JU..J M..TW M..B
-FSBOTHCASE(
ZJ -2L :STECOXCT"N X0 M0'
ZJ -2L :SWIDTH="N \FSADLINEUOWIDTH'
)FSBOTHCASE
QSLOW"N Q..JU..J'"#
:^I*/Y/FSIM 55-(FSECHOL)FSIM 54FSIM 22,46:G..JFSIM :^I*/H/FSIM'
1:<Q2J>W
.
Word
Q..3&4096"N 1:<C-FWL>W'.U..7
1:<Q..3&1024"E Q..4"L Q..4*Q..5FWL'"# 1:<C-FWL>"N -1+' (Q..4*Q..5)+1FWL-FWL''
"# Q..4"L RFWLQ..4*Q..5-1FWLFWL'"# Q..4*Q..5FWL''>"N
Q..4"LJ'"#ZJ'' .U..8 :M..X
.
Xit to
[0 M..R 54,999G..JFK FX0
F~0MON"E 1M..FW FSRGETTY"N F+' Q..JU..J 71-FQ..J,32I
FQ..J-71 ^FX..J 0U..H ^ V'
"#F~0TECO"E ^ FT
Teco:
'
"#F~0FORMAT"E MFORMAT'
"#F~0XGP"E 2MFORMAT'
"#FG ^ FT**Dont know 0**'''' ]0 M..TW 0
.
(enters alter mode, fixes right end of new object)
#WQ..U&4"N FG'
IAlter Mode 12,999G..JFK-12 FX..J QSLOW"N Q..JU..J'"#
:^I*/Y/FSIM 55-(FSECHOL)FSIM :^I*/ Alter /FSIM' .U..8 -U..S 1FS^RECHOW
:M..T
.
(backspace - moves cursor left, even in insert mode)
#W 0,-A-13"E 0,0A-10"E R''
FSRGETTY"E 0AFSECHOOUT'
R
Q..U&16"N <0,0A-8"N0;' 0,-A-10"E0;' 0,0AFSECHOOUTR 0,0AFSECHOOUTR>'
FSHPOSUHPOS0
.
(tab - moves 8 cursor positions right)
#.(1:<0,FSHPOS+8:FM>W FSRGETTY"E ),.T'"#)W' FSHPOSUHPOS 0
.
(linefeed - moves cursor to previous line)
#Q..3"N -1*Q..4*Q..5L QHPOS(M..TW)UHPOS'
"#-L' 0L 1:<0,QHPOS:FM>W 0
.
(return - moves cursor to next line)
#WFS^ RSUPP"L Q..3"N Q..4*Q..5L QHPOS(M..TW)UHPOS 0'
"#L' 0L 1:<0,QHPOS:FM>W 0'
"#8-(Q..U&8)*(FSHPOS-(FSAD))"G M (0A-32"E -D 13I 10I 1)''
"#13FS^ RINSERTW10FS^ RINSERTW 0''
.
(CTRL-quote - just sticks it in)
#W1FSNOQU(FSQU(FII 0AFSECHOOW)FSQUW)FSNOQU
0A-13"E 10I -1' (0UMODIF) -1
.
(erase back line)
#W 0K .,.
.
(erase back word)
#W -FWK .,.
.
: (next job - useful for going to LISP or ...)
#1M..FW FSRGETTY"N F+'
FORK
CONT
0U..H ^ V 0
.
(space - moves cursor right)
#WFS^ RSUPP"L Q..3"N 0U..3 MIW ' [0 .U0 1:<C <0A-13"E1A-10"EC''
Q..U&16"N 1A-8"N0;'0A-10"E0;'2C'"#0;'>> FSHPOSUHPOS
WFSRGETTY"E Q0,.^ T' ]0 0 '"#
Q..U&8"E [0 FSHPOS-(FSAD)U0
Q0+1"LI - ^V'"#Q0"GI [1 .,(-FWL<0,0A- "E 0;'R>.) U1 -D .,(I
Q1R ]1 .)^V'"#I
-2 ^V'(0,0A-10"E<:FI- "N0;'FIW>')'(]0)'"#I - ^V'W0'
.
! (clear-screen key)
#F+
.
# (center current line)
# 0L <(0,1A-32)*(0,1A-9)"E D'"#0;'>
:L <(0,0A-32)*(0,0A-9)"E-D'"#0;'>
0UMODW FSADLINE-FSHPOS/2[0 0L
.,(Q0"G Q0/8,9I Q0&7,32I' ]0 :L.(0L FSHPOSUHPOS))
.
& (do one TECO command)
#[0^ FT Cmnd:
^:I..B/:I..BQ.BU..B FSMODIFIED"N 0UMOD' /
0FSMODIFIEDW
.
$ (save file)
#M..FW 0
.
* (almost infinity)
999999U..5 0
.
, (scroll back one screenful)
#FS WINDOWJ
1:<FSHEIGHT-(FSECHOL)-1*(-1),0@FM>W .FSWINDOW
1:<FSHEIGHT-(FSECHOL)-1*(FS%CENTER)/100,0:FM>W
1:<0,QHPOS:FM>W 0
.
- (synonym for BACK)
Q..3&8192"E Q..38192U..3 -U..4'"# Q..4-1U..4' 0
.
. (scroll forwards one screenful)
#FS WINDOWJ
1:<FSHEIGHT-(FSECHOL)-1,0:FM>W .FSWINDOW
1:<FSHEIGHT-(FSECHOL)-1*(FS%CENTER)/100,0:FM>W
1:<0,QHPOS:FM>W 0
.
/ (slash - moves 8 cursor positions right)
#.(1:<0,FSHPOS+8:FM>W FSRGETTY"E ),.T'"#)W' FSHPOSUHPOS 0
.
" (move cursor to previous position, without disturbing OBJECT)
#2:<.,(J.) "N0;'>W M..BW FSHPOSUHPOS 0
.
= (skips over matching parens - like FLL)
1:<Q..3&4096"N -FUL ' .U..7 Q..4*Q..5FLL>"L FG' .U..8 :M..X
.
[ (define start of object)
#.U9 0
.
] (define end of object, restore start defined by [)
#Q9U..7 .U..8 0
.
< (scroll back half a screen)
#FS WINDOWJ
1:<FSHEIGHT-(FSECHOL)-1/(-2),0@FM>W .FSWINDOW
1:<FSHEIGHT-(FSECHOL)-1*(FS%CENTER)/100,0:FM>
1:<0,QHPOS:FM> 0
.
> (scroll forwards half a screen)
#FS WINDOWJ
1:<FSHEIGHT-(FSECHOL)-1/2,0:FM>W .FSWINDOW
1:<FSHEIGHT-(FSECHOL)-1*(FS%CENTER)/100,0:FM>
1:<0,QHPOS:FM> 0
.
? (print one-page summary)
#ft Summary of ZED. When through reading, simply resume editing.
-------------------------------------------------------------------------------
| GOLFBALL | VERBS ADJECTIVES NOUNS | IMPERATIVES |
|---------------|-------------------------------------------|-----------------|
|BACKSPACE SPACE| Erase 2,3,4,... Character | Insert |
|LINEFEED RETURN| Dump Back or - Word | Make: from$to$ |
| \ / | Justifill Right-end-of Line | Visit: file$ |
| < > | Kase-Lower wHole Paragraph | Undo |
| { } |-----------------------------| File | eXit to: place$|
|---------------| INSERT MODE | Text: xyz$ | Get-dumped-text|
|leave zed: ^Z |enter: I Erase Char: DELETE| Object | Quote (insert) |
|continue: zed |leave: $ Erase Word: ^W | = | |
-------------------------------------------------------------------------------
All-capitals commands refer to keys so labelled. For other alphabetic commands
type only the capitalized letter. Commands from the middle region may be
combined in the form VERB-ADJECTIVES-NOUN: the VERB is optional, any number of
"ADJECTIVES" may be given, and the NOUN is mandatory. "GOLFBALL" commands are
simple cursor motions. For a manual, Visit <CSD.PRATT>ZED.MAN$ For a
self-teach file, Visit <CSD.PRATT>TEACH$ 0
.
^ (operation modifier)
Q..316384U..3 0
.
\ (moves 8 cursor positions left)
#1:<0,FSHPOS-8(0L):FM>W FSHPOSUHPOS 0
.
` (delete forwards one char.)
#0,1A-13"E 0,2A-10"E D'' :DW 0UMOD .,.
.
{ (go to start of line)
#0L 0UHPOS 0
.
} (go to end of line)
#:L FSHPOSUHPOS 0
.
| (does T0T on printing TTY's)
#WFSRGETTY"E 100M..B'"#124FS^RINSERT' 0
.
~ (displays the neighborhood of the cursor on printing TTY's)
#WFSRGETTY"E M..B'"#126FS^RINSERT' 0
.
(rubout - if feels command coming on, flushes it, else does -D)
#WQ..3"N 0U..3 ^ FT **Cancelled** :M..T'
"#FSRGETTY"E FS^RECHO"G ^ FT^?'' 1FS^RECHO(0UMODIF :<0A-10"E-A-13"E
-D'' WFSRGETTY"E 0AFSECHOOUT' -D Q..U&16"N <0A-8"N0;'-A-10"E0;'
FSRGETTY"E 0AFSECHOOUT -AFSECHOUT' -2D>'WFSRGETTY"N 0;':FI-"N
0;'FIW>W)FS^RECHOW FSHPOSUHPOS .,.
.
(control-Z exits to monitor)
#W 1M..F WFSRGETTY"N F+' Q..JU..J 0U..H ^ V'
.
(control-G aborts)
#W 0,FSZFSBOUW M..TW -FSQUITW 0
.
!******** End of vocabulary ********!
! Vocabulary loader - constructs echoing, lower case and CTRL mode
If # at start, doesn't do echo or CTRL mode version !
J<S
.
; 1AU0 0UB S
; 1A-#"EC'"# -LS; :IB.U..9^FT 0^ XB L'
.U1 S
.
; FKC Q1,.^ XB :ICW GB FK ^ FXC
QB,Q0FS^RCMACROW QC,Q0+256FS^RCMACROW QC,Q0+128FS^RCMACRO
(Q0-A+1)*(Q0-Z-1)"L QB,Q0+32FS^ RCMACROW QC,Q0+160FS^RCMACRO'>
^:I*/W.U..9 1M..F WFSRGETTY"N F+'
Q..JU..J 0U..H ^ V/U.Z Q.ZU.z Q..OU.Z
! ctrl-space !
^:I*|WQ..3"N 0U..3 MIW ' [0 .U0 1:<C <0A-13"E1A-10"EC''
Q..U&16"N 1A-8"N0;'0A-10"E0;'2C'"#0;'>> WFSRGETTY"E Q0,.^ T' ]0 0 |,160FS^RCMACROW
! ctrl-return !
^:I*|W0L0 |,141FS^RCMACROW
0,0XFILELOCS 0UDIRLOC ]0]1]2]B HK M..LW