(setq-default compile-command "make ")
(setq compile-auto-highlight t)
(setq compilation-scroll-output t)
(setq compilation-window-height 10)
(setq diff-switches "-u")
(setq diff-command "diff")
(setq-default c-cleanup-list
'(brace-else-brace empty-defun-braces
defun-close-semi scope-operator))
(setq-default c-hanging-braces-alist
'((brace-list-open) (brace-list-close after)(defun-open after)
(class-open after) (inline-open after)
(substatement-open after) (block-close . c-snug-do-while)))
(add-hook 'c-mode-common-hook
(function
(lambda ()
(c-toggle-auto-hungry-state 1)
(c-set-style "K&R")
(setq c-basic-offset 4))))
(defun tags-generate-c-file ()
"generate TAGS file from *.cc and *.hh"
(interactive)
(shell-command "etags *.cc *.hh *.c *.h 2>/dev/null"))
(font-lock-add-keywords 'c-mode
'(("................................................................................\\(.\\)" 1 font-lock-warning-face prepend)))
(set-face-foreground 'font-lock-string-face "MidnightBlue")
(defun linux-c-mode ()
"C mode with adjusted defaults for use with the Linux kernel."
(interactive)
(c-mode)
(c-set-style "K&R")
(setq c-basic-offset 8))
(add-to-list 'auto-mode-alist
'("/usr/src/linux.*/.*\\.[ch]$" . linux-c-mode))
(require 'boxquote)
(add-hook 'c-mode-hook 'my-c-mode-boxquote)
(defun my-c-mode-boxquote ()
"Adjust some variables for boxquote in c-mode."
(set (make-local-variable 'boxquote-top-and-tail) "")
(set (make-local-variable 'boxquote-top-corner) "/**")
(set (make-local-variable 'boxquote-bottom-corner) "**/")
(set (make-local-variable 'boxquote-side) " * "))