       (concat (substring str 0 117) "...")
     str))
 
-(defun saw-script--flycheck-parse (output checker buffer)
-  "Find Flycheck info in the string OUTPUT from saw using CHECKER applied to BUFFER."
-  (with-current-buffer buffer (saw-script-clear-output))
-  (save-excursion
-    (save-match-data
-      (let ((found '()))
-        (with-temp-buffer
-          (insert output)
-          (goto-char (point-min))
-          (while (re-search-forward saw-script--info-start-regexp nil t)
-            (let ((filename (match-string 1))
-                  (line (string-to-number (match-string 2)))
-                  (column (string-to-number (match-string 3)))
-                  (end-line (and (match-string 5)
-                                 (string-to-number (match-string 5))))
-                  (end-column (and (match-string 6)
-                                   (string-to-number (match-string 6))))
-                  (text (let ((perhaps-text (match-string 4)))
-                          (or perhaps-text
-                              (let ((text-start (point)))
-                                (forward-line 1)
-                                (beginning-of-line)
-                                (while (and (not (eobp))
-                                            (looking-at-p "\t"))
-                                  (forward-line 1)
-                                  (beginning-of-line))
-                                (buffer-substring-no-properties text-start (point)))))))
-              (push (flycheck-error-new-at line column
-                                           (if (match-string 4) 'error 'info)
-                                           (saw-script--abbreviate-string text)
-                                           :checker checker :buffer buffer)
-                    found)
-              (unless (match-string 4)
-                (with-current-buffer buffer
-                  (saw-script-record-output line
-                                            column
-                                            end-line
-                                            end-column
-                                            text))))))
-        found))))
-
 (with-eval-after-load 'flycheck
   (flycheck-define-checker saw-script
     "A checker for SAWScript.

    :command ("saw" "--output-locations" source-inplace)
    :error-parser saw-script--flycheck-parse
    :modes (saw-script-mode))
  (add-to-list 'flycheck-checkers 'saw-script))


;;; The mode itself

         (compilation-buffer-name-function
          'saw-script--compilation-buffer-name-function)
         (default-directory dir) )
    (let ((compilation-finish-functions (list (lambda (_x) (message "Done!")))))
      (compile command))))

(defun saw-script-run-buffer (buffer)
