     (process-send-string *ojs-compilation-buffer-name* (format "(jvs::emacs-check-and-compile-script %S %s)\n" selection v2))))
 
 
+(defvar *compiled-script-window* nil)
+
 (defun do-compile-and-sync-ojs-file (type)
   ;; find the script name
   (let* ((script-name      (file-name-base (buffer-file-name)))

      (message "Script %s not found" script-name))))

(defun ojs-compilation-filter (proc string)
  (let ((case-fold-search nil))
    (cond ((and (stringp string)
		(string-match "\\`[[:upper:]-]+([0-9]+): \\'" string));; exit when we go back to the top level (ie :res, :pop, etc)
	   ;;(delete-process proc)
	   )
	  ((and (stringp string)
		(string-match ":EXIT-JS" string)) ;; exit when we read this, returned by the compilation functions
	   (insert "----------------------------------------------------------------------------------------------")
	   (fi::subprocess-filter proc (substring string 0 (string-match ":EXIT-JS" string)))	   
	   ;;(delete-process proc)
	   )	  
	  (t
	   (fi::subprocess-filter proc string)))))

(defun trace-ojs-function(tag)
  (interactive

		     (get-buffer-create buffer-name)))
	 (proc (get-buffer-process buffer))
	 )
    (setq *compiled-script-window* (selected-window))
    (if script
	(catch 'exit
	  ;; checks that the file matches
