summaryrefslogtreecommitdiffstats
path: root/.emacs.d/slash_c.el
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2010-06-30 20:59:12 +0200
committerGravatar Tom Willemsen2010-06-30 20:59:12 +0200
commit722c13a8fc093bc67b9be444547571d544cb79a0 (patch)
tree67ac47a4ec267f56b754134efa2a5a3b51c07dcf /.emacs.d/slash_c.el
downloaddotfiles-722c13a8fc093bc67b9be444547571d544cb79a0.tar.gz
dotfiles-722c13a8fc093bc67b9be444547571d544cb79a0.zip
Switched over from dotemacs to doteverything
Diffstat (limited to '.emacs.d/slash_c.el')
-rw-r--r--.emacs.d/slash_c.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/.emacs.d/slash_c.el b/.emacs.d/slash_c.el
new file mode 100644
index 0000000..b8d35fe
--- /dev/null
+++ b/.emacs.d/slash_c.el
@@ -0,0 +1,15 @@
+(if (not (intern-soft "cc-mode"))
+ (require 'cc-mode))
+
+(global-set-key [(f9)] 'compile) ; make F9 call the compilation command
+(setq compilation-window-height 8) ; make the compilation window smaller
+
+;; Make compilation window disappear on succesful build
+(setq compilation-finish-function
+ (lambda (buf str)
+ (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!")))) \ No newline at end of file