mirror of
https://github.com/PDP-10/its.git
synced 2026-02-16 12:53:06 +00:00
1024 lines
39 KiB
Plaintext
Executable File
1024 lines
39 KiB
Plaintext
Executable File
|
||
!* -*-TECO-*- FOR AUTO MODE SETTING!
|
||
|
||
!* Note on major mode commands:
|
||
Major modes affect things by setting up local variables and local q-registers.
|
||
& Init Buffer Locals discards the locals set up by the previous mode
|
||
(actually, all locals except those created at buffer creation times;
|
||
see Select Buffer and QInitial Local Count).
|
||
& Init Buffer Locals also leaves Q.Q bound to Make Local Q-reg.
|
||
Giving a "1," argument to M.L or M.Q tells it to save time by
|
||
assuming that the local doesn't already exist. If that isn't so,
|
||
it is created twice, so watch out. The 1, argument saves a lot of time.
|
||
& Set Mode Line with an argument of 1 sets the variable Mode,
|
||
and runs <mode> Mode Hook.!
|
||
|
||
!LISP Mode:! !C Set things up for editing LISP code.
|
||
Puts ^R Indent for LISP on Tab, puts tab-hacking rubout on Rubout.
|
||
Paragraphs are delimited only by blank lines.!
|
||
|
||
M(M.M &_Init_Buffer_Locals) !* See comment at top of file.!
|
||
M.M ^R_Indent_for_Lisp M.Q I
|
||
1,1M.L Space_Indent_Flag
|
||
1,Q¨1,Q. M.Q›W )M.Q .› !* Exchange rubout flavors.!
|
||
1,56 M.L Comment_Column
|
||
1,(:I*;) M.L Comment_Start
|
||
1,(:I*) M.L Paragraph_Delimiter
|
||
QPermit_Unmatched_Paren"L
|
||
1,0M.LPermit_Unmatched_Paren'
|
||
1,(:I*COMPLR)M.L Compiler_Filename
|
||
M.Q ..D
|
||
0FO..Q Lisp_..D F"N U..D' !* Select the Lisp syntax table!
|
||
"# W :G..D U..D !* creating it if doesn't exist.!
|
||
Q..D M.V Lisp_..D
|
||
-1[1 32< %1*5+1:F..D A>
|
||
9*5+1:F..D_
|
||
!"""""! 1M(M.M &_Alter_..D) || "| // '' `' ,' @' #' [A]A {A}A îî
|
||
_ _'
|
||
1M(M.M&_Set_Mode_Line) LISP
|
||
|
||
!PALX Mode:! !C Set things up for editing PALX code.
|
||
The same as MIDAS mode.!
|
||
|
||
:I*PALX,:M(M.M MIDAS_Mode)
|
||
|
||
!MIDAS Mode:! !C Set things up for editing MIDAS code.
|
||
C-M-N and C-M-P go to next and previous label.
|
||
C-M-A and C-M-E go to AC and EA fields, respectively.
|
||
C-M-D deletes next word and its terminator (eg, "FOO:").
|
||
Paragraphs are delimited only by blank lines.!
|
||
|
||
M(M.M &_Init_Buffer_Locals) !* See comment at top of file.!
|
||
[2 FQ2:"G :I2 MIDAS'
|
||
1,1M.L Space_Indent_Flag
|
||
1,32 M.L Comment_Column
|
||
1,(:I*;) M.L Comment_Start
|
||
1,(:I*) M.L Paragraph_Delimiter
|
||
F~2 MIDAS"'E +(F~2 PALX"'E)"N !* For MIDAS or PALX, give /E switch to assembler.!
|
||
1,(:I*/E) M.L Compiler_Switches'
|
||
!*** Save time by doing the M.M's only once, the first time MIDAS Mode is called.!
|
||
0fo..q MIDAS_Vector[1
|
||
q1"e 5*5fs qvectoru1 q1m.v MIDAS_Vector
|
||
m.m ^R_Go_to_AC_Fieldu:1(0)
|
||
m.m ^R_Kill_Terminated_Wordu:1(1)
|
||
m.m ^R_Go_to_Address_Fieldu:1(2)
|
||
m.m ^R_Go_to_Next_Labelu:1(3)
|
||
m.m ^R_Go_to_Previous_Labelu:1(4)'
|
||
1,Q:1(0) M.Q ...A
|
||
1,Q:1(1) M.Q ...D
|
||
1,Q:1(2) M.Q ...E
|
||
1,Q:1(3) M.Q ...N
|
||
1,Q:1(4) M.Q ...P
|
||
M.Q ..D
|
||
0FO..Q MIDAS_..D F"N U..D' !* Select the Midas-mode syntax table!
|
||
"# W :G..D U..D !* creating it if doesn't exist.!
|
||
Q..D M.V MIDAS_..D
|
||
1m(m.m &_Alter_..D) <( >)'
|
||
1M(M.M&_Set_Mode_Line) 2
|
||
|
||
!TECO Mode:! !C Set things up for editing TECO code.
|
||
g(m.aPURIFY~DOC~ TECO Mode)jk!
|
||
|
||
M(M.M Load_Library)PURIFY
|
||
:M(M.M TECO_Mode)
|
||
|
||
!TEX Mode:! !C Set up for editing TEX input files.
|
||
g(m.aTEX~DOC~ TEX Mode)jk!
|
||
|
||
M(M.M Load_Library)TEX
|
||
:M(M.M TEX_Mode)
|
||
|
||
!Scribe Mode:! !C Set up for editing Scribe source text.
|
||
g(m.aSCRIBE~DOC~ Scribe Mode)jk!
|
||
|
||
m(m.m Load_Library)SCRIBE
|
||
:m(m.m Scribe_Mode)
|
||
|
||
!Text Mode:! !C Set things up for editing English text.
|
||
Tab does ^R Tab to Tab Stop. There are no comments.
|
||
Auto Fill does not indent new lines.!
|
||
|
||
M(M.M &_Init_Buffer_Locals) !* See comment at top of file.!
|
||
M.Q ..D
|
||
1,(:I*RR) M.L Compiler_Filename
|
||
0FO..Q Text_..D F"N U..D' !* Select the Text-mode syntax table!
|
||
"# W :G..D U..D !* creating it if doesn't exist.!
|
||
Q..D M.V Text_..D
|
||
5*. :F..D __ !* . isn't part of a word (or a "sexp").!
|
||
!"! 5*' :F..D AA !* ' is part of a word...!
|
||
5*8 :F..D AA !* BS is part of a word...!
|
||
5*_ :F..D AA !* Underlining is part of a word...!
|
||
'
|
||
1,(M.M ^R_Tab_to_Tab_Stop) M.Q I
|
||
1,0M.L Display_Matching_Paren
|
||
1M(M.M&_Set_Mode_Line) Text
|
||
|
||
!Edit Tabular Text:! !C Temporarily set up for editing a table.
|
||
Makes Auto Fill indent the next line,
|
||
makes Tab be ^R Tab to Tab Stop.!
|
||
|
||
1[Space_Indent_Flag
|
||
M.M ^R_Tab_to_Tab_Stop[I
|
||
:I*Tabular_Text [Submode
|
||
0
|
||
|
||
!Edit Indented Text:! !C Temporarily set up for editing indented text.
|
||
Good when body of text is indented, but topics appear at the margin.
|
||
Tab is ^R Indent Relative; auto fill indents lines.
|
||
Paragraphs start only with blank lines. Rubouts hack tabs.!
|
||
|
||
M.M ^R_Indent_Relative [I
|
||
127FS^R INIT[.Š
|
||
377.@FS^R INIT[Š
|
||
1[Space_Indent_Flag
|
||
[Fill_Prefix
|
||
:I* [Paragraph_Delimiter
|
||
:I* [Page_Delimiter
|
||
:I*Indented_Text [Submode
|
||
0
|
||
|
||
!Fundamental Mode:! !C Return to EMACS's initial mode.!
|
||
|
||
M(M.M &_Init_Buffer_Locals) !* See comment at top of file.!
|
||
1M(M.M&_Set_Mode_Line) Fundamental
|
||
|
||
!Macsyma Mode:! !C Enter a mode for editing Macsyma code.
|
||
Modifies the delimiter dispatch, ..D, appropriate for Macsyma syntax,
|
||
puts special rubout on rubout, sets parameters for comment hackery,
|
||
and defines Tab to be ^R Indent Nested.!
|
||
|
||
M(M.M &_Init_Buffer_Locals) !* See comment at top of file.!
|
||
M.M ^R_Indent_Nested M.Q I !* SHOULD BE MACSYMA INDENT, BUT HARD!
|
||
1,1M.L Space_Indent_Flag
|
||
1,Q¨1,Q. M.Q›W )M.Q .› !* Exchange rubout flavors.!
|
||
40 M.L Comment_Column
|
||
:I*/*_ M.L Comment_Begin
|
||
:I*/* M.L Comment_Start !* MACSYMA USES /* ...*/ FOR COMMENTS!
|
||
:I**/ M.L Comment_End
|
||
M.Q ..D
|
||
0FO..Q MACSYMA_..D F"N U..D' !* Select the MACSYMA syntax table!
|
||
"# W :G..D U..D !* creating it if doesn't exist.!
|
||
Q..D M.V MACSYMA_..D
|
||
1M(M.M &_Alter_..D) \/ "| $_ ;_ :_ =_ -_ +_ *_ /_ ^_ <_ >_ @_ !_ #_ &_ |_ ._ ,_ `_ ~_ __ !'!
|
||
5*? :F..DAA' !* ? is alphabetic!
|
||
1000000.[2 Q2-1&(aFS^R INIT)[1
|
||
]-)*Q2+Q1 M.Q ]
|
||
]1 ]2
|
||
1M(M.M&_Set_Mode_Line) Macsyma
|
||
|
||
!MUDDLE Mode:! !C Enter a mode for editing MUDDLE code.
|
||
g(m.aMUDDLE~DOC~ Muddle Mode)jk!
|
||
|
||
M(M.M Load_Library)MUDDLE
|
||
:M(M.M Muddle_Mode)
|
||
|
||
!PL1 Mode:! !C Set up to edit PL/1 code.
|
||
g(m.aPL1~DOC~ PL1 Mode)jk!
|
||
|
||
M(M.M Load_Library)PL1
|
||
:M(M.M PL1_Mode)
|
||
|
||
!Debug Mode:! !C Invoke TDEBUG for debugging TECO code.
|
||
Show two windows with buffer in window 1, and current function code
|
||
in window 2. Meta-D gets minibuffer which is stepped through.
|
||
Arg is line number to split screen at.!
|
||
|
||
!* This version simply autoloads the TDEBUG Library version of this function.!
|
||
1,M.M &_File_TDEBUG_Loaded"E
|
||
M(M.M Load_Library) DSK:EMACS;TDEBUG'
|
||
F:M(M.M Debug_Mode)
|
||
|
||
!Auto Fill Mode:! !C Break lines between words at the right margin.
|
||
A positive argument turns Auto Fill mode on;
|
||
zero or negative, turns it off. With no argument, the mode is toggled.
|
||
When Auto Fill mode is on, lines are broken at spaces
|
||
to fit the right margin (position controlled by Fill Column).
|
||
You can set the Fill Column with the ^R Set Fill Column.!
|
||
|
||
QAuto_Fill_Mode"'E[0 !* No arg => toggle.!
|
||
FF"N "'G U0' !* Arg => set from the arg.!
|
||
Q0UAuto_Fill_Mode
|
||
0
|
||
|
||
!Atom Word Mode:! !C Make word commands deal with LISP atoms.
|
||
A positive argument turns Atom Word mode on;
|
||
zero or negative, turns it off. With no argument, the mode is toggled.
|
||
When Atom Word mode is on, word commands define a word to mean
|
||
a Lisp atom. This affects which characters are delimiters.!
|
||
|
||
QAtom_Word_Mode"'E[0 !* No arg => toggle.!
|
||
FF"N "'G U0' !* Arg => set from the arg.!
|
||
Q0UAtom_Word_Mode
|
||
0
|
||
|
||
!Overwrite Mode:! !C Make printing characters overwrite existing text.
|
||
A positive argument turns Overwrite Mode mode on; a zero or negative,
|
||
argument turns it off. With no argument, the mode is toggled.
|
||
In overwrite mode, printing characters replace a character
|
||
instead of pushing the following characters over to the right.
|
||
Rubout replaces the preceding character with a space.
|
||
To insert use ^R Quoted Insert.!
|
||
|
||
QOverwrite_Mode"'E[0 !* No arg => toggle.!
|
||
FF"N "'G U0' !* Arg => set from the arg.!
|
||
Q0UOverwrite_Mode !* Note that we use value -1, not 1.!
|
||
0
|
||
|
||
!Indent Tabs Mode:! !C Enables or disables use of tabs as indentation.
|
||
A positive argument turns use of tabs on;
|
||
zero or negative, turns it off.
|
||
With no argument, the mode is toggled.!
|
||
|
||
QIndent_Tabs_Mode"'E[0 !* No arg => toggle.!
|
||
FF"N "'G U0' !* Arg => set from the arg.!
|
||
Q0UIndent_Tabs_Mode
|
||
Q0"E
|
||
@FT Not_using_tabs'
|
||
"# @FT Using_tabs'
|
||
0FS ECHO ACT
|
||
|
||
!SAIL Character Mode:! !C Enables or disables display of SAIL graphics.
|
||
They are single-column graphics for characters 0 through 37.
|
||
A positive argument turns display of SAIL graphics on;
|
||
zero or negative, turns it off.
|
||
With no argument, the mode is toggled.!
|
||
|
||
QSAIL_Character_Mode"'E[0 !* No arg => toggle.!
|
||
FF"N "'G U0' !* Arg => set from the arg.!
|
||
Q0USAIL_Character_Mode
|
||
0FS ECHO ACT
|
||
|
||
!Word Abbrev Mode:! !C Turns word abbreviation mode on or off.
|
||
g(m.aWORDAB~DOC~ Word Abbrev Mode)jk!
|
||
|
||
m(m.mLoad_Library)WORDAB
|
||
f:m(m.mWord_Abbrev_Mode)
|
||
|
||
!Read Word Abbrev File:! !C Load in file of word abbreviations.
|
||
g(m.aWORDAB~DOC~ Read Word Abbrev File)jk!
|
||
|
||
m(m.mLoad_Library)WORDAB
|
||
f:m(m.mRead_Word_Abbrev_File)
|
||
|
||
!Replace String:! !C Replace one string with another, globally.
|
||
M-X ReplaceFOOBAR replaces each FOO after point with a BAR.
|
||
A numeric argument means replace only FOOs which are
|
||
surrounded by delimiter characters. Works by calling Query Replace
|
||
and pretending you typed a .!
|
||
|
||
1,fReplace:_[..9 !* Get FOO in q0 and BAR in q1!
|
||
!* Keep FOO in Q..9 over F^K to minimize funarg problem.!
|
||
1,fReplace_..9_with:_,q..9(]..9)[0[1
|
||
! fsreread
|
||
.[9 fn q9j
|
||
fm(m.m Query_Replace)01
|
||
|
||
!& Case Replace:! !S Like TECO ^F1 FK |