diff --git a/build/build.tcl b/build/build.tcl index a0d3b9a3..563a9ee3 100644 --- a/build/build.tcl +++ b/build/build.tcl @@ -263,6 +263,11 @@ respond "\n" "\033xgenerate\033emacs;abstr\033emacs1;abstr\r" respond ":EJ" "\025\033x& compress file\033emacs1;auto-s\r" respond "Compressing file" "\033xgenerate\033emacs;auto-s\033emacs1;auto-s\r" respond ":EJ" "\033xgenerate\033emacs;dired\033emacs1;dired\r" +respond ":EJ" "\033xgenerate\033emacs;doclsp\033emacs1;doclsp\r" +respond ":EJ" "\033xgenerate\033emacs;elisp\033emacs1;elisp\r" +respond ":EJ" "\033xgenerate\033emacs;ledit\033emacs1;ledit\r" +respond ":EJ" "\033xgenerate\033emacs;lispt\033emacs1;lispt\r" +respond ":EJ" "\033xgenerate\033emacs;lsputl\033emacs1;lsputl\r" respond ":EJ" "\033xgenerate\033emacs;tags\033emacs1;tags\r" respond ":EJ" "\033xgenerate\033emacs;taggen\033emacs1;taggen\r" respond ":EJ" "\033xgenerate\033emacs;slowly\033emacs1;slowly\r" @@ -274,6 +279,7 @@ respond ":EJ" "\033xgenerate\033emacs;delim\033emacs1;delim\r" respond ":EJ" "\033xgenerate\033emacs;modlin\033emacs1;modlin\r" respond ":EJ" "\033xgenerate\033emacs;vt100\033emacs1;vt100\r" respond ":EJ" "\033xgenerate\033emacs;vt52\033emacs1;vt52\r" +respond ":EJ" "\033xgenerate\033emacs;xlisp\033emacs1;xlisp\r" respond ":EJ" "\033xrun\033einit\033? Document\r" respond "\n" "\030\003" diff --git a/src/emacs1/doclsp.30 b/src/emacs1/doclsp.30 new file mode 100755 index 00000000..0dfbcaa3 --- /dev/null +++ b/src/emacs1/doclsp.30 @@ -0,0 +1,103 @@ +!* -*- TECO -*- ! +!~FILENAME~:! !LISPDOC command similar to TECDOC! +DOCLISP + +!DOCLISP:! !C Print out LISP documentation +Takes string arg of command to find. If string is null, it will +prompt for one.! + +f[ B Bind !* Get our own buffer! +f[ D File !* Don't modify defaults! +FN EC FS RGETTY "EFT +' !* Be sure to close on exit, and look nice! + !* on losing terminals! +er DSK:macind;MACLSP_MANDOC 1:A !* Get the pointer to the directory! +\ FS IF Access !* Access the directory! +^Y !* read it in! +ER !* re-open it! +s'(l 0,.k !* Flush superfluous header! +1,F LISP_Command?__ [1 !* Get the argument! +FQ1 "E !* if null! + :F "G !* and we were called via MM or whatever! + 1, m(m.m &_Read_Line)LISP_Command?__ f(u1)"E''' !* try from TTY! +FQ1 "E !* Still null? ! + 0FO..Q DOCLISP_Last_Argument u1' !* try our previous arg! +q1"E @FT_[No_Previous_LISP_command] + !* nope, just give up on him! + 0fs echo active w' !* don't flush typeout! +q1 m.v DOCLISP_Last_Argument !* remember for next time! +QLISPDOC_Readtable[..D !* Get our very own readtable! +FS B Cons[ 0 !* Get a buffer to read things into! +[2[3 +J F !* Nope, try next entry! + Q2 "E FTNot_Found? +' !* if no entry was found, point that out! + FTMore?__ !* ask the question! + FI u2 !* get the answer! +   Print_next_entry +  Search_for_same_item_again + Read_a_new_item_to_search_for + Redisplays +N,Q,X, exit. +' + ft +More?__ + FIU2> !* Get his new command! +> !* Done? OK, see you later! +0u..h !* don't inhibit re-display! + + +!& Setup DOCLISP Library:! !S Initialze, create ..D, etc.! + +:i*..D[0 !* 0 gets a copy of ..D +!*5:f0AA !* Modify our copy! +-*5:F0AA ++*5:F0AA +=*5:F0AA +>*5:F0AA +<*5:F0AA +**5:F0AA +\*5:F0AA +/*5:F0A/ !* / does not terminate words etc.! +|*5:F0A| !* | doesn't either! +95 *5:F0AA !* Can't say ^^_ or ^^^Q_ or ^^^]^Q_! +Q0 m.vLISPDOC_Readtable !* and save it for future scan! + diff --git a/src/emacs1/elisp.10 b/src/emacs1/elisp.10 new file mode 100755 index 00000000..74dc0cf7 Binary files /dev/null and b/src/emacs1/elisp.10 differ diff --git a/src/emacs1/ledit.34 b/src/emacs1/ledit.34 new file mode 100755 index 00000000..8c486cb1 Binary files /dev/null and b/src/emacs1/ledit.34 differ diff --git a/src/emacs1/lispt.264 b/src/emacs1/lispt.264 new file mode 100755 index 00000000..bef823cd Binary files /dev/null and b/src/emacs1/lispt.264 differ diff --git a/src/emacs1/lsputl.8 b/src/emacs1/lsputl.8 new file mode 100755 index 00000000..2ab84fc7 Binary files /dev/null and b/src/emacs1/lsputl.8 differ diff --git a/src/emacs1/xlisp.110 b/src/emacs1/xlisp.110 new file mode 100755 index 00000000..ff01e8b8 --- /dev/null +++ b/src/emacs1/xlisp.110 @@ -0,0 +1,361 @@ +!* -*- Teco -*- Library created and maintained by KMP@MC ! + +!* Bugs, feature requests, etc... ! +!* ! +!* [Source: KMP (07/16/80)] ! +!* This needs to be sure it has a good ..D or else floating point ! +!* numbers and other screws will happen -- eg, PRINC+T function in ! +!* RAB;OUTMIS will get mistaken for a PRINC if not careful. -kmp ! +!* ! +!* [Source: CWH] ! +!* (cond (condition then-clause) (t else-clause)) ! +!* <=> (IF condition then-clause else-clause) ! +!* ! +!* [Source: KMP] ! +!* (and exp1 exp2) <=> (IF exp1 exp2) ! +!* (or exp1 exp2) <=> (IF (NOT exp1) exp2) ; Maybe IFN, too? ! +!* Old-DO <=> New-DO ! +!* (PROG (...) ...) => (LET (..) ...) ; if no RETURN or GOs ! +!* ; Maybe find leading SETQs and move into the BVL. Super-tricky ! +!* ; due to the evaluation environment differences. ! +!* (TERPRI), (TYO ...), (PRIN1 ...), (PRINC ...), ... ; Sequences only ! +!* <=> (FORMAT ...) ! +!* ! +!* [Source: RWK (07/16/80) ! +!* Do these allow one to do M-X Undo? ! +!* ! +!* [Source: CWH (07/16/80)] ! +!* You may also want to include WHEN and UNLESS. I have been using ! +!* these recently after RWK convinced me they were winners. You may ! +!* also want to write one completely hairy macro which figures out ! +!* which of the above transformations you want applied. As long as it ! +!* can be undone with M-X Undo, such a frob wouldn't be too dangerous. ! +!* ! +!* [Source: CWH (07/21/80)] Re: LAMBDA->LET ! +!* I would prefer it if ((LAMBDA (X) Z) NIL) became ! +!* (LET ((X NIL)) Z) instead of (LET (X) Z). Perhaps a switch? ! +!* Also, modernizing ((LAMBDA (X Y) Z) 0 0) inserts a spurious ! +!* space after the first 0. ! + +!~Filename~:! !Macros for transforming Lisp Code! +XLISP + +!& Query Loop:! !& Loop doing things and asking for confirmation! + +:i*Query/[..J[C[0[P + + oPause' !* Go to previous ! + qC f _ , . :"l fi !* If cmd = Space or Comma, ! + .u0 m() q0j !* Run change macro ! + qC-,"e !* If comma, show result ! + !Pause! !* Come here to pause ! + :i* C Ok?_ fsechodisp w @v !* Wait while (s)he approves ! + :fi uC !* Peek for command ! + qC-4110."e ?uC '"# :fiuC ' !* Get ascii in qC ! + @ft C_...  !* Tell the user we saw input ! + qC-_ "e fi !* If space, ! + oLoop' !* then go on ! + qC f QqXx :"l fi !* If Q or X, ! + ' !* then Exit ! + qC-^"e fi !* If ^, ! + .:ww1:<> oPause' !* Go to previous ! + qC-"e fi !* If Control-R, ! +  oPause' !* then edit and re-pause ! + qC- "e fi !* If Control-L, ! + @m(m.m^R_New_Window) !* Redisplay ! + oPause ' !* and then pause ! + qC-?"e fi !* If ? or Help, ! + ft Space__=_Continue____C-L_=_Redisplay____C-R____=_Edit + Q_or_X_=_Exit________Anything_else_aborts_and_is + ______________________reread_as_a_command. + --Pause-- oPause' !* Show help info ! + ' !* No Such Option. Exit. ! + qC-."e ' !* Return if dot ! + oLoop' !* Continue looking if not comma ! +qC-"e fi !* If cmd = Control-R, ! +  oLoop ' !* Edit and Loop ! +qC-¢e fi !* If cmd = Rubout ! + :-."n .' fkr oSkipLoop ' !* Skip this entry and find next ! +qC- "e fi !* If cmd = Control-L, ! + @m(m.m^R_New_Window)w oLoop' !* Redisplay and loop ! +qC f ? :"l fi !* If cmd = ? or Help ! +!"! ft Space__=_Replace_entry_and_move_on__________C-L_=_Redisplay + Comma__=_Replace_entry_and_await_approval___C-R_=_Edit + Rubout_=_Don't_replace_this_entry + Period_=_Replace_and_exit___________________Anything_else_exits + Q_or_X_=_Exit________________________________and_is_reread_as_a_command. + --Pause-- oLoop ' !* Show help info ! +qC f XxQq "l fi !* If cmd = Q or X, ! + ' !* Just exit, eating char ! +' !* Exit if unknown command ! +!Loop! :-."n.' !SkipLoop!> !* Continue looping ! +:i*CEnd_of_..Jfsechodisplay +0fsechoactive + + + +!Modernize FUNCTION References:! !S Change (FUNCTION form) => #'form ! + +@:i*| :s(FUNCTION( fkc )|,( !* Search for (FUNCTION ! +@:i*| .[0 fll 1f[noquitw -d !* Go kill ending paren ! + q0j 9d @f_ î k !* Kill (FUNCTION & whitespace ! + .u0 !"! i#' 2r !* Insert #' ! + m(m.m &_XLISP_Indent_SEXP) !* Re-Indent S-Expression ! +  !* Go to top of S-Expression ! + |) !"_#'exp + !* Loop asking about this stuff ! + + + +!Modernize Old CATCH/THROW References:! !S CATCH/THROW => *CATCH/*THROW ! + +@:i*| :s(CATCH(THROW( !* Search for (CATCH or (THROW ! + fkc )|,( !* and hop back over it ! +@:i*| .[0[1 1f[noquitw c @fll !* Insert missing star ! + <:@fll 1a-;:@; l> @fll !* Pas first arg ! + :@fll 1a-;"e !"! :i*CH; Can't_hack_comment fserr ' + @m(m.m ^R_Transpose_Sexps) !* Interchange ! + -2@fll !"! i' q0+1j i* !* Back up and quote arg1 ! +  !* Go to top of S-Expression ! + |) !"_(*CATCH/*THROW_'tag_form) + !* Loop asking about this stuff ! + + + +!Modernize QUOTE References:! !S Change (QUOTE form) => 'form ! + +@:i*| :s(QUOTE( fkc )|,( !* Search for (QUOTE ! +@:i*| .[0 fll 1f[noquitw -d !* Go kill ending paren ! + q0j 6d @f_ î k !* Kill (QUOTE & whitespace ! + .u0 !"! i' 2r !* Insert #' ! + m(m.m &_XLISP_Indent_SEXP) !* Re-Indent S-Expression ! +  !* Go to top of S-Expression ! + |) !"_'exp + !* Loop asking about this stuff ! + + + +!Modernize LAMBDA References:! !S Change '(LAMBDA ...) => #'(LAMBDA ...) ! + +@:i*| !"! :s#'(LAMBDA( fkcc )|,( !* Search for '(LAMBDA ! +@:i*| i# r m(m.m&_XLISP_Indent_SEXP) + |) !"<"! m(m.m &_Query_Loop)Modernize:_'(LAMBDA_...)_=>_#'(LAMBDA_...) + !* Loop asking about this stuff ! + + +!Modernize MAP References:! !S Change (MAPxxx '... ...) => (MAPxxx #'... ...)! + +@:i*| [0<:s(MAP"e 0' !* Look for MAP, fail if none ! + .-4u0 !* Remember place we started from ! + 1a:"b @fll ' !* Go to end of printname if not MAP! + @f_ îl !* Move to beginning of next object ! + !"! 1a-'"e q0j -1 '> + |,( !* If just singlequote, win ! + +@:i*| c @fll !"! s' r i# r m(m.m&_XLISP_Indent_SEXP) + |) !"<"! m(m.m &_Query_Loop)Modernize:_(MAPx_'fun_...)_=>_(MAPx_#'fun_...) + + +!Modernize Strings:! !S Search for things in |...| => "..."! + +@:i*~ :s/|"e 0' r -1 ~,( !* Look for | ! +@:i*~ 1f[noquit !* Defer interrupts ! + f[vbwf[vz !* Bind buffer bounds ! + !"! 0,0a-'"e -d ' !* Maybe delete singlequote ! + .,( s/| -d . )fsbound !* Narrow bounds ! + j d <.-z; 1a-/"e c' !* Loop, skip slashed things ! + "# 1af"|!'!:"l i/ '' !* Slashify " or | ! + c > !* Move forward ! + j i"!'! zj i"!'! j !* Insert Doublequotes ! +  !* Return ! + ~) !_"..." !''! + +!Lowercase Lisp Buffer:! !S Lowercase a buffer of lisp text +respecting things that should not get lowercased.! + +[S !* State Register ! +j 0uS !* Initial state 0 ! +< .-z; !* Stop at end of virtual buffer ! + qS"e 1af"|!'!:"l 1auS ' ' !* Complement state on | or " ! + "# 1a-qS"e 0uS ' ' !* Unless in a | or " already... ! + qS"e 1fc ' !* Force case if appropriate ! + 1a-/"e c ' !* Slash says skip next char ! + "# 1a-;"e :sî"ezj''' !* Handle comments ! + :c !* Go forward ! +> !* Loop ! +j z !* Set region around text changed ! +h !* Return ! + + +!Uppercase Lisp Buffer:! !S Uppercase a buffer of lisp text +respecting things that should not get uppercased.! + +[S !* State Register ! +j 0uS !* Initial state 0 ! +< .-z; !* Stop at end of virtual buffer ! + qS"e 1af"|!'!:"l 1auS ' ' !* Complement state on | or " ! + "# 1a-qS"e 0uS ' ' !* Unless in a | or " already... ! + qS"e 1@fc ' !* Force case if appropriate ! + 1a-/"e c ' !* Slash says skip next char ! + "# 1a-;"e :sî"ezj''' !* Handle comments ! + :c !* Go forward ! +> !* Loop ! +j z !* Set region around text changed ! +h !* Return ! + + +!Lowercase Lisp Region:! !S Lowercase a region of Lisp text! + +f[vbf[vz !* Bind buffer bounds ! +.,(w.)ffsbound !* Narrow bounds ! +m(m.m Lowercase_Lisp_Buffer) !* Call aux macro ! + + +!Uppercase Lisp Region:! !S Uppercase a region of Lisp text! + +f[vbf[vz !* Bind buffer bounds ! +.,(w.)ffsbound !* Narrow bounds ! +m(m.m Uppercase_Lisp_Buffer) !* Call aux macro ! + + +!Change LAMBDA Combination to LET:! !& The name says it, man...! + +[0[1[2 !* Bind temp qregs ! +[L[A !* Buf for Lambda and Args ! +f[noquit !* Bind fsnoquit ! +g( flx*( f[bbind ) ) q..OuL !* Get it in temp buffer ! +j fll -d j d fll !* Strip outer parens ! +g( zfx*( f[bbind ) ) q..OuA !* Get args in qA buffer ! +j qLu..O !* Go back to Lambda ! +j c 1a-l"e @flk ilet ' !* make lambda -> let ! + "# @flk iLET ' !* or LAMBDA -> LET ! +s( r flfsbound !* Narrow to just formals ! +j c .,(z-1)fsbound !* Don't count parens either! +< < @f_ î k !* Kill white space ! + 0,1a-;"e l' "# 0; ' > !* Skip comments ! + .-z; !* Stop if no more formals ! + qAu..O !* Go to args buffer ! + < @f_ î k !* Jump leading whitespace ! + 0,1a-;"e l' "# 0; ' > !* Skip comments ! + 3f~NIL"e 0,4a"b 3di() 2r '' !* Convert NIL to () ! + 2f~()"e !* If we have a (), ! + 2d -@f_ k !* Kill it and whitespace ! + @f_ k !* both forward and back ! + 0,1a-;"e l' !* Maybe take comments ! + g( b,.fx*( qLu..O @fll ) ) i_' !* Get any comments in LET ! + "# !* Else, ! + 1:<@fll>"n + :i*TFA Too_Few_Actual_Args fserr ' + @f_ l !* Go across arg and space ! + 0,1a-;"e l ' !* Take comment if any ! + g( b,.fx*( qLu..O i( @fll i_))!* Insert ( & jump formal ! + i)_' !* close arg field ! + > !* Loop ! +zj !* Jump to end of arglist ! +qAu..O @f_ î k !* Kill whitespace forward ! +0,1a-;"e g( hfx*( qLu..O i_ ) ) '!* Get trailing comments ! + "# .-z"e qLu..O ' + "# :i*TMA Too_Many_Actual_Args fserr '' +zj -@f_ k !* Delete trailing space ! +0,(fsz)fsboundw !* Widen buffer bounds ! +1 fsnoquit !* Turn off interrupts ! +qAu..O f]bbind !* Kill arg buffer ! +g( hfx*( f]bbindw flk ) ) !* Get it back ! +-@fll @m(m.m &_XLISP_Indent_SEXP) !* Indent this S-Expression ! + !* Return ! + + +!Modernize LAMBDA Combinations:! !S Change ((LAMBDA ...)...) => (LET (...)...)! + +@:i*| :s((LAMBDA(fkc)| ,( +m.m Change_LAMBDA_Combination_to_LET ( +) ) m(m.m &_Query_Loop)LAMBDA_Combinations:_((LAMBDA_...)_...)_to_(LET_(...)_...) + + +!Modernize NIL Occurrences:! !S Change NIL to ()! + +@:i*| :sNIL( fkcc ) |,( +@:i*| 3d i() |) m(m.m &_Query_Loop)NIL:_NIL_=>_() + + +!& XLISP Indent Sexp:! !& Like ^R Indent SEXP but tries not to err out! + +[0 !* Push q0 ! +.( 1:<@fll>w .u0 )j !* Find end of SEXP ! +.( 1:<:fll>w .-q0"g )j 0' !* See if next list is farther ! + 0,1a-("n )j 0' !* Don't fill if no close paren! + )j !* Resume state and proceed ! +]0 !* Pop q0 ! +f:m(m.m ^R_Indent_Sexp) !* Jump to ^R Indent SEXP ! + + +!Change / to \:! !S Update buffer for the new Lisp backslash syntax! + +j @f îl !* Jump over blank lines ! +1:fb-*-"e !* If there's no file prop list ! + i;;;_-*-_Mode:_Lisp;_-*-î  !* Make a default one ! + js-*-' !* Search for start of -*- ! +1:fbEscape:"e !* If no escape marked ! + i_Escape:_Slash;' !* Make a default setting ! +"# :fwl !* Go to head of field ! + .,(s;-:fwl.)f~slash"n !* Compare escape char with slash ! + :i*CBuffer_not_using_slash_escape_charfsechodisplay + 0fsechoactive l 0,.( j )'' !* Maybe return early ! + !* ! +[S !* State Register ! +j 0uS !* Initial state 0 ! +< .-z; !* Stop at end of virtual buffer ! + qS"e 1af"|!'!:"l 1auS ' ' !* Complement state on | or " ! + "# 1a-qS"e 0uS ' ' !* Unless in a | or " already... ! + qS"e !* Only outside of |s or "'s ! + 1a-;"e :sî"ezj' oLoop'' !* Ignore commented stuff ! + 1a-\"e i\ oLoop' !* Make \ quote itself ! + 1a-#"e !* Skip # ! + 2a-/"e 2c' !* #/ is as before ! + 2a-\"e 2c' oLoop' !* #\ is as before ! + 1a-/"e 0,2a-/"e d' !* // goes to / ! + "# f\' !* / goes to \ otherwise ! + c oLoop' !* Update display and loop ! + !Loop! !* Come here to continue looping ! + :c !* Go forward ! +> !* Loop ! +j s-*- sEscape: :fwl !* Kill old escape info ! + iBack !* Say we are using Backslash now ! +:i*CConversion_of_/_to_\_complete.Afsechodisplay 0fsechoactive +j z !* Set region around text changed ! +h !* Return ! + + +!Interchange slash and backslash:! !S Swap slash and backslash ! + +j +@:i*| :< :s57"e zj 0;' 0,-2a:"d 0,-2a:"a 0,1a:"d 2r 0;''' > .-z | ,( +@:i*| 2d i#// | ( +) ) m(m.m &_Query_Loop)Change_/_to_\:__Maybe_change_octal_57_to_#// + +j +@:i*| :< :s47"e zj 0;' 0,-2a:"d 0,-2a:"a 0,1a:"d 2r 0;''' > .-z | ,( +@:i*| 2d 0,1a-."e d' i#// | ( +) ) m(m.m &_Query_Loop)Change_/_to_\:__Maybe_change_decimal_47_to_#// + +j +@:i*| :< :s#o57"e zj 0;' 0,1a:"d 0;' > .-z | ,( +@:i*| 2d i#// | ( +) ) m(m.m &_Query_Loop)Change_/_to_\:__Maybe_change_#o57_to_#// + +j +@:i*| :s slash  | ,( +@:i*| 5r -4f~BACK"e -4d ' + "# 1a-s"e iback' + "# 2a-L"e iBACK' + "# iBack fs''' 5c | ( +) ) !""""! m(m.m &_Query_Loop)Change_/_to_\:__Maybe_interchange_``slash''_and_``backslash + +j z +h