>I created this function:

I think it has to be:

(defun jde-compile-finish-kill-buffer (buf msg)
  "Removes the jde-compile window after a few seconds if no errors."
  (save-excursion
    (set-buffer buf)
    (if (null (or (string-match ".*exited abnormally.*" msg)
                  (string-match ".*BUILD FAILED.*" (buffer-string))))
        ;;no errors, make the compilation window go away in a few seconds
        (progn
          (run-at-time
           "2 sec" nil 'delete-windows-on
           (get-buffer-create "*compilation*"))
          (run-at-time
           "2 sec" nil 'kill-buffer
           (get-buffer-create "*compilation*"))
          (message "No compilation errors"))
      ;;there were errors, so jump to the first error
      (next-error))))

Klaus

Reply via email to