Trailing-Edge - PDP-10 Archives - mit_emacs_170_teco_1220 - emacs/tmucs.emacs
There are no other files named tmucs.emacs in the archive.
!* -*-TECO-*- *!

!* This is the less popular stuff from library TMACS.  Note that it requires!
!* the purifier in EMACS;IVORY -- not the one in EMACS;PURIFY.!

!Save Trees:! !C Compress a listing with form feeds.
Replaces some ^L's in buffer by 4 blank lines, in an attempt
to fill  all  pages.  Page length  is  an  optional  numeric
    [1[2[3[l 0u3
    ff"n fulw'"# 60ul'		!* ql has page length !
    j <	.-z; 0u1
	<   :s

u2 %2;w %1w >
    q2"e r' q1+q3-ql-3"l
	q1+q3+4u3 q3-((q3/ql)*ql)u3 .u1 -1:s
"n d i

	q1+7j' '"# q1-((q1/ql)*ql)u3'
    q2"e c'
    > j 
!SRMail:! !C Summarize new mail and call RMAIL.
If there is no new mail, and the variable SRMAIL No New Mail Query
    Exit is non-0, asks whether to exit or read mail.
Any string argument is passed to RMAIL.
Summarizing happens only if there is no string argument, i.e. you're
    reading your mail in the normal way.!

 m(m.m& Declare Load-Time Defaults)
    SRMail No New Mail Query Exit,
	* 0 SRMail always reads mail.  1 Ask if no new mail.: 0

 :i*[1[2 q..o[0			!* 1: String argument.!
					!* 0: Original buffer.!
 f[DFile				!* Save default filename.!
 0fo..qMail Reader Libraryu2		!* 2: If string, is mail-reader.!
 fsOSTeco"n :i*SRMail only works on ITSfserr'	!* Check.!
 q2fp:"l f~2RMAIL"n :i*SRMail only works for RMAILfserr''
					!* If was 0, that is RMAIL on ITS.!
 fq1"E					!* Only summarize if default case.!
   etDSK: fsHSNamefsDSNamew		!* Set defaults to home directory.!
   fsXUNamefsDFN1w et MAIL		!* And to <xuname> MAIL.!
					!* That is how RMAIL does it.  RMAIL!
					!* does not use fsUMailFile.!
   f[BBindw [..o			!* Temporary buffer.!
	0u2				!* 2: 0 means no new mail found.!
	1:< er @y >"n oREAD'		!* Read in mail file if any.!
	.f[VBw z-.f[VZw		!* Empty virtual buffer at top of mail!
	  et RMAIL			!* Reset defaults to <xuname> RMAIL.!
	  1:<m(m.mInsert File)>"E	    !* If any RMAIL file, check it.!
	    "n hk''			!* Put RMAIL at top if APPEND mode,!
					!* so new-mail message#s are right.!
	  zj f]vz f]vb		!* Back to whole buffer, top of mail.!
	.(zj -^f
	 k)j				!* Remove whitespace at end so not get!
					!* fake message indicated.!
	f+				!* Clear screen of clutter.!
	fsQPPtr(			!* Will pop those pushed q-registers.!
	  [0[1[2[3[4[5[6[7[8[9		!* # RMAIL B appears to smash at least!
	  [.0[.1[.2[.3[.4[.5[.6[.7[.8[.9	!* Q2.  Hard to tell -- be!
						!* safe.!
	  9999m(m.mRun Library)RMAIL# RMAIL Bw	!* Summarize.!
	  )fsQPUnwindw			!* Restore q-registers.!
      :i2RMAIL summary of new mail.  Type space to see 1st message.
					!* 2: Non-0, string, means new mail.!

      !READ!				!* Done summarizing.!

     :i*CfsEchoDisplayw		!* Clear the echo area.!
     q2"n				!* Have new mail summarized.!
       @ft2				!* So print type-space message!
       0fsEchoActivew'			!* Keep message on screen.!
     "#					!* No new mail.!
       @ftNo new mail to summarize.	!* !
       0fo..qSRMAIL No New Mail Query Exit"n	!* See if read anyway!
	  @ft  Run RMAIL		!* Prompt.!
	  1m(m.m& Yes Or No)"e ''	!* No, quit.!
       "# @ft  Running RMAIL.''	!* Dont ask, just read.!

     '					!* End of summarizing conditional.!

 q0u..o					!* Back to original buffer.!

 m(m.mRun Library)RMAIL1		!* Call <ENTRY> in mail reader, pass!
					!* string argument.!
!Nowhere Links:! !C Enters recursive ^R on links to nonexistant files
String argument is directory name (should end with semicolon).!
 [1[2 f[dfile
 f[bbind ezdsk: j 2k
 < .-z;
   3a-L"n k !<!>'
   6c 6x1 f61 fsdfn1
   7c 6x1 f61 fsdfn2
   e?"e 0kk !<!>'
   l >
!^R Really Underline Word:! !^R Underline words using backspaces.
Numeric argument specifies how many words to underline and move forward over.
With no argument, underlines the previous word and does not move.
Negative argument says to underline that many words to left.  Does not move.
Underlines with <char><BS>_ if the option variable Underline Mode is non-zero,
    otherwise (the default) with _<BS><char> so scopes will show the
If the option variable Canonicalize Underlines is non-0, Multics-style
    underlining is performed.  (The _, <BS>, and <char> are in alphabetical

 m(m.m& Declare Load-Time Defaults)
    Underline Mode,
      * Non-0 says to underline by _<char><BS>.  0 says to use _<BS><char>: 0
    Canonicalize Underlines,
      * Non-0 says to underline using Multics-style canonicalization: 0

 m(m.m& Temporarily _<BS> No Break)
 qUnderline Modeu2			!* 2: basic underline mode.!
 qCanonicalize Underlinesu4		!* 4: multics-canon flag.!
 ff"e -1u1'"# u1'			!* 1: Iter count, from numarg.!
 Q1f"L W .u3 W-Q1':<			!* Iter over NUMARG words.!
					!* 3: Original point if backwards.!
   Q1"L -fwl'				!* Move backward if negative NUMARG.!
   1:fwl				!* Move to start of this word.!
   < 0,1a"b 1;'				!* Done word if at break character.!
     !Remove!				!* Remove any previous underlining.!
     1a-_"e 0,2a-8"e 2d Q1"L Q3-2 u3' oRemove''	!* ...!
     1a-8"e 0,2a-_"e 2d Q1"L Q3-2 u3' oRemove''	!* ...!
     q4"n				!* Multicanonicalize the underlining.!
	1a-_"g i_ 8i c '		!* ... (order is alphabetical)!
	"# c 8i i_ ''			!* ...!
     "# q2"n c 8i i_ '			!* Mode says to use <char><BS>_ order.!
     "# i_ 8i c''			!* Mode says to use _<BS><char>!
     Q3+2 u3 .-z; >			!* Repeat over word.!
   -fwf				!* Tell  about that word.!
   Q1"l -fwl'				!* Move backward if need.!
   >					!* Repeat over NUMARG word.!
 Q1"L Q3 J '				!* Return for negative args!
!^R Remove Word Underline:! !^R Removes underlining from NUMARG words.
Exactly undoes the effect of ^R Really Underline Word.!

 m(m.m& Temporarily _<BS> No Break)
 ff "E -1u1'"#  u1 '		!* 1: Iter count.!
 Q1f"L w .u2 w-Q1':<			!* Iterate forward/backward.!
					!* 2: Original point if backward.!
   Q1"L -fwl'				!* Negative argument means backward.!
   :fwl					!* Move to start of word.!
   -@f_l				!* But before any underlining.!
   < 0,1a-_"e 0,2a-8"e Q1"L Q2-2 u2' 2d oloop ''	!* Remove _<BS>.!
     0,1a-8"e 0,2a-_"e Q1"L Q2-2 u2' 2d oloop ''	!* And <BS>_.!
     0,1a-"b 1;'			!* Stop at end of word.!
     c !loop! .-z; >			!* Repeat over the word.!
   -fwf				!* Tell  about that word.!
   Q1"l -fwl'				!* Move back over word if need.!
   >					!* Repeat over each word.!
 Q1"L Q2 J '				!* Return if negative arg!
!& Temporarily _<BS> No Break:! !S Set so _ and BS are not breaks.
Pushes a ..N so definitions for _ and <BS> revert when caller exits.!

 8*5,(8*5+5):g..d[1		    !* 1: Old ..d <BS> definition.!
 _*5,(_*5+5):g..d[2		    !* 2: Old ..d _ definition.!
 fn 8*5:f..d1		    !* Restore old ..d <BS>.!
    _*5:f..d2	    !* And old ..d _.!
 8*5:f..dAA   		    !* Make <BS> be letter.!
 _*5:f..dAA   		    !* And _.!
 :				    !* Exit without unwinding.!
!^R Comma-Arg:! !^R Give pre- and post-comma arguments to a command.
Numeric argument becomes the pre-comma argument.
Any digits you type after this become post-comma arguments.  They are
    terminated by a non-digit, which is the ^R command called.  If
    there are no post-comma digits typed, there is only a pre-comma
Example (assuming this is on M-, and meta-digits are autoarguments):
    Typing the following characters: M-1 2 3 M-, 4 5 6 M-X calls M-X
    with arguments of 123,456 so you get "123,456 M-X".
Leaves ..0 set to char after the post-comma argument.!
 [.1				    !* .1: Our argument.!
 :i*NULL[.2			    !* .2: NULL ptr.!
 @m(m.m^R Autoargument)w	    !* Read post-comma argument.!
 fs^RArg-q.2"E 0fs^RArgpw'	    !* No post-comma argument.!
 @fiu..0				!* ..0: Char after argument.*!
 q..0fs^RIndirect fs^RCMacro[.3	!* .3: Macro to call.!
 -1fsReReadw -1fs^RLastw		!* Nothing after this.!
 ,(fs^RArgp"n fs^RArg') @m.3 	!* Call command.!
!* Following should be kept as (only) long comments so will compress out:
 * Local Modes:
 * Fill Column:76
 * End:
 * *!