summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2013-02-17 22:23:36 +0100
committerGravatar Tom Willemsen2013-02-17 22:23:36 +0100
commit791d7fd3a2fe6ae4407fe6fe9f2ea86e84dd315c (patch)
tree1c3c74ce346519386e0b6bc55f9854a9c9bc0842
parent3e5421e79d47d4a40b540869f1b18288285e0025 (diff)
downloaddotfiles-791d7fd3a2fe6ae4407fe6fe9f2ea86e84dd315c.tar.gz
dotfiles-791d7fd3a2fe6ae4407fe6fe9f2ea86e84dd315c.zip
emacs: Close compilation buffer on success
-rw-r--r--.emacs.d/init.el2
-rw-r--r--.emacs.d/site-lisp/ext.el9
2 files changed, 11 insertions, 0 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 0296816..217eb26 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -271,6 +271,8 @@
'display-buffer-alist
'("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil))))
+(add-to-list 'compilation-finish-functions 'ext:comp-finish-function)
+
(blink-cursor-mode -1)
(column-number-mode -1)
(line-number-mode -1)
diff --git a/.emacs.d/site-lisp/ext.el b/.emacs.d/site-lisp/ext.el
index 2ed65d4..d6abaa6 100644
--- a/.emacs.d/site-lisp/ext.el
+++ b/.emacs.d/site-lisp/ext.el
@@ -38,6 +38,15 @@
buffer-file-name))))
(list "pycheck.sh" (list local-file))))
+(defun ext:comp-finish-function (buf str)
+ "Don't show compilation window if everything went ok"
+ (if (string-match "exited abnormally" str)
+ ;; there were errors
+ (message "compilation errors, press C-x ` to visit")
+ ;; no errors, make the compilation window go away in 0.5 seconds
+ (run-at-time 0.5 nil 'delete-windows-on buf)
+ (message "No compilation errors!")))
+
(defun ext:reload-buffer ()
"Reload current buffer."
(interactive)