[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Open compilation window only on errors?
From: |
Matthew Calhoun |
Subject: |
Re: Open compilation window only on errors? |
Date: |
Mon, 13 Oct 2003 01:05:55 -0700 |
Thanks to the superb guidance of Jens, Francois, and Kevin, I have a
compilation-finish-function that works quite well. It looks like this:
(defun handle-compilation-window (buffer msg)
"Gets rid of compilation window on successful compilation, otherwise
goes to first error."
(if (and (equal (substring msg 0 8) "finished")
(get-buffer-window buffer)) ; Compilation window is still
open
(progn (delete-window (get-buffer-window buffer))
(message "Compilation was clean."))
(next-error)))
(setq compilation-finish-function 'handle-compilation-window)
It even works correctly with my unit test failures, which was a
pleasant surprise. But it's not perfect yet. When compilation results
in warnings but no errors, my function is closing the compilation
window because it receives a "finished" message, but I would rather
keep the window open and go to the first warning, just like I would if
there were errors. I know I could tell the compiler to treat warnings
as errors, but that's not always feasible. Should I add a regexp to
compilation-error-regexp-alist to fix this, or is there a better way?
Thanks,
Matt
- Re: Open compilation window only on errors?,
Matthew Calhoun <=