mirror of
https://github.com/PDP-10/its.git
synced 2026-01-26 04:02:06 +00:00
197 lines
9.1 KiB
Plaintext
Executable File
197 lines
9.1 KiB
Plaintext
Executable File
!* -*- TECO -*- Library created and maintained by KMP@MC !
|
||
|
||
!~Filename~:! !Fancy Mode Line handler!
|
||
MODLIN
|
||
|
||
!& Setup MODLIN Library:! !& Put winning mode line in effect!
|
||
1,m(m.m &_Get_Library_Pointer)KMPTIME"e
|
||
m(m.m Load_Library)TIME'
|
||
m.m&_Fancy_Mode_Line fs Mode Macro
|
||
m.m&_Fancy_Mode_Line M.V MM_&_Set_Mode_Line
|
||
fsOSTeco"e
|
||
m.m&_Check_for_Correct_Superior fs ^R Display'
|
||
m.m&_Fancy_Mode_Line(
|
||
),m(m.m&_Start_Realtime_Modeline_Clock)
|
||
1fsmodech
|
||
0fo..QInvert_Filenamesm.vInvert_Filenames
|
||
|
||
!& Kill MODLIN Library:! !& Get rid of this mode line!
|
||
1,m(m.m&_Get_Library_Pointer)EMACSm.m&_Set_Mode_Linef((
|
||
)m.v MM_&_Set_Mode_Line
|
||
)fs Mode Macro
|
||
fsOSTeco"e
|
||
0 fs ^R Display'
|
||
1fsmodech
|
||
|
||
|
||
!& Check for Correct Superior:! !S Update Job Superior in Mode Line
|
||
For use with LISPT if superior is changing. Checks to see if superior
|
||
has changed, and calls MM& Set Mode Line if it has. This should be put
|
||
in FS^R Display in order to win. Takes a minimal amount of overhead to
|
||
check when superior has not changed. If job is a LISPT, runs
|
||
qLISPT Autoload Hook if nonzero. !
|
||
|
||
fsOSTeco"n 0' !* Return if not ITS.!
|
||
!* Should never run off ITS anyway. !
|
||
[0[1
|
||
fsxjname-(f6MAILT)"e 0 ' !* Ignore MAILT Superior !
|
||
2 FO..QLast_Correct_Superioru1 !* Get last superior info in Q1 !
|
||
fs%oplspu0 !* Put FS %OPLSP in Q0 !
|
||
q0+q1"n !* If superior has changed. !
|
||
q1-2"e 2M.VLast_Correct_Superior' !* Make a new variable !
|
||
"# 2uLast_Correct_Superior' !* Or use the old one !
|
||
1 fs mode change !* Set up to change the mode line !
|
||
0-q0uLast_Correct_Superior' !* Save new superior !
|
||
0
|
||
|
||
|
||
!& Fancy Mode Line:! !S Set the ..J Mode to display options.
|
||
When setting the major mode, call this with a nonzero argument
|
||
and the major mode name as a string argument. It will change the mode
|
||
and run the <modename> Mode Hook variable, if there is one.!
|
||
|
||
-(fsqpptr*2)fsmodech !* Setup for re-call if qpdl is popped. !
|
||
!* !
|
||
[0[1[2[3[4 [.1[.2[.3[.4 !* Bind scratch qregs !
|
||
!* !
|
||
!* Because we are called at interrupt !
|
||
!* level, we should bind all kinds of !
|
||
!* things to be sure not to screw !
|
||
!* interrupted code... !
|
||
!* !
|
||
f[inslen !* Bind length of last inserted frob !
|
||
f[sstring !* Bind default search string !
|
||
!* !
|
||
qEditor_Nameu0 !* q0 = Editor Name !
|
||
qModeu1 !* q1 = Major Mode !
|
||
qBuffer_Indexu3 !* q3 = Buffer Index !
|
||
0u.1 !* q.1 = A counter (init to 0) !
|
||
fsreadonlyu.2 !* q.2 = ReadOnliness of buffer !
|
||
:i*u.3 !* q.3 = Macro to run upon return !
|
||
fsvz+b u.4 !* q.4 = nonzero if buffer narrow !
|
||
fnm.3 !* Set up to macro q.3 !
|
||
!* !
|
||
"n !* If an arg given, ... !
|
||
:i1 q1uMode !* Get string arg of new major mode !
|
||
0fo..Q 1_Mode_Hooku2 !* Get mode hook, if any, in q2 !
|
||
q2"n m2'' !* If a hook was found, macro it !
|
||
!* !
|
||
f[BBind !* Bind the buffer for fast insert !
|
||
f[DFile !* Bind default filenames !
|
||
!* !
|
||
g..J j !* Get old mode line in buffer !
|
||
:s[ w .-1u.1 !* Search for a non-[ to count ^R levels!
|
||
q.1j fq0f |