 (require 'ggtags)
-(add-hook 'c-mode-hook
-	  (lambda () (ggtags-mode 1)))
+(add-hook 'c-mode-hook (lambda () (ggtags-mode 1)))
 
 
 (define-key ggtags-mode-map (kbd "C-c g s") 'ggtags-find-other-symbol)

      (insert (concat "#define " guard-str "\n"))
      (end-of-buffer)
      (insert "#endif"))))



(define-key ggtags-mode-map (kbd "C-c g u") 'ggtags-update-tags)
(define-key ggtags-mode-map (kbd "M-,") 'pop-tag-mark)

;;Setup our C style to match the Linux Kernel coding guidlines
;;This is copied from https://www.kernel.org/doc/Documentation/CodingStyle
(defun c-lineup-arglist-tabs-only (ignored)
  "Line up argument lists by tabs, not spaces"
  (let* ((anchor (c-langelem-pos c-syntactic-element))
         (column (c-langelem-2nd-pos c-syntactic-element))
         (offset (- (1+ column) anchor))
         (steps (floor offset c-basic-offset)))
    (* (max steps 1)
       c-basic-offset)))

(add-hook 'c-mode-common-hook
          (lambda ()
            ;; Add kernel style
            (c-add-style
             "linux-tabs-only"
             '("linux" (c-offsets-alist
                        (arglist-cont-nonempty
                         c-lineup-gcc-asm-reg
                         c-lineup-arglist-tabs-only))))))

(add-hook 'c-mode-hook
          (lambda ()
            (let ((filename (buffer-file-name)))
              (setq indent-tabs-mode t)
	      (setq show-trailing-whitespace t)
	      (c-set-style "linux-tabs-only"))))


;;Some utility stuff
(defun insert-include-gaurds ()
  "Auto inserts include guards into your C buffer"
  (interactive)
