home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / c / quik_fix.lzh / quik-fix.rexx < prev    next >
OS/2 REXX Batch file  |  1992-12-08  |  1KB  |  59 lines

  1. /*======================================================================
  2. ** quik-fix.rexx
  3. */
  4.  
  5.  
  6. /*
  7. ** Config
  8. */
  9. EMACS_STARTUP = "C:runback GNUEmacs:temacs"
  10.  
  11.  
  12. DIRECTORY = pragma('D')
  13. EMACS_QUIK_FIX_START = '(quik-fix-start "'DIRECTORY'")'
  14. EMACS_PORT = "EMACS1"
  15.  
  16.  
  17.  
  18. /*
  19. ** Get the port, start emacs if it is not already running
  20. */
  21. if ~ show( 'p', EMACS_PORT ) then do
  22.  
  23.     say "Cannot find port named" EMACS_PORT
  24.     say "Starting GNU Emacs..."
  25.  
  26.     address command    EMACS_STARTUP '-e' EMACS_QUIK_FIX_START
  27. end
  28. else do
  29.     address value EMACS_PORT
  30.     EMACS_QUIK_FIX_START
  31. end
  32.  
  33.  
  34. /*
  35. ** Wait for Emacs to respond with STOP or RECOMPLE
  36. */
  37. addlib("rexxsupport.library",0,-30,0)
  38.  
  39. openport( QuikFix )
  40.  
  41. NOPACKET = x'0000 0000'
  42. MESSAGE = waitpkt( QuikFix )
  43.  
  44. if MESSAGE = 1 then do
  45.     PACKET = GETPKT( QuikFix )
  46.     if PACKET = NOPACKET then
  47.         nop /* Error Handling if needed */
  48.     else do
  49.         RESPONSE = getarg(PACKET)
  50.         reply(PACKET,0)
  51.  
  52.         select;
  53.                   when RESPONSE = "RECOMPILE" then exit 0
  54.                   when RESPONSE = "STOP" then exit 1
  55.                   otherwise say "Emacs returned invalid response'" RESPONSE "'"
  56.             end
  57.     end
  58. end
  59.