[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
code for closing compilation buffers
From: |
Hadron |
Subject: |
code for closing compilation buffers |
Date: |
Wed, 11 Jul 2007 16:08:50 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.91 (gnu/linux) |
I googled up some code and then modified it to use the more recent
compilation-finish-functions hook.
Could someone take a peek that I did the "if then else" part right.
If errors then jump to first error, else close the window. It *works* I
would just be grateful if someone could comment on whether its done
right:
(add-hook 'compilation-finish-functions
(lambda (buf str)
(if (string-match "exited abnormally" str)
(next-error)
;;no errors, make the compilation window go away in a few seconds
(run-at-time "2 sec" nil 'delete-windows-on (get-buffer-create
"*compilation*"))
(message "No Compilation Errors!")
)
))
- code for closing compilation buffers,
Hadron <=