1
0
mirror of https://github.com/PDP-10/its.git synced 2026-02-20 22:45:32 +00:00

Add EMACS library EENV.

This commit is contained in:
Lars Brinkhoff
2018-02-15 21:26:07 +01:00
parent 69a5eb06e4
commit ca26e9141e
3 changed files with 447 additions and 1 deletions

445
src/dcp/eenv.130 Normal file
View File

@@ -0,0 +1,445 @@
!~Filename~:! !Emacs environment for DCP, SOLEY, BARMAR, HOBBIT, STANZE !
EENV
!& Setup EENV Library:! !S Setup the local environment.!
!* Set random flags !
1u Display_Matching_Paren  !* For balancing parens !
1m.v Tags_Find_File  !* Make ^R Find Tag create !
!* a new buffer !
65m.v Fill_Column  !* Set fill column to 65 !
-1 fs ^h print  !* Overstrike on terminals which !
!* can do it !
"*5+1:F..D| !* Treat " like |!
`*5+1:F..D' !* Treat ` like '!
,*5+1:F..D' !* Treat , like '!
[*5+1:F..D( !* Treat [ like (!
]*5+1:F..D) !* Treat ] like )!
!* Bind some keys !
0 u:.x() !* C-X C-E too dangerous. !
!* Normally bound to ^R Edit File. !
m.m ^R_LEDIT_Zap_DEFUN_to_LISP u...L !* C-M-L does M-Z C-X Z !
m.m Comment_Lisp_Text  u..J !* M-J comments paragraph !
m.m Uncomment_Lisp_Text  u...J !* C-M-J undoes M-J !
m.m ^R_Select_Buffer  u:.x() !* buffer editor (from TMACS)!
m.m ^R_Draw_Vertical_Line  u..| !* Flash !
m.m ^R_Buffer_Graph  u..+ !* and more flash !
m.m ^R_Indent_Relative  u..I !* C-U C-I will give the standard !
!* M-I macro !
m.m ^R_What_Lossage  u:.x(Y) !* C-X Y lists last 60 chars typed !
m.m Compile  u. !* Control-epsilon will compile !
!* buffer according to mode. !
m.m ^R_Auto-Fill_Space  u.._ !* put auto fill space on meta !
!* space so we can always use it!
@:i..& -1-(fs ^h print)fs ^h printw& !* meta backspace is what is in there !
m.m Save_All_Files  u. !* attach Save All Files !
!* to ctrl-top-b !
m.m ^R_Buffer_Not_Modified  u..` !* M-` says this buffer isn't !
!* modified. !
m.m Soley's_Meta_Close  u..) !* Multics thing !
m.m Soley's_Meta_Open  u..( !* More Multics !
m.m Forgot_Open_Paren  u.. !* puts open paren before last sexp!
m.m Valret_Region  u..! !* valret region on meta excl !
m.m Valret  u...! !* (valret (read)) on c-m-excl!
m.m Comout  u:.x() !* does a comout. Be careful !
m.m Read_Eval_Redisplay  u:.x(î) !* C-X <RETURN>!
m.m Eval_Lisp_Form  u..î !* META-<RETURN> !
m.m Eval_Lisp_Form  u...M !* sigh. M-C-M!
m(m.m Add_NIL_to_M-X_Compile)

!XUNAME startup:! !C Do the things that are conditional on XUNAME!
!* Conditionalize things for specific terminals !
!* On non-meta keyboards, allow Alt 1 2 to mean an arg of 12.!
FS %TOFCI"E
M.M ^R_Autoarg[0 460.-1[1
10< Q0,%1^ FS ^R_CMAC> Q0U..-
]1 ]0'
3 fs echolines  !* three echo lines, punt terminal !
fs %TOSAI "N !* If we can print SAIL !
1 fs SAIL' !* do so. !
fs xuname -(f6DCP)"e
m(m.m Load_Library ) MODLIN 
'
fs xuname -(F6SOLEY)"e
m(m.m Load_Library ) BABYL  !* BABYL is better (than RMAIL)!
ft BABYL

