 
  ;; yasnippet (templated auto complete)
  ;; should be loaded before auto complete so that they can work together
-;;(require 'yasnippet) TODO fix
-;;(yas-global-mode 1) TODO FIX
+(require 'yasnippet) ;;TODO fix
+(yas-global-mode 1) ;;TODO FIX
 
 ;; stuff for auto-complete
 (require 'auto-complete-config)

;; allows for easy lisp error checking inside this file
(setq debug-on-error t)

;;messages for debugging emacs status
(print "loading my-emacs.el\n")
(setq path (file-name-directory load-file-name))
(print "the my-emacs.el file is being loaded form\n")
(print path)

(custom-set-variables
  ;; custom-set-variables was added by Custom.

;; hightlight uncommited code
;;(global-diff-hl-mode) TODO fix

;; for file and buffer completion 
(require 'ido)
(ido-mode t)


; roslaunch highlighting
(add-to-list 'auto-mode-alist '("\\.launch$" . xml-mode))

;;;;;;TODO fix printing and always print on local machine
;;;; Convenient printing
(require 'printing)
(pr-update-menus t)
;; make sure we use localhost as cups server
(setenv "CUPS_SERVER" "localhost")
(package-require 'cups)


;; word wrapping
(global-visual-line-mode t)

; Use the system clipboard
(setq x-select-enable-clipboard t)

; save minibuffer history
(require 'savehist)
(savehist-mode t)

; show recent files
(package-require 'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 1000)

;; Highlight TODO and FIXME in comments
(package-require 'fic-ext-mode)
(defun add-something-to-mode-hooks (mode-list something)
  "helper function to add a callback to multiple hooks"
  (dolist (mode mode-list)
    (add-hook (intern (concat (symbol-name mode) "-mode-hook")) something)))

(add-something-to-mode-hooks '(c++ tcl emacs-lisp python text markdown latex) 'fic-ext-mode)

; save the place in files
(require 'saveplace)
(setq-default save-place t)

; colored shell commands via C-!
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
(defun babcore-shell-execute(cmd)
  "Execute a shell command in an interactive shell buffer."
   (interactive "sShell command: ")
   (shell (get-buffer-create "*shell-commands-buf*"))
   (process-send-string (get-buffer-process "*shell-commands-buf*") (concat cmd "\n")))
(global-set-key (kbd "C-!") 'babcore-shell-execute)


;; Flymake: On the fly syntax checking

; stronger error display
(defface flymake-message-face
  '((((class color) (background light)) (:foreground "#b2dfff"))
    (((class color) (background dark))  (:foreground "#b2dfff")))
  "Flymake message face")

; show the flymake errors in the minibuffer
(package-require 'flymake-cursor)  

(provide 'my-emacs)

