home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gwm18a.zip / data / epoch.gwm < prev    next >
Lisp/Scheme  |  1995-07-03  |  954b  |  38 lines

  1. ;;; Code to communicate with epoch
  2. ;; Colas 1991-02-18
  3. ;; this needs the epoch code "property.el" loaded into epoch
  4. ;; (property.el is in the epocgh distribution)
  5.  
  6. ;; routine to send a string to be executed by epoch, supposed to be the 
  7. ;; current window 
  8.  
  9. (setq epoch:menu ())
  10.  
  11. (defun send-epoch (code)
  12.   (set-x-property "EPOCH_EXECUTE"
  13.     (+ "(let ((protect epoch::event-handler)) (unwind-protect "
  14.       code
  15.       "(setq epoch::event-handler protect))))"
  16. )))
  17.  
  18. ;; Menu package:
  19. ;; how to make a menu of epoch buffers to select current buffer
  20.  
  21. (defunq string-menu-make (args)
  22.   (if epoch:menu
  23.     (with (wob (menu-wob epoch:menu)) (delete-window))
  24.   )
  25.   (pop-menu
  26.     (setq epoch:menu (menu-make-from-list (+
  27.     '((pop-label-make "Epoch Screens"))
  28.     (mapfor s args (list 'item-make s (list 'send-epoch-switch-buffer s))
  29. ))))))
  30.  
  31. (defunq send-epoch-switch-buffer (name)
  32.   (send-epoch (+ "(switch-to-buffer \"" name "\")")
  33. ))
  34.  
  35. ;; All done
  36.  
  37. (provide 'epoch)
  38.