m.m Babyl  u:.x(R) !* Don't want RMAIL, want Babyl!
'
fs xuname -(F6MERMAN)"e !* start up for MERMAN!
1 m.v Inhibit_Help_Messages 
m(m.m Load_Library ) SORT 
m(m.m Load_Library ) MODLIN 
m(m.m Load_Library ) SENDS 
m(m.m Load_Library ) VT52 
m(m.m Load_Library ) JOURNAL 
m(m.m Load_Library ) BABYL  m.m Babyl  u:.x(R)
'
fs %tosai"n :i*, m(m.m ^R_Set_My_Window_Separator)'
"#
fs xuname-(f6DCP)"e
:i*-, m(m.m ^R_Set_My_Window_Separator)'
"# :i*:, m(m.m ^R_set_My_Window_Separator)''
fs xuname -(f6DCP )"n !* If we are not DCP !
fs xuname -(f6MERMAN)"n !* and if not MERMAN !
m.m Multics_C-T  u.T !* Multics control T !
m.m Multics_M-T  u..T !* Multics meta T !
m.m ^A_Indent_for_LISP  u..I !* ^A before indent !
m.m Insert_File  u:.X(I) !* goes on C-X I !
''

!Setup clock display:! !C does just that!
0[0
fs xuname -(f6 SOLEY )"e 1u0 '
fs xuname -(f6 STANZE)"e 1u0 '
fs xuname -(f6 BARMAR)"e 1u0 '
(fs height-60)"e
(fs width-84)"e
(fs %tosai)"n 0u0 !* punt if LISPM!
'''
q0"n
f[bbind
g(fs clk macro) 0j
@i&f[bbind eg -2d0l-5k-4di_0l0,.k 2ci:
hxEditor_Type f]bbind 1fs mode ch
&
[1 hx1 q1fs clk macro ]1
hk
m(fs clk macro)
1[1 fs ospeed"n fs ospeed-301"l 3u1 ''
q1*60*60fs clk interval ]1
f]bbind
'
]0

!Comment Lisp Text:! !C Comments current paragraph by inserting semicolons.!
-:s 
î
"e bj ' !* search backwards for ^L or 2 CRLF's -- if not found, !
!* jump to top. Ridiculous quoting needed since !
!* redundant CRLF's are compressed. !
@f
 [a !* look forward for first character which is not a CRLF !
qa j !* or ^L and put in q-register A, then jump there !
:s "e zj ' !* search forward for ^L or 2 CRLF's !
!* if not found, jump to bottom !
-@f
 [b ub !* look backwards for first character not a CRLF or ^L, !
!* put in q-register B, and jump there !
fs_z-qb f[ vz !* set virtual end of buffer to current point !
qa j !* now go back to beginning of paragraph !
<.-z; !* do until we reach end of paragraph !
i;;;_ l> !* insert two semis and a space and move to next line !
qa+3 j  !* and leave us at the start of the paragraph !
!Uncomment Lisp Text:! !C Removes semicolons inserted by Comment Lisp Text.!
-:s  !* This macro works just like Comment Lisp Text !
î
"e bj ' !* except that it deletes the first 3 characters on !
!* each line. !
@f
 [a
qa j
:s "e zj '
-@f
 [b ub
fs_z-qb f[ vz
qa j
<.-z; 1a-;"e d w 1a-;"e d w 1a-;"e d '' w 1a-_"e d'' l>
qa j 
!Soley's Meta Close:! !C R.M.Soley's M-)!
0l ."N -2ci)l' m(m.m ^R_Indent_for_LISP)
:l 
!Soley's Meta Open:! !C R.M.Soley's M-(!
0l ."N -2c-dl' m(m.m ^R_Indent_for_LISP)
:l 
!Forgot Open Paren:! !C put an open paren before last sexp!
.[1 f@m(m.m ^R_Backward_Sexp) q1+1j 
!NIL Mode:! !C Enter NIL Mode. (Same as LISP except for mode and compiler!
m(m.m LISP_Mode)
1M(M.M &_Set_Mode_Line)NIL
!Add NIL to M-X Compile:! !C Allow M-X Compile to recognize NIL!
f[bbind g(m.m Compile) 0j [1
:sLISP"l 0l
@i@F~2NIL"E
:NACOMP__1
'
@
hx1 q1m.v MM_Compile 
m.m Compileu. ]1 f]bbind'
!SpanishR Mode:! !C Enter SpanishR Mode. (Same as Text except for mode and compiler!
m(m.m Text_Mode)
m(m.m &_Init_Buffer_Locals )
1m(m.m Auto_Fill_Mode)
70m(m.m ^R_Set_Fill_Column )
1,(:i*SRP)m.l Compiler_Filename 
1M(M.M &_Set_Mode_Line)SpanishR
!Multics C-T:! !C C-T a la Multics!
-c 1m(m.m ^R_Transpose_Characters)
!Multics M-T:! !C M-T a la Multics via Soley!
1 m(m.m ^R_Backward_Word)
1 m(m.m ^R_Transpose_Words)
!^A Indent for LISP:! !C Do a ^A before indent for LISP!
0l m(m.m ^R_Indent_for_LISP)
!Convert Region 8bit to 7bit:! !C Make press files readable from emacs!
.[1 :[2 q1-q2"g [1[2]1]2 q1j '
0[3 (q2-q1)/5< 0u3 5< q3*128+(1a) u3 d > q3/8u3 4<q3&127i -c q3/256u3> 4c > ]3
q1j ]2]1
!Valret Region:! !C Valret the current region to the superior!
.[1 :[2 q1-q2"e ]2]1:i*NOR No_Region_to_ValretFSERR'
q1-q2"G [1[2]1]2 '
[3 q1,q2x3 3 ]3]2]1 
!Valret:! !Read a command and valret it!
[1 1,m(m.m&_Read_Line)Valret:_u1
q1"n 1
'
]1 
!Comout:! !C take a command and send it to the superior (with alt-p)!
1,m(m.m&_Read_Line)Comout:_[1 fs hsname:f6[2
q1"n o$tty:,dsk:2;_file_output
1
$tty:
$p m(m.mSelect_Buffer)_file m(m.m^R_Visit_File)dsk:2;_file_output
' ]2 ]1 
!Process JCL:! !C Process the Job Command Line !
ft JCL_Start...
!<! (f6>)fs d fn2 w0fs d version !* 2 teco commands to run !
fs hsname  fs d sname
0u..h
hkfj
z"n -d0a-15."e-d'' !* get rid of terminators !
z"n 0[6 0[7 0[8 0[9 !* Only if JCL, start with local storage !
@i@@ @i@@ 0j <1a-32"n 0;' d> @s@@ !* and put alt at end !
.-z"n .,zx6' .-1,zk 0j !* put TECO commands in q6 !
z"n hx7 ' hk
q7"n m(m.m Find_File)7' !* read in a file if desired !
q6"n m6' !* execute teco commands if present !
]9]8]7]6' !* restore !
0fs modified
ft END
0u..h !* do a redisplay!

!Dump me:! !C Dump out the EMACS into <hsname>;ts E!
:@i..l&
@:i..l%%
m(m.m XUNAME_Startup )
m(m.m Process_JCL )
m(m.m Setup_clock_display )
:i Editor_Type  DUMPED 

&
ec
:pdump_dcp;ts_e
:kill
:e


!Send to CLOLSP:! !C sends to the lisp listening to the CLO device!
fs hsname:f6[2
fs xuname:f6[3
((fs jname/100.)&7777777777.)+(f6>):f6[4
f[ bbind  g1 i

f[ dfile 
et dsk:2;4_input 
ei hp ef 
:ew cli:3_4 
hk i (set-next-io-streams_"dsk:2;4_input"_"clo:3;4_output") 
hp ef 
f] dfile 
f] bbind 
m(m.m Insert_file ) clo:3;4_output 
.(w):w i
i


!Eval Region:! !LISP evals the current region.!
.[1 :[2 q1-q2"g [1[2]1]2' q2j q1,q2x1 ]2
m(m.m Send_to_CLOLSP ) ]1

!Read Eval Redisplay:! !C sends form to lisp!
1,m(m.m &_Read_Line )Lisp_form:_[1
m(m.m Send_to_CLOLSP ) ]1
!Eval LISP Form:! !C Evaulate the current form in the current LISP!
m(m.m ^R_Mark_Defun ) [1 .,(w.)x1 !* get the form into q1!
m(m.m Send_to_CLOLSP ) ]1
!Convert Region, Alto Font to Readable:! !C Region is ALTO font. Make it readable!
.[1 :[2 0[3 q1-q2"g [1[2]1]2' q1j
(q2-q1)/5< 0u3 5<q3*128+(1a)u3 1d> q3/8u3 4<i
 -2c 8<(q3&1)+48i -c q3/2u3>> 4l>
q1j (q2-q1)/5*4/2<l-2di_l> q1j ]3]2]1
!MINITS:! !C Setup for hacking MINITS!
[0 f[ bbind
i config, minits, fsm, user, uuo, channl, tty, compro, 
i pktncp, chsncp, ethncp, 
i ch11, dte, interl, 3com, 
0j<.-z; @i@ m(m.m Find_File ) minits; @ s,-d 33.i 15.i 12.i>
hx0 f] bbind
m0 ]0
m(m.m Select_Buffer ) config 

!Safety:! !C Make this file safe -- send it to AI and EE!
[0 fsxuname:f6[1 w fs d fn1:f6[4 w qPrevious_Buffer[3
hx0 m(m.m Select_Buffer ) .temp.  hk g0
m(m.m Write_File ) AI:VSDB;1_4 
hk i
SENT-BY:1
HEADER-FORCE:RFC733
TO:(1@EE)
SUBJECT:_A_SAFE_COPY
TEXT;-1

g0 m(m.m Write_File ) mc:.mail.;mail_> 
qPrevious_Bufferu0 m(m.m Select_Buffer ) 0 
q3uPrevious_Buffer

!Doverize KTV Crash reports:! !Read in the crash file and send it to the Dover.!
[Previous_Buffer
m(m.m Select_Buffer ) crash-reports  hk
[Previous_Buffer
m(m.m Insert_File ) ktv;ktv_crash 
0j <:s; -d i.bp> 0j !* add break page!
0j i.dv_press
.fo_0_lpt8 !* add header!
.de_headermacro
. vx_lvpu_.4i
. ns_p
. em
.de_footermacro
' bp
. em
.st_headermacro_0
.st_footermacro_10.4i
.nf
.rs

0j
< !* for each crash!
:sFrom:_11DUMP; 0l3k
:sVersion:; l i.ls_2

s.bp 0l i.ls_1

>
m(m.m Write_File ) KTV;KTV_R 
:clear_
:$Sending_the_file_to_R...î$
:r_"ktv;ktv_r"
:$îDPRESS??_$:if_more_0_î$(:dpress_ktv;ktvî_$)
:$îSend_it_to_the_Dover?_$:if_more_0_î$(
:dover_ktv;ktv_pressî
:listf_dvr:.file._(dir)î_$)
:$Back_to_EMACS?_$:if_more_0
:continue

]0 m(m.m Select_Buffer  ) 0 
]Previous_Buffer

!@ Make Readable TECO:! !C Make printable listing of macros file.
It leaves much to be desired and isn't done right, therefore
it is a crock, but it was designed to be quick and dirty!
f[ bbindw f[ d filew -1f[ fnam syntax [0[1[2[3[4[5[6
e\ e[ fn e] e^ !* push input and output, and arrange for pop!
128*5fs q vectoru0 !* create a q vector for syntax!
:i*cu1
-1u2 128<q1u:0(%2)> !* everthing does nothing!
:i*1a[9 d ^iw q9#100.i ]9u1 !* control chars put uparrow in front of!
!* their readable ascii character!
-1u2 32<q1u:0(%2)> !* put it into the syntax of control chars!
:i*d @i@^?@ u:0(127) !* rubout is special!
:i*cu1
q1u:0(11.) !* tab is not a control character!
q1u:0(12.) !* neither is linefeed!
q1u:0(15.) !* cariage return as well!
q1u:0(33.) !* last, but not least, altmode!
:i*0[0 ."e %0'w 0a-12."e 2a-15."e %0''w !* must be <lf><ff><cr> to stay!
q0"e d@i@^L@'"#c']0u:0(14.) !* this is what control L does!
er egj4l s: i@r :x6 !* q6 gets file name for output file!
@y !* read in the file!
zj i
 !* always put a return/linefeed at end!
j w<.-z; m(q:0(1a))> !* convert the file!
fs msname fs d sname ewdsk: !* open output file on working dir.!
hp ef6 hk !* write out to it.!
er eg j4k :l .,zk hx6 !* get its real file name!
:ft Listing_File_is_6 !* tell the user!

w
!Process %log file:! !C Processes the %log file in the buffer and appends info to the end of .glpr.;%log count!
0j 0u0 0u1
< :spage;
-s: 2c \+q0u0
ssecond -s_in_ 4c \+q1u1
>
fs d fn2u9
[..o 0f[ read only 
:er dsk:.glpr.;%log_count  @y
zjw q9f6 i:_ q0\ i_pages_in_ q1\ i_seconds

ew dsk:.glpr.;  pw ef %log_count 
f] read only  ]..o

!* Local Modes: !
!* Mode:Teco !
!* Comment Column:43 !