diff --git a/build/build.tcl b/build/build.tcl index 0c92bb0a..40e4e684 100644 --- a/build/build.tcl +++ b/build/build.tcl @@ -260,7 +260,10 @@ respond "EMACS Editor" "\033xload\033purify\r" respond "\n" "\033xgenerate\033emacs;info\033emacs1;info\r" respond ":EJ" "\033xbare\033emacs1;bare\r" respond "\n" "\033xgenerate\033emacs;abstr\033emacs1;abstr\r" +#respond ":EJ" "\033xgenerate\033emacs;auto-s\033emacs1;auto-s\r" +respond ":EJ" "\033xgenerate\033emacs;dired\033emacs1;dired\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" respond ":EJ" "\033xgenerate\033emacs;pictur\033emacs1;pictur\r" respond ":EJ" "\033xgenerate\033emacs;sort\033emacs1;sort\r" @@ -268,6 +271,8 @@ respond ":EJ" "\033xgenerate\033emacs;page\033emacs1;page\r" respond ":EJ" "\033xgenerate\033emacs;scrlin\033emacs1;scrlin\r" 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" "\033xrun\033einit\033? Document\r" respond "\n" "\030\003" diff --git a/doc/emacs1/modlin.info b/doc/emacs1/modlin.info new file mode 100755 index 00000000..4385487e --- /dev/null +++ b/doc/emacs1/modlin.info @@ -0,0 +1,66 @@ +The MODLIN Library Monday, February 4, 1980 + Updated Saturday, July 16, 1983 + +The mode line has the following form: + +{editor} {time} [{superior}: {modeinfo} {options} {type} {buffer}] {file} + +{editor} is the value of Emacs' "Editor Name" variable. + +{time} is time and date, or just time (see below). This gets updated even + if in a recursive ^R mode. + +{superior} is displayed on ITS if this Emacs is not at toplevel (eg, when + a LISPT lives under its lisp, you will see LISP: or in a MAILT + you will see MAIL:) + +{type} is the value of the Emacs "Editor Type" variable enclosed in angle + brackets, or a "-" if no such value is assigned. If {buffer} is + omitted (see below) and this would have displayed as a "-", it is + also omitted. + +{buffer} is now omitted if the buffer name is the same as fielname1 of {file} + +{modeinfo} now shows the submode if any attached to the mode with a hyphen. + eg, if you load the PICTUR library and do MM Edit Picture you + might see something like: + [MAIL: Fundamental-Picture ...] + +{options} A number of new options now display. They include: + + NoSave - Autosave, if normally on, has been disabled + Save - Autosave turned on + SaveOld - Save this file automatically if new file read + into buffer + NoSaveOld - Don't ask and don't save file if new file read + into buffer + ReadOnlyFile - Saving, as in C-X C-S, will query before allowing + file to be written back. Saving via C-X C-W will + not bother to query since it reads a new filename. + ReadOnlyBuf - Buffer is protected from modification. + ReadOnlyFile/Buf - Same as ReadOnlyFile+ReadOnlyBuf + OverWrite - Overwrite mode enabled + Def - Keyboard Macro definition underway + Narrow - Buffer bounds have been narrowed. + + Following these options, other user-set options, such as Abbrev + mode, are inserted. + +{file} is the file being visited. If the file is a ">" or "<" file (ITS) + or ".0" or ".-2" file (Twenex), a designator "=nnn" where the nnn + is the version number of the file which was actually visited. + If the ">" or "<" file is not a numbered file, then the designation + "~fn2" will appear where fn2 is the actual second filename of the + visited file. Odd cases of fn2's which are not understood by MODLIN + will appear as "#" in place of "=nnn" or "~fn2". + +The following switch variables are of interest: + + Time Only:0 Show date and time. This is the default. + Time Only:1 Show time only. + + Invert Filenames:0 Show filenames normally. This is the default. + Invert Filenames:1 Show filenames in funny order. Useful if filenames + are frequently too long to fit. + FOO BAR JDOE; on ITS + FOO.BAR PS: on Twenex diff --git a/doc/emacs1/vt100.info b/doc/emacs1/vt100.info new file mode 100755 index 00000000..72eb0d91 --- /dev/null +++ b/doc/emacs1/vt100.info @@ -0,0 +1,40 @@ + +KMP@MIT-MC 11/02/79 17:55:47 +To: INFO-EMACS at MIT-MC +For those of you with VT100 terminals if you run in ANSII mode, the +VT100 library, which you can get via + + MM Load LibraryVT100 + +will set up the keypad to do pretty reasonable things as follows: + +(1) Keypad digits and minus are args to the next command automatically. + [Normal digits in main key area are self-inserting still]. + +(2) Comma will eventually be an arg separator for advanced commands that + take precomma args. I haven't coded this yet. + +(3) Dot runs ^R Documentation like ^_H or Top-H would normally do. + +(4) Arrows go vertically up, down, back and forth, independent of what + you define ^B,^F,^N,or ^P to do ... + +(5) PF1-4 run macros you can define. They are initially undefined. + +(6) Enter followed by a PF-key will read characters like the ^X(...^X) does + up until the next ^X), C-M-C, or Enter that you type. You can abort + a definition by doing ^]. + +Sorry for the length of the message, but hopefully this will be of interest +to enough of you to make it worthwhile. + +Interestingly enuf, this will not work on AI. No, I am not boycotting -- I +just don't know what the new Emacs over there has done and I am nearly sure +that my stuff is wholely incompatible at this point ... when the new emacs +works its way back over to MC (which is happening slowly now), I will work +on an all-ITS compatible version of the handler. + +-kmp + + + \ No newline at end of file diff --git a/src/emacs1/auto-s.118 b/src/emacs1/auto-s.118 new file mode 100755 index 00000000..44b5c0f1 --- /dev/null +++ b/src/emacs1/auto-s.118 @@ -0,0 +1,235 @@ +!* -*-TECO-*- *! + +!~FILENAME~:! !New version of Auto Save Mode and its associates.! +AUTO-SAVE-MODE + +!& Setup AUTO-SAVE-MODE Library:! !S Install hooks, create variables. +Runs Auto-Save-Mode Setup Hook, if it is non-0, in which case it +must take care of setting keys, fsClkMacro, fsClkInterval, ..F and +.F. We set those only when there is no hook.! + + m(m.m& Declare Load-Time Defaults) + Auto-Save-Mode Setup Hook, + If non-0, called when AUTO-SAVE-MODE is loaded: 0 + + [1[k + + !* First make sure no previous MM-variables are going to cover our functions:! + + m.mKill Variableuk !* K: Killer.! + mkMM & Auto Save Setupw !* Kill kill kill! + mkMM & Auto Save Filew !* ...! + mkMM ^R Save Filew !* ...! + mkMM & Secretary Macrow !* ...! + mkMM & Auto Save All Buffersw !* ...! + mkMM & Real-time Interruptw !* ...! + + !* Now do some of our own installing: ! + + !* Note that we will PREpend our exit hook, so that in case there! + !* was already some other auto-saver hook there, we go first and! + !* theirs probably will be a no-op since the buffers wont be! + !* modified any more.! + + 0fo..qExit Hookf"ew :i*'u1 !* 1: Old hook.! + @:i*|ff"e m(m.m& Auto Save All Buffers)' !* Prepend our hook.! + 1|m.vExit Hookw !* ...! + + !* Some installing is only if there is no hook: ! + + qAuto-Save-Mode Setup Hookf"nu1 m1' !* Run hook, if non-0.! + "#w !* No hook. We install.! + m.m& Secretary Macrof(u.f)u..f !* .F, ..F: Install our one.! + m.m& Real-time InterruptfsClkMacrow !* Install our clock! + !* interrupt handler.! + fsClkInterval"e 4*60*60fsClkIntervalw' !* set interval if none! + m.m^R Save Fileu:.x()' !* C-X C-S: our save file function! + +  + +!& Auto Save Setup:! !S Decide whether to turn on auto saving for file! + 0[1 !* 1: to save or not to save! + qBuffer Index[2 !* 2: index into .B of current buffer! + qBuffer Filenamesf"nf[DFile !* if buffer filenames, examine them! + fsDVersion"e !* saving to >! + q:.b(q2+12)"e !* and not read-only! + 1u1''' !* then we save! + q1u:.b(q2+10)  !* just store the answer! + +!& Auto Save File:! !S Subroutine that may write out an auto save file. +NUMARG is Buffer Index of buffer in .B to save. +We run Before Auto Save Hook and After Auto Save Hook if non-0.! + + m(m.m& Declare Load-Time Defaults) + Before Auto Save Hook, If non-0 is run just before auto saving: 0 + After Auto Save Hook, If non-0 is run just after auto saving: 0 + Auto Save Star, * If non-0, user wants * in mode line after auto-save: 0 + + + [1[2[3[4 0f[VB 0f[VZ !* Wide bounds.! + + -qBuffer Index"e qBuffer filenamesu1' !* 1: buffer filenames! + "# q:.b(+2)u1' !* ...! + q1"e @ftNo auto save filenames.  0fsEchoActivew ' + + q1f[DFile !* set default to buffer filenames.! + + !* Now figure what version to use.! + + fsURead"n e[fne]' !* maybe push input file! + 1:< 1,er fsIFileu3 fsIFVersionu4 fsIFCDateu2 ec + !* 3: Full filename of highest version.! + !* 4: Its version number.! + !* 2: Its creation date.! + + q2-(0fo..qASav 3 File)"e !* Was an auto save version already.! + q4fsDVersionw !* so save to that version again! + fsDFileu1 !* ...! + etASAVE OUTPUT' !* but open ASAVE.OUTPUT on TNX to! + !* prevent a crash from leaving a zero! + !* length file! + >w !* end of errset! + + qBefore Auto Save Hookf"nu2 m2'w !* Run before hook if non-0.! + + fsUWrite"n e\fne^' !* maybe push output file! + ei fsOFCDateu2 !* 2: Its creation date.! + hp ef1 !* restore filenames to force EF to! + !* rename, and write it out.! + fsOFVersionf"gu:.b(+9) 1fsModeChange'w !* save actual version number! + zu:.b(+5+6) !* Update size last read/saved.! + fsOFileu1 !* 1: Auto save files full name.! + q2u:.b(+8) !* Update buffer date field.! + q2m.vASav 1 Filew !* Declare it an autosave file.! + @ftAuto saved: 1 + !* tell user exact filename written! + + qAfter Auto Save Hookf"nu1 m1'w !* Run after hook if non-0.! + + 0fsXModifiedw !* Lets not save it again.! + qAuto Save Star"e 0fsModifiedw' !* if user wants star to go away, make it! + !* go away! + 0fsEchoActivew  + +!^R Save File:! !^R Write out a user-save file if needs it. +A user-save file is one written by user decision, and therefore never to + be touched by auto saving. E.g. a high-level backup point. +Declares this version to be a user-saved file, i.e. NOT an auto saved + one. Thus, auto saving will not occur to this version again. +Given an explicit NUMARG, we just run & Auto Save File, to ensure that the + file is currently safe, if not user-level consistent: thus this will + keep the file declared an auto save file. +A NUMARG of 16 or greater calls & Auto Save All Buffers.! + + -16:"l m(m.m& Auto Save All Buffers)w 1' + :i*CfsEchoDis !* clear echo area! + ff"g !* NUMARG.! + fsXModified"e @ft(No changes need to be written) + 0fsEchoActivew 1' !* tell user buffer doesnt need changing! + @ft(auto save) + !* or tell him auto save started! + qBuffer Indexm(m.m& Auto Save File) !* auto save current buffer! + 1' !* ! + + [1[2[3[4 f[DFile !* Should we be saving default?! + 0f[VB 0f[VZ !* Wide bounds.! + qBuffer Filenamesf"ew :i*No filenames to save underfsErr + 'u1 !* 1: User-save filenames.! + et1 !* Set default! + q1u2 !* 2: Start with filename in case the! + !* input below gives an error.! + fsURead"n e[fne]' !* maybe push input file! + 1:< 1,er fsIFileu2 fsIFVersionu3 fsIFCDateu4 ec + !* 2: Highest version filename.! + !* 3: Its version number.! + !* 4: Its creation date.! + q4-(0fo..qASav 2 File)"e !* That is an auto save file.! + q3fsDVersionw !* So re-use that version.! + fsDFileu1 !* ...! + etASAVE OUTPUT' !* on TNX, open different filename to! + !* prevent a crash from leaving a zero! + !* length file! + + + q:.b(qBuffer Index+8)u3 !* read or wrote the file.! + q4"n q3"n q4-q3"n !* If not, warn user he may be losing.! + ftThis file has been written on disk since you last read or wrote it. +Should I write it anyway + m(m.m& Yes or No)(f 0u..h)"e 0'''' + >w + + fsXModified"e @ft(No changes need to be written) +' + "# fsUWrite"n e\fne^' !* maybe push output file! + ei fsOFCDateu3 !* 3: Its creation date.! + hp ef1 !* restore filenames to force EF to! + !* rename, and write it out.! + fsOFVersionf"gu:.b(+9) 1fsModeChange'w !* save actual version number! + zu:.b(qBuffer Index+5+6) !* Update size last read/saved.! + fsOFileu2 !* 2: User save files full name.! + q3u:.b(qBuffer Index+8) !* Update buffer date field.! + @ftUser saved: 2 + + 0fsXModifiedw' !* no longer needs auto saving! + fs^RMDlyfs^RMCntw !* not even in near future! + 0fsModifiedw !* no longer needs user saving! + + m(m.mKill Variable)ASav 2 Filew + !* Remove any assertion that this was an auto save file. Note! + !* that this is not conditional on fsModified since the buffer! + !* may have just been written out due to an auto save.! + !* However, we must at least declare that auto saved file to! + !* now be a user saved file.! + + 0fsEchoActivew 1  + +!& Secretary Macro:! !S ..F: Auto save for use in ^R mode editing. +The buffer is auto saved after every fs^RMDly characters. +Auto saving happens by calling & Auto Save File.! +!* I (ECC) think that Teco must be the one to reset fs^RMCnt, and it + * does it after we are done -- and if we get an error it is not reset. + * So if we are not careful if someone gets a write error (e.g. no + * access) the ..F will go off again the very next character they type. + * For now, until we have a better solution, I am having ..F reset + * fs^RMCnt from fs^RMDly itself once it decides to call & Auto Save File.! + + qBuffer Index[1 !* 1: index of current buffer! + q:.b(q1+4)[..o !* Teco-select the current EMACS! + !* buffer -- i.e. dont let any temp! + !* teco buffers get in the way.! + fsXModified"e 1' !* Buffer doesnt need saving.! + q:.b(q1+10)"e 1' !* Not supposed to save it.! + + :i*CfsEchoDis @ft(auto save) + 0fsEchoActivew !* tell user what we are up to.! + fs^RMDlyfs^RMCntw !* Reset count before chance of bad error! + q1m(m.m& Auto Save File) !* auto save current buffer! + 1 + +!& Auto Save All Buffers:! !S For each buffer that requires it. +I.e. for each that is modified and has auto saving on. +& Auto Save File is called.! + + 0[1 [2 -1[3 [..o !* 1: .B index, 3: saved count! + < 1f !* end auto save test catch! + q1+q:.b(q1)u1 !* 1: move to next buffer slot.! + q1-(fq.b/5); > !* Continue till done .B! +  + +!& Real-time Interrupt:! !S Save file after 5 minutes of idle time.! + 0fsTyiCount"n 0' !* User has been typing in last 5 minutes! + !* so dont save -- this is an easy way of! + !* avoiding possible messup of the screen! + !* at funny times (like in & Read Line) or! + !* to avoid being obnoxious to use and! + !* saving the current buffer 2 characters! + !* after it was just saved.! + m(m.m& Auto Save All Buffers) + 0@v 0 diff --git a/src/emacs1/dired.205 b/src/emacs1/dired.205 new file mode 100755 index 00000000..f782187b Binary files /dev/null and b/src/emacs1/dired.205 differ diff --git a/src/emacs1/taggen.45 b/src/emacs1/taggen.45 new file mode 100755 index 00000000..d6e43cf1 --- /dev/null +++ b/src/emacs1/taggen.45 @@ -0,0 +1,316 @@ +!*-*- Teco -*-*! + +!~Filename~:! !Macros for supporting Emacs TAGS file setup! +TAGGEN + +!Generate Tags File:! !S Make updates to an existing TAGS file as needed +Reads a string argument of a TAGS file to be updated. The file must be in +standard tags file format... eg, + + , + + + + , + + + ...etc... +! + + f[dfile !* Bind Teco Default File ! + f[bbind !* Bind temp buffer ! + fsmsnamefsdsname !* Default file uses working dir ! + et FOO_TAGS  !* Default fn1,fn2 is FOO TAGS ! + 5,f Tags_File !* Get filename in qF ! + etF !* Use defaults ! + e?"n :i*NSF No_Such_Filefserr' !* Err if no such file ! + er @y !* Yank file ! + + !* Purge stale data if any ! + + <.-z;2l.,(sr.)kl>j !* Delete cruft ! + + !* Process new tags stuff ! + + + [T[F[N[L[P[X !* qT = Main Tags Table Buffer ! + !* qF = Temp Filehacking Buffer ! + !* qN = Filename being hacked ! + !* qL = Language being hacked ! + !* qP = Point of file data start ! + !* qX = Random Temporary ! + + q..OuT !* Current buffer is qT ! + f[bbindw q..OuF !* Make new buffer for qF ! + qTu..O !* Get back tags buffer ! + <.-z; .uP !* Stop at end of tags buffer ! + 1:xN !* Get filename into qN ! + l 1a"d \w 1a-,"e oGoodSyntax'' + :i*SYN Illegal_Syntax_in_Tags_File fserr + !GoodSyntax! !* Come here if syntax correct ! + d 0k i00000, !* Insert 5 digits ! + 1:xL !* Get language in qL ! + l !* Put cursor in position ! + qFu..O !* Get filehacking buffer ! + f[dfile !* Bind default file ! + e?N"n :i*FNF File_Not_Foundfserr' + er@y !* Yank file into buffer ! + f]dfile !* Unbind default file ! + 1,m.m &_Tags_Process_L_Bufferf"n[0 + qT m0 w ]0' !* Macro hook if exists ! + "#w :i*UTL Unknown_TAGS_Language:_"L"!''!fserr' + hk qTu..O !* Get Tags buffer back ! + l .( .-qP:\uX fqX-5"g :i*FTL File_Too_Largefserr' + qPj l 5d 5-fqX,0i gX !* Insert Number of chars to jump ! + )j !* Return where we started ! + > !* Loop getting more files ! + ew hp ef !* Write it out ! + qFu..O !* Set up for unwinding ! +  !* Pop the world ! + +!& Tags Default Snarf:! !& Snarf start of line to point into arg buffer +with a precomma arg, get arg1,point into arg2 buffer ! + + g( .( !* Get point ! + g( ff&2"n,.'"#0'x*( !* ... but first preceding cruft ! + [..O )) !* ... but first change buffer ! + i› !* ... and insert rubout ! + )) iî  w !* Return ! + + +!& Tags Process LSPDOC Buffer:! !& Process tags for a buffer of Lisp doc ! + +m.m &_Tags_Default_Snarf !* Get temp ! +<:sBegin-Entry:; !* Find entry starts ! + :l mS !* Snarf data ! +> !* Loop ! + !* Return ! + +!& Tags Process MAXDOC Buffer:! !& Process tags for a buffer of Macsyma doc ! + +m.m &_Tags_Default_Snarf !* Get temp ! +:<:s&; !* Search for & not preceded by ^Q ! + fk+1+.,(@fll)mS !* Snarf data ! + > !* Loop ! + !* Return ! + +!& Tags Process BLISS Buffer:! !& Process tags for a buffer of BLISS code ! + +m.m &_Tags_Default_Snarf !* Get temp ! +:<:S routine; !* Search for `routine` ! + fk+1+.,(fwl)mS> !* Snarf the data, looping ! + !* Return ! + +!& Tags Process Macsyma Buffer:! !& Process tags for a buffer of Macsyma code ! + +!* *! +!* In MACSYMA code, a function definition is recognized when there is *! +!* a symbol at the beginning of a line, terminated with a "(" or "[", *! +!* and there is a ":" later on in the line. If the symbol itself is *! +!* terminated with a ":", a variable definition is recognized. *! +!* *! + +m.m &_Tags_Default_Snarf !* S: Useful tagging macro ! + +[1 !* 1: Temp for holding old position ! +< .u1 !* q1 remembers this place ! + :s;$"\/*;!'!; !* Search for interesting chars ! + 0a-* "e s*/ oEnd' !* Ignore comments ! + 0a-"!'!"e r s\" !'! oEnd' !* Ignore strings ! + 0a-\ "e c oEnd' !* Ignore \'d stuff ! + !"l + !* Finally, find label for line ! + :l mS !* if it is there, snarf it ! + q1j' !* Move to end of field ! + !End! > !* End of loop ! + !* Return ! + +!& Tags Process LISP Buffer:! !& Process tags for a buffer of LISP code ! + +m.m &_Tags_Default_Snarf [S !* S: Useful tagging macro ! + 0 [0 !* 0: Temp ! + :i* (DEF (SETQ [1 !* 1: Kinds of defs we seek ! + !* ! +j < :s(@DEFINE; !* Search for other stuff ! + -@fll .-1,( 2@fll ),mS !* Index that, too, just for fun ! + -@flx0 :i11 (0 !* Get new @DEFINE thing to find ! + > !* Loop ! + !* ! +j < :s1; !* Search for one of these ! + -@fll 2@fll mS > !* and index it if found ! + !* ! + !* Return ! + + +!& Tags Process SCHEME Buffer:! !& Process tags for a buffer of Scheme code ! + +f:m(m.m &_Tags_Process_Lisp_Buffer) !* Go where we shoulda been ! + + +!& Tags Process TJ6 Buffer:! !& Process tags for a buffer of TJ6 code ! + +!* *! +!* In TJ6 text, any line which starts with .C TAG starts a tag. The *! +!* name of the tag is whatever follows the spaces which should follow the *! +!* "C TAG", up to the next space or the end of the line. *! +!* *! + +m.m &_Tags_Default_Snarf !* Get temp ! +<:s .C_TAG_; !* Find tags ! + @f_l :fb_"e :l' mS !* Snarf data ! +> !* Loop ! + !* Return ! + + +!& Tags Process MUDDLE Buffer:! !& Process tags in a buffer full of MDL code! + +!* *! +!* In MUDDLE code, a tag is identified by a line that starts with *! +!* " !* Loop ! + !* Return ! + + +!& Tags Process TECO Buffer:! !& Process tags in a buffer full of Teco code! + +!* *! +!* In TECO code, a tag starts with an exclamation mark and ends with a *! +!* colon followed by an exclamation mark. There may be any number of tags *! +!* on a line, but the first one must start at the beginning of a line. *! +!* *! + +m.m &_Tags_Default_Snarf !* Get temp ! +<:s î !; !* Search for ^L ! + <:fb:!; !* Search for ! + :fb!"e :l 0; '> !* Hop across any number of tags ! + mS >  !* Snarf, Loop, Return ! + + +!& Tags Process R Buffer:! !& Process tags in a buffer full of R code! + +!* In R code, any line which starts with ".de" or ".am" or ".rtag" *! +!* defines a tag. The name of the tag is what follows, up to the second *! +!* run of spaces or the end of the line. There is no ".rtag" in R; *! +!* define it to be a null macro, if you like, and use it to put in tags *! +!* for chapters, or anything else. Any macro whose name starts with "de" *! +!* or "am" or "rtag", such as ".define" or ".amplify", also defines a *! +!* tag. *! +!* *! + +m.m &_Tags_Default_Snarf !* Get temp ! +< :s .de .am .rtag; !* Find the tags ! + -fwl @fll @f_ l !* Skip spaces ! + :fb_"e :l ' !* Find next spaces set or end of line ! +  mS !* Snarf the tag ! +>  !* Loop and return ! + + +!& Tags Process MIDAS Buffer:! !& Process tags for buffer of MIDAS code! + +!* *! +!* In MIDAS code, a tag is any symbol that occurs at the beginning *! +!* of a line and is terminated with a colon or =. Thus, MIDAS mode is *! +!* good for MACRO-10 also. *! +!* *! + +m.m &_Tags_Default_Snarf !* Get temp ! +<:s ; r fwl !* Go over first token ! + 1af:=:"l c  mS' !* If token ends in : or =, take it ! +> !* Loop ! + !* Return ! + + +!& Tags Process MACRO Buffer:! !& Process tags for MACRO assembly language! + +!* *! +!* This is copied intact from the MIDAS code. *! +!* *! + +m.m &_Tags_Default_Snarf !* Get temp ! +<:s ; r fwl !* Go over first token ! + 1af:=:"l c  mS' !* If token ends in : or =, take it ! +> !* Loop ! + !* Return ! + + +!& Tags Process FAIL Buffer:! !& Process tags for FAIL assembly language! + +!* *! +!* FAIL code is like MIDAS code, except that one or two 's or "^"'s *! +!* are allowed before a tag, and spaces are allowed between the tag name *! +!* and the colon or =, and _ is recogniized as equivalent to =. *! +!* *! + +m.m &_Tags_Default_Snarf !* Get temp ! +<:s   ^; !* Look for Linefeed + ^A, ^ or alpha ! + r @f^ l @fll @f_ l !* Go over first token ! + 1af:=_:"l c mS' !* If it ends in a :, _, or =, take it ! +> !* Loop ! + !* Return ! + + +!& Tags Process TEXT Buffer:! !& Process tags in a buffer full of text! + +!* Text buffers have no tags, BUT they are useful to have in tags tables for *! +!* Emacs Tags Search mapping harmlessly through them ... *! + + !* Just return ! + + +!& Tags Process PALX Buffer:! !& Process tags in a buffer full of PALX code! + +!* *! +!* PALX code is like MIDAS code, except that spaces are allowed between *! +!* a tag and the following colon or equals, and local tags such as "10$" *! +!* are ignored. *! +!* *! + +m.m &_Tags_Default_Snarf !* Get temp ! +<:s ; r fwl !* Go over first token ! + 0a-$"n !* If not a $ tag ! + @f_ l !* Go over any whitespace ! + 1af:=:"l c  mS'' !* If token ends in : or =, take it ! +>  !* Loop and return ! + + +!Make Tags File:! !S Make a skeleton tags file for other routines to fill in. +Asks for output filename (the new TAGS file), and a list of (possibly wild) +input filespecs. Terminate list by typing just CR. +! + + [0 [1 [2 [3 [4 !* Save q-regs! + f[ D File !* Save default filespec! + f[ B Bind !* Scratch buffer! + f6TAGS fs d fn2 !* Default ext is tags! + :i*Output_tag_file:_,400001.:et !* Get output filespec! + :g(fs d file)u4 q4u1 !* Save it! + f6 fs d fn2 !* Default extension is nul! + < !* Loop to get input files! + 0fs d version q1u2 !* Default to the highest generation! + :i*Files:_,100.:et !* Get files to examine! + :g(fs d file)u1 !* Get name we just parsed! + f=12@; !* Exit if were the same (user typed CR)! + 1,111110000001.ez1 !* Put listing in buffer! + > !* Got all input filespecs! + j <.-z; !* For whole list! + .u0 :l !* Remember where line starts! + -2s. c .u1 s. .-1u2 !* Locate extension field! + :k 0\ !* Change generation to zero! + :i3NONE !* Default is NONE mode! + q1,q2f=MAC"e :i3MACRO' !* Midas assembler! + q1,q2f=MID"e :i3MIDAS' !* Macro assembler! + q1,q2f=TECO"e :i3TECO' !* Raw Teco! + q1,q2f=EMACS"e :i3TECO' !* Emacs Teco! + 13i 10i i, g3 13i 10i i !* Rest of skeleton! + .+7-q0u1 !* How long, including count and CRLF! + -l q1\ fku0 q0c q0+5,0i !* Put in length field, left fill zeros! + 2l> !* Done with loop! + e\ et4 :ew hp :ef !* Dump the tag table! + m(m.mGenerate_Tags_File)4 !* Flesh out skeleton! +  !* Bye! diff --git a/src/emacs1/vt100.49 b/src/emacs1/vt100.49 new file mode 100755 index 00000000..5513335e --- /dev/null +++ b/src/emacs1/vt100.49 @@ -0,0 +1,352 @@ +!* -*- TECO -*- ! +!* [MIT-XX]PS:VT100.EMACS.46, 14-Apr-85 21:55:07, Edit by SRA! +!* Left and right arrows were reversed for keypad, fixed.! +!* [WASHINGTON]PS:VT100.EMACS.45, 11-Oct-83 18:53:46, Edit by FHSU! +!~Filename~:! !A library for hacking EMACS on VT100's! +VT100 + +!& Setup VT100 Library:! !Things to do when this library loads +Define keypad handler, Redefine ^X), etc... ! + + [0 [1 + + 0fo..q Exit_to_Inferior_hooku1 + fq1"l :i1' + @:i*`1wm(m.m VT100_Normal_Keypad)`m.v Exit_to_Inferior_Hook + + 0fo..q Exit_to_Superior_Hooku1 + fq1"l :i1' + @:i*`1wm(m.m VT100_Normal_Keypad)`m.v Exit_to_superior_hook + + 0fo..q Return_From_Superior_hooku1 + fq1"l :i1' + @:i*`1wm(m.m VT100_Alternate_Keypad)`m.vReturn_From_Superior_hook + + 0fo..q Return_From_Inferior_hooku1 + fq1"l :i1' + @:i*`1wm(m.m VT100_Alternate_Keypad)`m.vReturn_From_Inferior_Hook + + m(m.m VT100_Alternate_Keypad) !* Put terminal in alt keypad mode! +0"n + fs osteco"n + m(m.aTRMTYP#_Trmtyp_VT100V)-fsrgetty"'e+( + m(m.aTRMTYP#_Trmtyp_VT100X)-fsrgetty"'e)"n + FT VT100_library_works_with_terminal_in_ANSII_mode_only. + Use_terminal_type_VT100_or_VT100W.''' + m.v VT100_Dispatch_Table + 128m(m.m Make_Prefix_Char)VT100_Dispatch_Tableu..O + qVT100_Dispatch_Table[0 + qPrefix_Char_List[3 + :iPrefix_Char_List3 Keypad__qVT100_Dispatch_Table + + m.m ^R_Up_Real_Lineu:0(A) !* Uparrow! + m.m ^R_Down_Real_Lineu:0(B) !* Downarrow! + 2fs^R Init u:0(D) !* Leftarrow = C-B.! + 6fs^R Init u:0(C) !* Rightarrow = C-F.! + m.m ^R_VT100_Define_KBD_Mac u:0(M) !* Enter starts or stops keyboard macro.! + m.m ^R_VT100_Comma u:0(l) !* Comma! + m.m ^R_VT100_Minus u:0(m) !* Minus sign on numeric keypad.! + m.m ^R_Documentation u:0(n) !* Dot! + m.m ^R_VT100_Arg_Digit[1 + p-1[2 + 10< q1u:0(%2) > !* Digits on numeric keypad.! + 0fo..q VT100_Setup_Hooku1 + q1"n m1' +  + +!VT100 Alternate Keypad:! !C Sets alternate keypad mode for VT100's +When this command is executed, the numeric keypad can be used to enter +arguments for the following function. Numbers are entered as themselves, +dot and "enter" key on the pad are also changed.! + + :I*=[?1hFS IMAGE OUT !* Put VT100 in application mode ! + +!VT100 Normal Keypad:! !C Undos alternate keypad mode for VT100's +When this command is executed from a VT100, the keys on the keypad become +functionally identical to the standard digit keys. See VT100 Alternate Keypad +for a description of the alternative.! + + :I*[?1l>FS IMAGE OUT + +!^R VT100 Define Kbd Macro:! !^R Start or Stop defining kbd macro. +When stopping, we ask for a key to to place the kbd macro on.! + + fs tyi sink"e !* If not defining something, ! + F@:m(m.m ^R_Start_Kbd_Macro)' !* Start definition ! + "# + 1m(m.m ^R_End_Kbd_Macro) !* Else stop defining! + m(m.mName_Kbd_Macro)' !* and put the definition somewhere.! +  + +!^R VT100 Minus:! !^R Negate numeric argument.! + -u..1 :m(q..1+200.@fs^R Init) + +!^R VT100 Arg Digit:! !^R Digit of numeric argument.! + q..1-p+0u..0 :m(q..0+200.@fs^R Init) + +!^R VT100 Comma:! !^R Run precomma arg! + + 0fs^RArg 0fs^RArgp !* Zero argument ! + ,@m(@fif(f(fs^Rlastw)u..0)@fs^RCmacro)@v !* Call first char specially ! + q0(]0)'( + )')@m(@fif(f(fs^Rlastw)u..0)@fs^RCmacro)@v> + 0 + +!C132 Mode:! !C Put VT100 in 132 column mode and change ^S/^Q +^R Incremental search becomes ^\. ^Q inside search becomes ^^. +Outside of searches, you must use ^^Q to quote a character.! + + m(m.mVT100_Page_Mode) !* Set new incremental search cmds! + :i*[?3hfs image out !* Set 132 column mode! + 131fs width + -1fs pjatyf+ !* Need to refresh whole screen! + +!C80 Mode:! !C Put Vt100 in 80 column mode (see C132 Mode)! + + -1m(m.mVT100_Page_Mode) !* Set new incremental search cmds! + :i*[?3lfs image out !* Set 80 column mode! + 79fs width + -1 fs pjatyf+ !* Refresh screen! + +!VT100 Page Mode:! !C Set Page Mode and change incremental search cmds. + C-X C-S becomes C-X S + C-X C-Q becomes C-X ~ + C-S becomes C-\ + C-Q within a search becomes C-^ (C-` on the VT100 keyboard). + C-Q outside a search becomes C-^^ (C-` C-`) + +To search for ^Q or ^S, do within search C-^ Q or C-^ S, resp. M-* inserts a +^Q into the buffer. A negative arg turns this lossage off.! + + "L + Qm.vSearch_Quote + m.m^R_Incremental_SearchFO..qControl_S_CommandU.S + m.m^R_Quoted_Insertfo..qControl_Q_CommandU.Q + q.\fo..qControl_\_Commandu.\ + q:.X(~)fo..qPrefix_~_Commandu:.X(~) + q:.X(S)fo..qPrefix_S_Commandu:.X(S) + q..*fo..qMeta_*_Commandu..* + 1fsttpagwfsttyinit + ' + -1fsttpagmode + q.Sm.vControl_S_Command + q.Qm.vControl_Q_Command + q.\m.vControl_\_Command + q:.X(S)m.vPrefix_S_Command + q:.X(~)m.vPrefix_~_Command + q..*m.vMeta_*_Command + ^m.vSearch_Quote + m.m^R_VT100_Incr_SearchU.\ + m.m^R_Quoted_Insertu. + Q:.X()U:.X(S) + Q:.X()U:.X(~) + :i*-1fsttpagmodeu.S + :i*-1fsttpagmodeu.Q + :i*21.iU..* +  + +!^R VT100 Incr Search:! !^R Search for character string as you type it. +C-^ quotes special characters. Rubout cancels last character. +C-\ repeats the search, forward, and C-R repeats it backward. +C-R or C-\ with search string empty changes the direction of search +or brings back search string from previous search. +Altmode exits the search; with search string empty +it switches to non-incremental ^R String Search. +Other Control and Meta chars exit the search and then are executed. +If not all the input string can be found, the rest is not discarded. +You can rub it out, discard it all with C-G, exit, +or use C-R or C-\ to search the other way. +Quitting a successful search aborts the search and moves point back; +quitting a failing search just discards whatever input wasn't found. +On printing terminals, C-L types line found but doesn't exit the search.! + + [D !* QD is direction and # times to search.! + 0[L !* QL > 0 iff failed to find current search string,! + 10.[R !* QR is state register: ! + !* 40. => ^R or ^S repeating search or gobbling default.! + !* 10. => just starting.! + !* 4 => printing char just read.! + !* 2 => rubout just done wants full redisplay.! + !* 1 => rubout just done.! + + [Q @:iQ` !* MQ pushes current info: ., qL, q2, q0, qD.! + q4+1*5-fq3"e !* We are going to push in q3, so make sure space exists.! + q3[..o zj + 200,0i ]..o' + .u:3(%4) !* Push point, search string,! + qLu:3(%4) + q2u:3(%4) + q0u:3(%4) !* this character, and current direction of search.! + qDu:3(%4) + ` + + [T + fs tyi sourc"e + @:iT` !* MT updates the echo area.! + Q9-Q.9"N 2[R' Q9U.9 !* Q9 holds prompt for echo area. Redisplay if changed.! + fs rgetty"n 2&qR"n !* If we need to redisplay the whole thing,! + qc fs echo dis !* home up and clear line first,! + @ft 9:_ q2u8'' !* then type the prompt and decide to retype whole string.! + @ft 8 :i8  !* Update displayed search string.! + ` ' + "# :iT' !* Don't display if inside a macro.! + + [C :IC TL !* QC has string to home up in echo area and clear line.! + [0 !* Q0 holds type-in character being processed.! + [2 :i2 !* Q2 holds accumulated search string.! + [8 :i8 !* Q8 has accumulated stuff to type in echo area.! + [9 !* Q9 has [Failing ][Reverse ]Search for echo area.! + 0[.9 !* Q.9 has last value of Q9 actually displayed.! + 1fo..qSearch_Exit_Option !* QE nonzero => random control chars exit.! + 200fs q vector [3 !* Q3 holds stack for partial search strings.! + -1[4 !* Q4 is stack pointer.! + [5 !* Q5 is random temp.! + .[P !* QP has old point (to maybe push at end).! + [S :IS M.M&_Isearch_RuboutUS :MS !* QS has & Isearch Rubout (autoloading)! + :I* M(M.M&_Isearch_Help) F[Help Mac + 1f[noquit + [6 [7 !* Q6 and Q7 are the success and failure echo strings.! + qD"g :i6I-Search :i7Failing_I-Search' + qD"l :i6Reverse_I-Search :i7Failing_Reverse_I-Search' + q6u9 !* Search starts out successful.! + + 0[I !* QI is nonzero when we are reading input.! + + fs rgetty"e + fs tyi sourc"e @ft _S:_' !* On printing tty, start typing out.! + 1fstypeo'' + + !Restart! + + 1:< 1uI -2f[noquit !* Set up an errset to catch quits.! + < qL"e q6' "# q7'u9 q9-q.9"n mt' !* Display direction and status in echo area.! + 0@V 1uI :fiu0 0uI @fiu5 + q5fs^r indir-qSearch_Exit_Char"e fq2:@; + ! 0fsnoquitw qD:m(m.m ^R_String_Search)' + q5-8"e o Funny' + q5-176."g o Funny' + q5-"e o Control' !* If Altmode isn't the exit char, it's like a ctl char! + q5-î"e  FS REREAD' + + !Normal! + + 4uR !* Handle printing char.! + mQ !* Push ., qL, q2, q0 and qD into q3, for rubbing out.! + :i2 2 0 !* stick this char at end of search string,! + fs tyi source"e !* If not inside a keyboard macro,! + fq8"n mt' !* Update the display.! + @ft 0 + "# + + !Try! !* Note if fall through we are inside a failing conditional.! + + mt !* Update the displayed search string.! + '' + qL"n !' !* No point in searching if know it would fail.! + + .u5 + 40.&qR"e !* For ^S, ^R suppress the moving back so don't no-op.! + qD"g fq2-1r' !* Move back, so that from FO/\O we find the FOO.! + "# fsz-qP f[ vz + fq2-1"g fq2:c"e zj'' + f]vz'' !* After finding FO backwd, move fwd 3 so can find FOO.! + qD:s2"l !' + q5j 1uL fg ! !* But if search fails, undo that motion back.! + + !Funny! + + q5-177."e o Rubout' + !* Only control characters and backspace get past here.! + q5&537.-\"e o Forward' !* Check for C-S and C-s (ignore case bit).! + q5&537.-R"e o Backward' !* Note: mustn't change q5 since Control rereads it.! + q5&537.-qSearch_Quote"e o Quote' + q5&537.-L"e fs rgetty"e o Reprint' o Control' + qE"e o normal' + o Control + + !Reprint! !* ^L on printing tty prints current line.! + 0t ft..a t + ft _S:_2 !* Then re-prompt.! + ! + + !Quote! !* ^Q quotes the next character.! + + 1f[noquit + fs osteco"n -1f[helpch' + fiu0 + q0-S"e u0' + q0-s"e u0' + q0-Q"e u0' + q0-q"e u0' + fs osteco"n f]helpch' + 0fs quitw f]noquit + o normal + + !Forward! !* ^S means search again forward.! + + qD"l :i6I-Search :i7Failing_I-Search' + q4"L qD"g o Default' !* ^S as 1st char going fwd => gobble default string.! + "# 1uD !'' !* ^S as 1st char, going backward, changed to fwd.! + mQ !* Push ., qL, q2, q0 and qD into q3.! + qD"L 0uL' !* If reversing direction, don't assume search will fail.! + 1uD !* String not null: make sure going fwd,! + 40.uR !* Mark us as a ^S so don't change search string,! + o try !* just search for it a second time.! + + !Backward! !* ^R means search again backward.! + + qD"g :i6Reverse_I-Search :i7Failing_Reverse_I-Search' + q4"L qD"l o Default' !* ^R as 1st char going backwd => gobble default string.! + "# -1uD !'' !* ^R as 1st char, going forward, changed to backwd.! + mQ !* Push ., qL, q2, q0 and qD into q3.! + qD"g 0uL' !* If reversing direction, don't assume search will fail.! + -1uD !* String not null: make sure going backwd,! + 40.uR !* Mark us as a ^R so don't change search string,! + o try + + !Default! !* Come here to use default search string.! + + mQ !* Push current state so can rub the default out.! + qSearch_Default_Ring[..o !* Find the default! + .fs word u2 ]..o !* and gobble it.! + fq2"l :i2' + q2u8 + 40.uR !* Inhibit moving back before starting to search.! + o try + + !Rubout! + + q4"l fg !' !* Rubout when string is empty does nothing.! + ms !* Call & Isearch Rubout.! + qL"e q6' "# q7'u9 !* Fix displayed direction and status for echo area.! + mt ! !* Redisplay and loop back.! + + !Control! + + q5 fs reread + 0; + + > + f]noquit + >u0 @feqit-q0"e @fg !* If we quit, record in journal file.! + !* Record Rubout if quit while searching,! + !* record :^G if failing or waiting for input.! + qL"'gqI"N :i*:' "# :i*_›' fsjrn wr + QL"g mt !* If failing, rub out the unfound chars and restart.! + o Restart' + qI"e ms mt o Restart' !* If quit while actually searching, restart.! + QPJ 0fsnoquit + -1fsquit' !* If succeeding, restore starting point and quit.! + q0f"n fs err' !* Error not a quit => pass it on.! + + fq2"g + qSearch_Default_Ring [..o !* New search char, save prev default.! + fq(.fsword)-1"G 5c .-z"e j'' !* If previous default is worth saving, push it! + q2,.fsword !* Store current (new) default! + ]..o' + + fs tyi source"e @ft  ' !* Echo an altmode to show we have exited.! + qP mMM_&_Maybe_Push_Point !* Maybe leave mark at place search started.! + 0 diff --git a/src/emacs1/vt52.4 b/src/emacs1/vt52.4 new file mode 100755 index 00000000..c62e5e89 --- /dev/null +++ b/src/emacs1/vt52.4 @@ -0,0 +1,55 @@ +!~Filename~:! !VT52 numeric keypad argument accumulation! +VT52 + +!& SETUP VT52 LIBRARY:! !S Define Meta-? for VT52 keypad hacking.! + + M.M&_VT52_KEYPAD_PROCESSORU..? + +!VT52 Alternate Keypad:! !C Turns on alternate keypad mode for VT52. +When this command is executed, the numeric keypad can be used to enter +arguments for the following function. Numbers enter as themselves and +the "." key serves as minus.! + + 27FSIMAGEOUT + 61FSIMAGEOUT + +!VT52 Normal Keypad:! !C Turns off alternate keypad mode for VT52. +The keys on the keypad become functionally identical to the standard +digit keys. See VT52 Alternate Keypad for a description of the +alternative.! + + 27FSIMAGEOUT + 62FSIMAGEOUT + +!& VT52 KEYPAD PROCESSOR:! !S Processes VT52 keypad argument digits. +This macro is intended to be put on meta-? so that when a VT52 +is in VT52 Alternate Keypad mode, to enable the special functions +such as argument accumulation of digits.! + + FI[A + FS^RARGP"E @FT +ARG: ' + QA-112"L OUNDIGIT' + QA-121"G OUNDIGIT' + FS^RARG"L + Q.Y-1"E-1*(QA-112)FS^RARG' + "# FS^RARG*10-QA+112FS^RARG'' + "# FS^RARG*10+QA-112FS^RARG' + Q.Y+1U.Y + QA-64UA + @FTA + OEXIT + + !UNDIGIT! + QA-77"E M(M.M^R_DESCRIBE) OEXIT1' + QA-110"E + FS^RARGP"G FG OEXIT' + -1FS^RARG + @FT- + 1U.Y' + !EXIT! + 0FS^RLAST + 3FS^RARGP + !EXIT1! + 0FSECHOACTIVE +