!* -*-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 argument.! [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  !# RMAIL R:! !S Edit and then send a reply to current message. With 1st arg of 1, continues editing an outgoing message. With 1st arg of 2, sends a (non-reply) message - different initialization. Uses its own buffer, *REPLY*, with Text and Auto Fill modes. This must be put into $MM # RMAIL R$ to work.! [0[1[2[3 [Previous Buffer [.1 [..j !* save regs! q..o[5 !* yech. this is for ^R RMAIL Reply! :i* fo..qBuffer Nameu.1 !* Q.1: Original buffer name! ^fn|q.1m(m.m Select Buffer)w 0u..h| :i0 q0u1 q0u2 q0u3 !* In case it's M, init all fields to! !* null. ! "e 17.m(m.m& RMAIL Parse Header)' !* For R, replace them with fields of! !* message replying to! qEditor Nameu..j :i..j..j  !* Force a nice mode line! m(m.m Select Buffer)*REPLY* !* select reply buffer! m(m.m Text Mode) !* and put it into Text mode! m(m.m Make Local Variable)Auto Fill Mode m(m.m Auto Fill Mode) -1"e oContinue' !* For C, don't clobber what reply-buffer! !* already has! -2"e hk iTo: --Text follows this line--  b+4j oContinue' !* For M, just put in bare minimum! hk i13 j < :sT; To: ^f k i  > j < :sC; cc: ^f k i  > j fq0"g iTo: g0 !* If sender to reply to, put in a To:-! !* line.! -2f= "n i ' b+3j ^f k i ' j <:s at ; @> !* replace "at' with "@' in network! !* address! j <:s @ ; @> !* Delete extra spaces around @'s, to! !* canonicalize.! fq0"g j 3c :x0 !* get senders name, as canonicalized! :s0"l r fk+2d'' !* Flush any second occurrence! j <:sINFO-; fkaf:, +1"g fkd .,(s,  fkc .)k'> !* don't reply automaticaly to! !* INFO-EMACS, etc.! zj fq2"g iSubject:2 ' i--Text follows this line--  !Continue! !* Set up the ^R environment for editing! !* the reply.! 0f[noquit m.m^R RMAIL Yanku2 !* Macro to yank message being replied to! FS ^R INIT-Q.Y"E !* If ^Y has its built-in definition,! Q2[.Y' !* redefine it.! 600.+@ FS ^R INIT-Q...Y"E !* If C-M-Y undefined, redefine it.! Q2[...Y' 201.@ FS ^R INIT-Q...Y"E !* If C-M-Y is an error, redefine it.! Q2[...Y' 3FS ^R INIT # Q.C"E !* If ^C unredefined, define it to send! 33.FS ^R INIT [.C' !* the message.! 0fo..qRMAIL Reply Hookf"n u2 m2' !* Does user say what other commands to! !* redefine! !Re edit! 0u..h !* make display occur?!  q..0&337.-307."e w ' z"e 0fsmodifiedw ' !* if he didnt exit with ^G, and didnt! !* clear the buffer,! 1:< m(m.m& Mail Buffer)>f"e !* Mail the contents. Error implies! 0fsmodifiedw ' !* go back to editing! ^:fg oRe edit !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 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 RMAIL.! 1:"E !* If any RMAIL file, check it.! 10f~*APPEND*  "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 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 is number of words to underline. Canonicalizes the underlining if the option Canonicalize Underlines is non-0. (Multics-style canonicalization.) If 0, it puts _ so that scopes don't show only the _.! m(m.m& Declare Load-Time Defaults) Canonicalize Underlines,* Non-0 means Multically canonicalize underlining:1  m(m.m& Temporarily _ No Break) [1 qCanonicalize Underlines[2 !* 2: Canon-flag. *! f"L W-':< !* Iter over NUMARG words. *! "L -fwl' !* Move backward if negative NUMARG. *! 2:fwl -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 oRemove'' !* ... *! 1a-8"e 0,2a-_"e 2d oRemove'' !* ... *! q2"n !* Canonicalize the underlining. *! 1a-_"g i_ 8i c ' !* ... *! "# c 8i i_ '' !* ... *! "# i_ 8i c' !* No canonicalization. *! .-z; > !* Repeat over word. *! -fwf !* Tell  about that word. *! "l -fwl' !* Move backward if need. *! > !* Repeat over NUMARG word. *! 1 !^R Remove Word Underline:! !^R Removes underlining from NUMARG words.! m(m.m& Temporarily _ No Break) f"L w-':< !* Iterate forward/backward. *! "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 2d oloop '' !* Remove _. *! 0,1a-8"e 0,2a-_"e 2d oloop '' !* And _. *! 0,1a-"b 1;' !* Stop at end of word. *! c !loop! .-z; > !* Repeat over the word. *! -fwf !* Tell  about that word. *! "l -fwl' !* Move back over word if need. *! > !* Repeat over each word. *! 1 !& Temporarily _ No Break:! !S Set so _ and BS are not breaks. Pushes a ..N so definitions for _ and revert when caller exits.! 8*5,(8*5+5):g..d[1 !* 1: Old ..d definition. *! _*5,(_*5+5):g..d[2 !* 2: Old ..d _ definition. *! fn 8*5:f..d1 !* Restore old ..d . *! _*5:f..d2 !* And old ..d _. *! 8*5:f..dAA  !* Make 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 argument. 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.! 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 @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: * *!