 ;; Automatically scroll build output.
 (setq compilation-scroll-output t)
 ;; Automatically hide successful builds window.
-(setq compilation-finish-functions 'ar-compile-autoclose)
-(defun ar-compile-autoclose (buffer string)
+(setq compilation-finish-functions 'ar/compile-autoclose)
+(defun ar/compile-autoclose (buffer string)
   (cond ((string-match "finished" string)
          (message "Build finished")
          (run-with-timer 2 nil

(key-chord-define-global "xx" 'execute-extended-command)
(key-chord-define-global "kk" 'kill-whole-line)
;; From http://emacsredux.com/blog/2013/04/28/switch-to-previous-buffer
(defun ar-switch-to-previous-buffer ()
  "Switch to previously open buffer.
Repeated invocations toggle between the two most recently open buffers."
  (interactive)
  (switch-to-buffer (other-buffer (current-buffer) 1)))
(key-chord-define-global "JJ" 'ar-switch-to-previous-buffer)
(key-chord-mode +1)

;; Needs clang-format installed.

        ("\\.mm$" (".h"))
        ))
(add-hook 'c-mode-common-hook (lambda() (local-set-key (kbd "C-c o") 'ff-find-other-file)))
(add-to-list 'auto-mode-alist '("\\.h\\'" . objc-mode))

(defun ar/kill-other-buffers ()
  "Kill all other buffers."
  (interactive)
  (mapc 'kill-buffer
        (delq (current-buffer)
              (remove-if-not 'buffer-file-name (buffer-list)))))

(defun ar/delete-this-buffer-and-file ()
  "Removes file connected to current buffer and kills buffer."
  (interactive)
  (let ((filename (buffer-file-name))
