home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / f / forthmac / !Forthmacs / risc_os / auto next >
Encoding:
Text File  |  1997-05-20  |  2.2 KB  |  60 lines

  1. \ autoload file
  2. \ hs 22.02.97
  3.  
  4. only forth also definitions hidden also  system also decimal
  5. [ifdef] floats-on    floats-on [then]
  6.  
  7. : ?load-file    ( str -- )
  8.     dup file-exists? if ??cr load-file else cr ." --> Can't load " ". then ;
  9.  
  10. \ ********************************************************************************************
  11. \ This part between the star lines should not be removed, in case you find a bug or would like
  12. \ to include a feature, let me know it.  hs 21.11.96
  13. : auto-install
  14.     p" cd <Forthmacs$Dir>"  "cli drop
  15.     p" enumdir risc_os.installjob fileliste" "cli drop
  16.     p" fileliste" read fopen
  17.     astring astring locals| cmd job fd |
  18.     begin    job fd fgetline
  19.     while    p" risc_os.installjob." cmd "copy  job cmd "cat ??cr cr cmd load-file
  20.     repeat
  21.     fd fclose    
  22.         p" wipe fileliste ~C~V"                "cli drop
  23.     p" Ifthere risc_os.installjob.* then wipe risc_os.installjob.* ~C~V" "cli drop
  24.     p" back"                    "cli drop
  25.     ??cr ;
  26. auto-install  forget auto-install
  27. \ *******************************************************************************************
  28.  
  29.  
  30. libcall: emacs
  31.  
  32. : cli-undefined
  33.     astring astring locals| command line |
  34.     command "copy  p"  " command "cat  get-tail command "cat  command "cli
  35.     if command (interpret-do-undefined else .cli-out then
  36.      ; ' cli-undefined is interpret-do-undefined
  37. : ?fload    \ name
  38.     blword ?load-file ;
  39. : edit        ( filename -- error? )
  40.     astring "move astring astring locals| oldfilepath command filename |
  41.     p" File$Path" getenv ?dup 0= if nullstring then oldfilepath "copy
  42.     p" Set File$Path @.,<Forthmacs$Dir>.risc_os.bin.cmd." "cli drop
  43.     p" emacs " command "copy  filename command "cat  command "shell
  44.     oldfilepath c@
  45.     if    p" Set File$Path "  command "copy   oldfilepath command "cat
  46.     else    p" Unset File$Path" command "copy
  47.     then command "cli drop
  48.     erase-screen ;
  49. : ed    blword edit ;
  50. only forth also definitions
  51.  
  52. p" Forthmacsoptions" get-env-var d# 127 and
  53. \ dup d# 01 and [if] ?fload lib.compatible    ??cr [then]
  54. dup d# 16 and [if] ?fload blocks         ??cr [then]
  55. dup d# 08 and [if] ?fload modem            ??cr [then]
  56. dup d# 64 and [if] ?fload lib.clock        ??cr [then]
  57. dup d# 02 and [if] ?fload debugger        ??cr [then]
  58. dup d# 04 and [if] ?fload tracer        ??cr [then]
  59.     d# 32 and [if] ?fload profiler        ??cr [then]
  60.