 	`(eval-after-load ,file (lambda () ,@body))))
   ;; emacs-version >= 24.4
   (electric-indent-mode -1) ; let `C-j' indent the line
-  (ido-mode t))
+  (unless (locate-library "ivy") (ido-mode 1)))
 
 (progn (require 'uniquify) (setq uniquify-buffer-name-style 'forward))
 

(global-set-key (kbd "C-c u") 'untabify)
(global-set-key (kbd "C-c T") 'tabify)

(global-set-key (kbd "C-c v f") 'view-file)
(global-set-key (kbd "C-c v v") 'view-mode)
;; Don't let gtags overwrite `C-c v'
(eval-after-load "gtags" '(define-key gtags-mode-map "\C-cv" nil))

(setq calendar-week-start-day 1) ; weeks should begin on Monday

;;; --------------------------------------------------------------------
;;; Org Mode

; http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development
(let ((d "~/lib/emacs/org-mode/lisp"))
  (when (file-exists-p d) (push d load-path)))

(with-eval-after-load 'org
  (setq org-startup-indented t)


;;; GNU global
;;; https://github.com/leoliu/ggtags
(add-hook 'c-mode-common-hook
	  (lambda ()
	    (when (derived-mode-p 'c-mode 'c++-mode 'java-mode)
	      (ggtags-mode 1))))
(with-eval-after-load "ggtags"
  (define-key ggtags-navigation-map "\M-*" 'ggtags-navigation-mode-abort)
  (define-key ggtags-mode-map "\M-*" 'ggtags-find-tag-continue))
;; In case Emacs is unable to find `global executable, the following
;; command might help (OSX >= 10.10.3):
;;
