home *** CD-ROM | disk | FTP | other *** search
- \ TOPEDIT.SEQ Memory edit. By Tom Zimmer
-
- ?DARK
- .comment:
- Memory edit, allows reentering the editor without having to re-read
- the edit file from disk. This results in a much faster turn around time
- for development. Changes made during an edit will still be saved at
- the end of each edit session.
-
- comment;
-
- only forth also editor also hidden definitions also
-
- handle memfile
-
- : ?readfile ( --- )
- ?overlay 0= abort" Need Overlay already loaded by now."
- edovinit
- shndl @ memfile over c@ 1+ comp \ if file not the same
- edready @ 0= or \ or editor not ready
- if read.oldfile \ read the file
- shndl @ memfile $>handle \ copy to memfile
- sinit \ init mem structure
- edready on \ say everything ready
- then ;
-
- : cold-edinit ( --- )
- defers initstuff
- memfile clr-hcb
- edready off ;
-
- ' cold-edinit is initstuff
-
- only forth definitions also editor also hidden also
-
- : <ed> ( --- ) \ Redefined to work from memory.
- ?fileopen
- ovon
- ?readfile
- shndl @ hclose drop
- 8 scrline !
- reedit
- shndl @ memfile $>handle
- shndl @ hopen drop \ Reopen file
- ovoff ;
-
- : ed ( --- )
- byte|line on \ Byte offset
- <ed> ;
-
- : edit ( n1 --- ) \ redefined to work from memory.
- 1 ?enough
- byte|line off \ Line to edit
- loadline !
- <ed> ;
-
-
- : fix ( t1 --- )
- view
- shndl @ >hndle @ 0>
- if ed
- then ;
-
- : sed ( --- )
- edovinit
- byte|line on \ Set to byte offset
- ovon esed ovoff ;
-
- : listing ( --- )
- ?fileopen
- edovinit ovon elisting ovoff ;
-
- only forth also definitions
-
- 300 tillkey \ Wait up to 5 minutes for message to be read.
-