Google
 

Trailing-Edge - PDP-10 Archives - mit_emacs_170_teco_1220 - emacs/mmcm.init
There is 1 other file named mmcm.init in the archive. Click here to see a list.
!~Filename~:! !MMcM's EMACS init -*-teco-*-, should run on 20X or ITS.!
EMACS
!& Setup EMACS Library:! !C Setup my init file.!
1m.vtags_find_file
m.m&_tags_setup_hookm.vtags_setup_hook
m.m&_babyl_reply_hookm.vbabyl_reply_hook
m.m^r_character_searchu.S
m.m^r_reverse_character_searchu.R
m.m^r_incremental_searchu...S
m.m^r_compileu..Z
m.m^r_various_quantitiesu.Q
m.m^r_load_kbdmacu:.X(()
m.m^r_load_wordabu..._
m.m^r_comma-arg f( f( u., )u.., )u...,
m.m^r_frob_lisp_conditionalu...&
m.m^r_babylu:.X(R)
m.m^r_mini_visited_fileu:.X()
:i* INFO-MMCM m.vDont_Reply_To  !* Never send myself mail.!
"*5+1:f..d|		    !* Make " like |.!
`*5+1:f..d'		    !* and `, , and @ like '.!
,*5+1:f..d'
@*5+1:f..d'
fs %tofci"n			    !* On meta keyboard, make altmode self-inserting.!
  65fs ^rinit,27fs ^rcmac'
fs osteco"n			    !* For 20X,!
  36. fs :etmode		    !* Default everything except version number.!
  er<emacs>emacs.init'
"#
  @:i* |1 fs sail |m.vLISP_Mode_Hook
  @:i* |0 fs sail |m.vTECO_Mode_Hook
  eremacs;*_emacs'
etmmcm;foo_> :i..9
fj h(hk)"e			    !* if there was no jcl,!
  -1f[ ^hprint 1f[ sail
  i_ f[ bbind		    !* prevent default init from typing out anything.!
  iEMACS_ qemacs_versionm(m.m deutsch)
  i_in_TECO_ fs versiom(m.mdeutsch)
  ht -3fs qpun'
zj .f[ vb @y :m(hfx*( f] vb))	    !* jump off to the default init file.!
!^R Date edit:! !^R Write BBN TECO style edit message at start of file.
Inserts name of presumed output file, time and date of edit and user.!

    j gcomment_start
    qbuffer_filenames f"n f[ dfile'
    <i g(fs dsname) >i g(fs dfn1) .i g(fs dfn2) .i
    fs d versi f"e w e[ er e] fs if vers+1' \ i,_
    0,-1fs f dconv fs xunam[0 i,_Edit_by_0

    j,.
!^R Compile:! !^R repeat last ccl command or valret compilation.
Writes out current buffer if changed.!
    qbuffer_filenames"n
      1m(m.m^r_save_file)'
    f+ 0fsecho char
    fs osteco"n ex'
    "# 1m(m.mcompile)'	    !* already saved this file.!
    
!What tag?:! !C Name of current function from tag table.
Print the closest (preceding) function to point in the echo
area.!

    .[1 f[s string [3 0[4	    !* q1 gets current location.!
    0fo..qtag_table_buffer [..o    !* select tags buffer.!
    qbuffer_filenames m(m.m &_tag_table_find_file)[2	    !* find this file.!
    q2"l :i*file_not_listed_in_tag_table fs err'
    q2j 2l
    <,1a - "e 0;'	    !* done when get to line with ^_.!
       fb \u3		    !* find the location.!
       q3-q1 f"l -(q4-q1) "g
         q3-q1 u4 .u2''
       l>
    q2j 0fb @0t		    !* type start of this line in echo area.!
    0
!& Tags Setup Hook:! !S Setup C-/ to do MM Args.!
    m.m argsu./
    0[tags_setup_hook		    !* bind this macro temporarily so normal assignments done.!
      m(m.m&_setup_tags_library)
    0
!FAIL Mode:! !& FAI Mode:! !C Setup things for editting FAIL code.!

    M(M.M MIDAS_Mode)
    :IModeFAIL
    :M(M.M &_Set_Mode_Line)
!^R Load KBDMAC:! !^R Load up keyboard macros and start defining one.!

    m(m.mload)kbdmac		    !* load up keyboard macro library.!
    @:m:.X(()			    !* and call ^X( from there.!
!^R Load WORDAB:! !^R Load up wordab and call expander.!

    m(m.mload)wordab		    !* load word abbrev library.!
    m(m.mwordab)		    !* get into word abbrev mode.!
    @:m..._			    !* and call c-m-space from there.!
!Resequence:! !C Renumber local PALX labels around point.
Numeric arg is amount to increment new numbers by.!

    f[ vz [0[2 fs b cons[3		    !* 3 is where to build up search string!
    -( f"e w 1fo..qResequencing_Increment' )[1   !* 1 is step when resequenced!
    < -l 1a:f"c !<!>' u0 fwl 1a-:"e	    !* Look at lines starting with <token>: !
        q0:"d 0;'' > c .f[ vb		    !* Until one that isnt a number!
    < .-z; l 3,1a:f"c !<!>' u0 fwl 1a-:"e !* Now look forward!
        q0"d 0l \u2 2f=$:"e	    !* If it is <number>$: !
	    q3[..o z"n i'	    !* Separate by ^O's!
	    i q2\ i$ ]..o''"# 0;'' > !* Build ^Bnn$^B^Omm$^B^O...!
    0l b,.fs bound
    j < :s3f"l ( r fk+2d )*q1\ $i'"# 0;' >	    !* Replace with new number!
    
!^R Various Quantities:! !^R Quotes non-letters, otherwise hacks various Quantities.
Note that @ and ? are letters.  If followed by a number, inserts that
octal character <arg> number of times.
First character following is operation:
  F forward, B backward, D delete, R rubout, T twiddle, @ mark region, S save,
  or M to change the Mode of ^F, ^B, ^D, rubout, and ^T but not ^@
Second character following is quantity type:
  C character, W word, S sentence, P paragraph, L line, A atom,
  - S-expression, ( or ) list, D defun, ^L page seperated by ^Ls
Numeric arguments are obeyed.  ? for help.
Note that Q-register .Q is used to remember the current mode.  It contains an "fw-macro"!

 q..0[2				    !* In case of ?, keep prompt correct!
!get1! M.I FI :FC[0 0[1		    !* Get canonical input character!
 q0"D q0-0 u1 -3u0		    !* ^Q digit: Octal-escape processing!
      < %0; M.I :FI"D q1*8+(FI-0)u1 !<!> ' 0;>
      .,( ,q1 I ).  '
 q0->"G q0-["L ofoo ''	    !* Letters (and @, ?) skip the next line!
  .,( ,Q0i ). 		    !* Non-letters self-insert!
!foo!  fs Echo Display C fs Echo Display
 q0-F"E ^ftForward_ :i1^R_Quantity_Forward '    !* Q1 gets name of operation!
 q0-B"E ^ftBackward_ :i1^R_Quantity_Backward '
 q0-D"E ^ftDelete_ :i1^R_Quantity_Delete '
 q0-R"E ^ftRubout_ :i1^R_Quantity_Rubout '
 q0-T"E ^ftTwiddle_ :i1^R_Quantity_Twiddle '
 q0-@"E ^ftMark_ :i1^R_Quantity_Mark '
 q0-U"E ^ftUppercase_ :i1^R_Quantity_Uppercase '
 q0-L"E ^ftLowercase_ :i1^R_Quantity_Lowercase '
 q0-S"E ^ftSave_ :i1^R_Quantity_Save '
 q0-M"E ^ftMode_(mungs_^F,_^B,_^D,_Rubout,_^T):_ :i1&_Quantity_Mode_Set '
 q0-?"E :ft m(m.m Describe_Macro) ^R_Various_Quantities
	q2u..0 ]1]0 oget1 '
 q1"E :i*IQO	Invalid_Quantity_Operation:_0 FG '
 [7				    !* Q7 will get mode name, Quantity Mode Set!
!get2! 0fs Echo Active		    !* Don't clear echo area while in here!
 fsListen"E 0^ v '		    !* Keep cursor up top!
 FI :FCu0 0[2			    !* Get second canonical input character (quan type)!
 q0-C"E :i7Character :i2 '    !* Q2 gets "fw-macro" for quantity type!
 q0-W"E :i7Word :i2fw '
 q0-A"E :i7Atom :i2@fw '
 q0-S"E :i7Sentence		    !* ^R Forward Sentence doesn't like negative args!
	^:i2/ [0 .[1
	      .,( q0"G q0m(m.m^R_Forward_Sentence) '
		    "# -q0m(m.m^R_Backward_Sentence) 'w). f (q1j ]1]0)/ '
 q0-P"E :i7Paragraph ^:i2/ [0 .[1 .,( q0m(m.m^R_Forward_Paragraph)w). f (q1j ]1]0)/ '
 q0-L"E :i7Line :i2 [0 .[1 .,(Q0L). f (q1j ]1]0) '
 q0-&"E :i7Buffer :i2 h  '
 q0--"E :i7S-expression :i2^fl '
 (q0-()*(q0-))"E :i7List :i2fl '
 q0-D"E :i7Defun		    !* ^R End of Defun doesn't work, do it manually!
    ^:i2/ [0 .[1 .,( q0"L q0:S
("E J '"# L ' '"#		    !* Backwards case!
          q0:S
("E ZJ '"# R ' ' ). f (q1j ]1]0)/ '	    !* Forwards case!
 q0-14."E :i7Page ^:i2/ [0
     .[1 .,( q0:s

"E '"# q0"G -2 '"# 3 'c '). f (q1j ]1]0)/ '
 q0-?"E ^ft
Type_quantity_name:_C_character,_W_word,_S_sentence,_P_paragraph,
L_line,_-_S-expression,_(_or_)_list,_D_defun,_^L_page,_&_Buffer
	]2 oget2 '
 q2"E :i*IQT	Invalid_Quantity_Type:_0 FG  '
 !* At this point, Q1 has name of function to call, Q2 has mode macro!
 ^ft7 0fs Echo Active	    !* Type out mode name!
 q2[.Q :m(m.m1)		    !* Run function, temporarily switching mode!
!^R Quantity Forward:! !^R Forward by quantities determined by .Q!

 .[0 .Q R
 q0M(M.M &_Maybe_Push_Point)
 1 
!^R Quantity Backward:! !^R Backward by quantities determined by .Q!

 .[0 -.Q L
 q0M(M.M &_Maybe_Push_Point)
 1 
!^R Quantity Delete:! !^R Delete quantities determined by .Q!

 [9 .Q :m(m.m&_Kill_Text)
!^R Quantity Rubout:! !^R Rubout quantities determined by .Q!

 -[9 -.Q :m(m.m&_Kill_Text)
!^R Quantity Twiddle:! !^R Twiddle quantities determined by .Q
See documentation on ^R Twiddle Characters for how the argument is used!

 q.Q, :m(m.m&_Transpose_Subr)
!^R Quantity Mark:! !^R Mark region as quantity determined by .Q!

 .Q R -.Q [2[1		    !* Q1,Q2 is the region of interest!
 "G q2j q1 '"# q1j q2': 1     !* Move dot to "far" end, mark to "near" end!
!^R Quantity Uppercase:! !^R Uppercase quantities determined by .Q!
 .Q f( f( @fc) r) 
!^R Quantity Lowercase:! !^R Lowercase quantities determined by .Q!
 .Q f( f( fc ) r) 
!^R Quantity Save:! !^R Put quantity determined by .Q on the kill-ring!
 FS^RPREV-1001"E		    !* Kill-merging!
   .Q @X:..K(0) 1  '
 Q..K[..O ZJ-5D J5,0I ]..O	    !* Otherwise, create a new kill-ring entry!
 .Q X:..K(0) 1 		    !* And extract into it!
!& Quantity Mode Set:! !S Subroutine for ^QMx!

 ]*				    !* Make binding of .Q permanent!
 0fo..Q Quantity_Mode_Set_Save_Vector [0
   q0"E 6*5 fs Q Vector u0 q0 m.V Quantity_Mode_Set_Save_Vector
        q.F u:0(0)		    !* Save normal bindings if haven't already!
	q.B u:0(1)
	q.D u:0(2)
	q? u:0(3)
	q.T u:0(4)
	qSet_Mode_Line_Hook u:0(5)
	m.m&_Maybe_Push_Point m.v MM_&_Maybe_Push_Point '
 f=.Q"E			    !* If switching into character mode!
	q:0(0) u.F		    !* restore normal Emacs commands!
	q:0(1) u.B
	q:0(2) u.D
	q:0(3) u?
	q:0(4) u.T
	q:0(5) uSet_Mode_Line_Hook
	M(m.m &_Set_Mode_Line)
	1  '	    !* Otherwise install special commands!
 m.m^R_Quantity_Forward u.F
 m.m^R_Quantity_Backward u.B
 m.m^R_Quantity_Delete u.D
 m.m^R_Quantity_Rubout u?
 m.m^R_Quantity_Twiddle u.T
 q:0(5) u0			    !* Q0 gets previous set mode line hook!
 ^:ISet_Mode_Line_Hook/ 0 +0[1 FQ1"L :I1 ' :I*1_<7> (]1) /
 M(m.m &_Set_Mode_Line)
 1 
!^R Comma-Arg:! !^R Give pre- and post-comma arguments to a ^R command.
Numeric argument becomes the pre-comma argument.
Leaves ..0 set to char after the post-comma argument.!
 [.1				    !* .1: Our argument.!
 :i*NULL [.2			    !* .2: NULL ptr.!
 q.2fs ^rargw
 @m(m.m^r_autoargument)w	    !* Read post-comma argument.!
 fs ^rarg-q.2"E 0fs ^rargpw'	    !* No post-comma argument.!
 1,m.i @fi u..0			    !* ..0: Char after argument.*!
 q..0fs ^rindirect fs ^rcmacro[.3 !* .3: Macro to call.!
 -1fs rereadw -1fs ^rlastw	    !* Nothing after this.!
 ,(fs ^rargp"N fs ^rarg'"# w') m.3    !* Call command.!
!Deutsch:! !C Insert argument into the buffer as a number.!

    "e izero '		    !* 0 is easy enough.!
    .f[ vb m.m&_deutsch	    !* qa has subroutine.!
    0fo..qdeutsch_klein f"n [.0
      qdeutsch_medium[.1
      qdeutsch_gross[.2 '
    "#
      m.m&_fill_q-vector	    !* if this is the first time, need to make q-vectors.!
      mb deutsch_kleineinzweidreivierfuenfsechssiebenachtneunzehnelfzwoelf !*
!        dreizehnvierzehnfuenfzehnsechszehnsiebzehnachtzehnneunzehn [.0
      mb deutsch_mediumzwanzigdreissigvierzigfuenfzigsechzigsiebzigachtzigneunzig [.1
      mb deutsch_grosstausandMillionMilliard [.2 '
    f"l w iminus  -' ma	    !* do the actual work.!
    j 1@fc			    !* uppercase the start of things.!
    fs %toovr"n		    !* if this terminal can do it, make umlauts!
      <:sueoe; -d i" !'! >'
    fs %tosai"n		    !* and ss's!
      <:sss; >'
    zj h
!& Deutsch:! !S Handle a single number, possibly recursing.
This macro knows what is in q.0, q.1, q.2 and qa.
Pre-comma arg means dont eins-ify.!
    [0 [1 -1[2 1000000000[3 -2[4  !* q0 number, q2 space flag, q4 first time thru flag!
    < q0-q3:"l			    !* if there is some part for this thousands level,!
	q0/q3u1 q0-(q1*q3)u0	    !* q1 := q0 div q3;  q0 := q0 rem q3;!
	%2"g 32i'		    !* type space if this is second cruft.!
	1,q1ma			    !* recurse for multiplier, no eins.!
	q4"l q1-1"e ei '	    !* past 1M are feminine.!
	  32i' "# -1u2 '	    !* dont space after tausand.!
        g:.2(-q4)'
      %4-1; q3/1000u3 >
    q0"g %2"g 32i'
      q0/100[6 q0-(100*q6)[7	    !* q6 := q0 div 100;  q7 := q0 rem 100;!
      q6"g g:.0(q6-1) ihundert'    !* insert any hundreds.!
      q7"n q7-20"l g:.0(q7-1)'	    !* if < 20, has special name.!
        "# q7-(q7/10*10) u6	    !* else q6 := q7 rem 10;!
	  q6"g g:.0(q6-1) q6-1"e si '	    !* handle einsundzwanzig.!
	    iund'		    !* put in any digits part.!
	  g:.1(q7/10-2)''	    !* and finally tens part.!
      "e q7-1"e si '''	    !* handle eins unless told not to.!
    
!& Fill Q-Vector:! !S Generate a Q-vector full of strings.
Reads string arguments, the first of which is the name for
the q-vector and successive ones are strings to be stuffed
into it.!

    :i*[0 0[1 [2		    !* q0 name, q1 count, q2 strings.!
    < :i*u2 fq2@; q2( %1>	    !* push all the strings, exit when null.!
    q1*5fs qvector[3		    !* cons up the q-vector.!
    !lupo! q1-1f"l oexit' u1	    !* pop off strings into vector.!
      )u:3(q1) olupo
    !exit! q3m.v0		    !* return it just in case.!
!^R Babyl:! !^R Read mail.!
    m(m.m Run_Library)BABYLBabyl
!& Babyl Reply Hook:! !S Setup for sending mail.!

    m.m^r_babyl_add_to-recipient[...T	    !* C-M-T adds another recipient.!
    m.m^r_babyl_add_subject:_field[...S  !* C-M-S subject...  dont  so still bound.!
!^R Frob LISP conditional:! !^R Change CONDs to ANDs and vice versa.
When changing to COND, point is left in such a place that LF will add another
clause to this condition, and M-) will add another condition.  Also in this case
an argument specifies the number of clauses that are left in the
consequent, the default is 1, i.e. all clauses but the last are assumed to
be for value, and to belong in the antecedent.
A pre-comma argument specifies the search count for finding it (default is -1).!

    ff&2"e -1' "# ' [a z-.[b  !* Compute the right arg.!
    qa :s(COND(AND(OR[0  !* Search for last frob!
    q0"e @fe SFLfs err'	    !* Didnt find one, complain!
    qa"g fk+1' c 1a"'u[1 .[2	    !* Move to start of the atom and remember if uppercase!
    z-qbj 0[c qa"l :s
(  fkc .[d -:s
(  < .-qd; 0,qdfuc>	    !* Compute paren depth of end of defun!
    qc&777777.uc z-qbj'
    qc"n i
   qc,)i i
   z-.ud' q2j			    !* And balance it at point!
    q0+1"e @fwk 2fdl		    !* COND case, flush it!
      :sNOTNULL+3"g	    !* Check for (COND ((NOT etc!
        -ful .( @fll -d) j d @fwk   !* Delete the NOT and associated level of parens!
	@f_	k q2j	    !* And any whitespace!
	i OR'			    !* Choose the right new conditional!
      "# q2j i AND'
      @f_	l		    !* Skip over blanks!
      .( @fll -d) j d'		    !* Remove a level of parens!
    "# r @fll -fdl )i r 0[3	    !* Go to the end of the last clause!
      < -@fll q2-.; %3> q2j	    !* Move back to AND or OR, counting sexps!
      ff&1"e 0' "# 1-'[4	    !* Figure number of sexps to leave after paren!
      q4+q3-3"l @fwk i COND	    !* Just one clause, make it the COND clause!
        :@fll (i'		    !* And put in another open paren!
      "# i COND_(( .(		    !* Else leave the AND or OR in!
        q4f"g w ful' "# +q3 @fll'
	)i )-1j'		    !* Put the matching paren where requested!
      q0+3"e .( @fll )i )j i (NOT_''	    !* Make ORs into (COND ((NOT ...!
    q1"e q2,. fc'		    !* Lowercase area if necessary!
    q0+3"e -2' "# -' ful	    !* Move out of stuff we hacked!
    @m(m.m^r_indent_sexp)	    !* Regrind it!
    @fll -fdl .u2		    !* Leave point to after the last clause!
    qc"n z-qdj -k -2d q2-."g z-qbj ''
    q2j 
!^R Mini Visited File:! !^R Minibuffer setting defaults to buffer filenames.
With no argument, runs a minibuffer initialized with
an ET command containing the current buffer's filenames.
Thus, the default filenames get set to the buffer filenames.
With an argument, puts the old defaults in the ET.
This doesn't change the defaults;  it just shows them.!
    [1 FF"E :I1Buffer_Filenames'
	    "# :I1Minibuffer'
    [0 q..o,2( f[ b bind           !* Set up new buffer with ETs and default names!
	      iET_ g(FF"n fs d file' "# qBuffer_Filenames f"ew fs d file'')
	      i__
        )m(m.m&_mini buffer)1   !* Edit it, passing mode along.!
    f=:.n(0)..o"n		    !* If this command not same as previous minibuffer,!
      q.n[..o zj-5d		    !* push this command onto ring buffer of!
      j 5,0i ]..o		    !* minibuffer commands.!
      hx:.n(0)'
    f] b bind ]0 ]1 m:.n(0) 	    !* Run the edited text.!