 
   ;; Automatically load utop.el
   (autoload 'utop "utop" "Toplevel for OCaml" t)
+
+                                        ; typical error - File "graph.ml", line 46, characters 38-41:
+
+                                        ;  (add-to-list 'compilation-error-regexp-alist 'corebuild)
+                                        ;  (add-to-list 'compilation-error-regexp-alist-alist
+                                        ;               '(corebuild "File \"\\(.+?\\)\", line \\([0-9]+\\), characters \\([0-9]+\\)"
+
+                                        ;                       1 2 3))
+  ;; merlin
+  (autoload 'merlin-mode "merlin" "Merlin mode" t)
+  (setq merlin-command "/Users/shmul/.opam/4.01.0/bin/ocamlmerlin")
+  (add-hook 'tuareg-mode-hook 'merlin-mode)
+  (add-hook 'caml-mode-hook 'merlin-mode)
+  (setq merlin-use-auto-complete-mode 'easy)
+  ;; Use opam switch to lookup ocamlmerlin binary
+                                        ;(setq merlin-command 'opam)
   )
 
 (defun set-theme ()

  (add-hook 'objc-mode-hook 'my-default-mode-hook)
  (add-hook 'web-mode-hook  'my-web-mode-hook)
  (add-hook 'compilation-finish-functions 'my-shorten-filenames-in-compilation)
  )



  (setq swoop-use-target-magnifier-size: 1.2)
  )

(defun setup-expand-region ()
  (require 'expand-region)
  (global-set-key (kbd "C-=") 'er/expand-region)
  )

(defun setup-smex ()

  (smex-initialize)
  (global-set-key (kbd "M-x") 'smex)
  (global-set-key (kbd "M-X") 'smex-major-mode-commands)
  ;; This is your old M-x.
  (global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)
  )

(defun setup-corral  ()
  (global-set-key (kbd "M-9") 'corral-parentheses-backward)
  (global-set-key (kbd "M-0") 'corral-parentheses-forward)
  (global-set-key (kbd "M-[") 'corral-brackets-backward)
  (global-set-key (kbd "M-]") 'corral-brackets-forward)
  (global-set-key (kbd "M-{") 'corral-braces-backward)
  (global-set-key (kbd "M-}") 'corral-braces-forward)
  (global-set-key (kbd "M-\"") 'corral-double-quotes-backward)
  (setq corral-preserve-point t)
  )

(defun setup-anzu ()
  (global-anzu-mode +1)
  (global-set-key (kbd "M-%") 'anzu-query-replace)
  (global-set-key (kbd "C-M-%") 'anzu-query-replace-regexp)
  )

(defun setup-notes-taking ()
  (when (require 'deft nil 'noerror)
    (setq
     deft-extensions '("org" "txt")
     deft-directory "~/Documents/deft/")
    (global-set-key (kbd "<f9>") 'deft))
  )

(defun setup-smartwin ()
  (require 'smartwin)
  (smartwin-mode 1)
  )

(defun my-after-init-hook ()
  (load custom-file)

