This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/init-package/init-cc-mode.el

19 lines
704 B
EmacsLisp
Raw Normal View History

2013-09-17 05:04:34 +00:00
(require 'cc-mode)
(add-hook 'c-mode-hook '(lambda () (c-toggle-auto-state t)
(c-toggle-hungry-state t)))
(add-hook 'c++-mode-hook '(lambda () (c-toggle-auto-state t)
(c-toggle-hungry-state t)))
;; From http://xugx2007.blogspot.ca/2007/06/benjamin-rutts-emacs-c-development-tips.html
(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."))))