; Import C# mode
(menu-bar-mode nil)
(tool-bar-mode nil)
(set-face-font 'default "-xos4-terminus-medium-r-normal--16-140-*-*-*-*-*-*")
(add-to-list 'load-path "/home/andrea/share/emacs" )
(autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
(setq auto-mode-alist
(append '(("\\.vala$" . csharp-mode) ("\\.cs$" . csharp-mode)) auto-mode-alist))
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(ecb-auto-activate t)
 '(ecb-compile-window-height nil)
 '(ecb-fix-window-size (quote width))
 '(ecb-layout-name "giusto")
 '(ecb-layout-window-sizes (quote (("giusto" (0.1987179487179487 . 0.6101694915254238) (0.1987179487179487 . 0.3728813559322034)))))
 '(ecb-major-modes-show-or-hide (quote ((c-mode csharp-mode))))
 '(ecb-options-version "2.32")
 '(ecb-source-path (quote ("~/Documenti/src/")))
 '(ecb-tip-of-the-day nil)
 '(ecb-windows-width 0.2))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )


;; C/C++/Java/C# Mode
(defun my-save-and-compile ()
   "Save current buffer and issue compile."
   (interactive "")
   (save-buffer 0)
   (compile "make -k"))

(defun my-c-mode-common-hook ()
  (c-set-offset 'substatement-open 0)
  (c-set-offset 'statement-cont 4)
  (c-set-offset 'topmost-intro-cont 0)
  (c-set-offset 'block-open 0)
  (c-set-offset 'arglist-intro 4)
  (c-set-offset 'arglist-cont-nonempty 4)
  (c-set-offset 'case-label '+)
  (require 'semantic-load)
  (setq semantic-load-turn-everything-on t)
  ;(define-key c-mode-map "\t" 'c-tab-indent-or-complete)
  (define-key c-mode-map [(control tab)] 'indent-region)
  (define-key c-mode-map [(control shift b)] 'my-save-and-compile)
  ;(define-key c-mode-map "." 'semantic-complete-self-insert)
)
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

(defun my-csharp-mode-hook ()
  (progn
   (turn-on-font-lock)
   (auto-fill-mode)
   (setq c-basic-offset 8)
   (setq tab-width 8))
)

(add-hook 'csharp-mode-hook 'my-csharp-mode-hook)

; GIT support
 (setq load-path (cons (expand-file-name "/usr/share/doc/git-core/contrib/emacs") load-path))
 (require 'vc-git)
 (when (featurep 'vc-git) (add-to-list 'vc-handled-backends 'git))
 (require 'git)
 (autoload 'git-blame-mode "git-blame"
           "Minor mode for incremental blame for Git." t)


; Misc options
(setq compilation-scroll-output t)

