 ;; M-. elisp navigation.
 (use-package elisp-slime-nav
   :ensure elisp-slime-nav)
-(dolist (hook '(emacs-lisp-mode-hook ielm-mode-hook))
-  (add-hook hook 'turn-on-elisp-slime-nav-mode))
+
+(defun ar/add-functions-to-mode-hooks (hook-functions hooks)
+  "Adds HOOK-FUNCTIONS to mode HOOKS."
+  (dolist (hook hooks)
+    (dolist (hook-function hook-functions)
+      (add-hook hook hook-function))))
+
+(ar/add-functions-to-mode-hooks '(turn-on-elisp-slime-nav-mode)
+                                '(emacs-lisp-mode-hook ielm-mode-hook))
 
 (defun ar/save-point ()
   "Saves point to register 9999."

  (whitespace-mode)
  (rainbow-delimiters-mode)
  (yas-minor-mode))
(add-hook 'prog-mode-hook 'ar/prog-mode-hook)
(add-hook 'markdown-mode-hook 'ar/prog-mode-hook)

(use-package centered-cursor-mode
  :ensure centered-cursor-mode)

  ;; Saving point to register enables jumping back to last change at any time.
  (ar/save-point))

(defun ar/objc-mode-hook-function ()
  "Called when entering objc-mode"
  (set (make-local-variable 'company-backends)
       ;; List with multiple back-ends for mutual inclusion.
