                      (interactive)
                      (find-file ,(concat "~/" (cadr item))))))
 
+;;; Use IDO mode for C-x C-f and friends. (Most other things should be
+;;; using Helm mode.)
+(ido-mode 'files)
+
+;;; Use fuzzy matching.
+(setq ido-enable-flex-matching 1)
+
+;;; Follow symlinks without prompting. If this isn't done, then you will
+;;; get a prompt every time you edit init.el with F9. (This is assuming
+;;; that ~/.emacs.d/init.el is a symlink, which is how the setup script
+;;; sets it up.)
+(setq vc-follow-symlinks t)
+
+;;; Automatically reload files that were changed on disk, if they have
+;;; not been modified in Emacs since the last time they were saved.
+(global-auto-revert-mode 1)
+
+;;; Turn the delay on auto-reloading from 5 seconds down to 1 second.
+(setq auto-revert-interval 1)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;; Dired
+
+;;; Suppress the 'ls does not support --dired' warning. Doing this instead
+;;; of installing a dired-compatibile ls is much easier, although it may
+;;; cause problems with e.g. filenames that have leading spaces. If you
+;;; have a lot of filenames with leading spaces, though, you probably have
+;;; bigger problems ;)
+(setq dired-use-ls-dired nil)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;; Saving files
+
+;;; Put backup files in $HOME/.emacs-backups, rather than in the current
+;;; directory.
+(setq backup-directory-alist '(("." . "~/.emacs-backups")))
+
+;;; Always use copying to make backup files. This prevents links from
+;;; being made to point at the backup file rather than the original.
+(setq backup-by-copying t)
+
+;;; Keep multiple numbered backup files, rather than a single unnumbered
+;;; backup file.
+(setq version-control t)
+
+;;; Delete old backups silently, instead of asking for confirmation.
+(setq delete-old-versions t)
+
+;;; Don't make autosave files.
+(setq auto-save-default nil)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;; Text formatting
+
+;;; Don't use tabs for indentation, even in deeply indented lines. (Why
+;;; would anyone want their editor to *sometimes* use tabs?)
+(setq-default indent-tabs-mode nil)
+
+;;; Sentences end with one space, not two. If you end sentences with
+;;; one space, this has two concrete effects on filling with M-q.
+;;; Firstly, it allows Emacs to break directly after a sentence.
+;;; Secondly, consider the case when the end of a line has an
+;;; end-of-sentence period followed by trailing whitespace and when at
+;;; least the last word of the sentence is too long for the line. In
+;;; that case, this option prevents filling from inserting two spaces
+;;; after the period when it is wrapped to the next line.
+(setq sentence-end-double-space nil)
+
+;;; Trim trailing whitespace on save. This will get rid of end-of-line
+;;; whitespace, and reduce the number of blank lines at the end of the
+;;; file to one.
+(add-hook 'before-save-hook 'delete-trailing-whitespace)
+
+;;; Add a trailing newline if there is not one already, when
+;;; saving. This is enabled for default for certain modes, but we want
+;;; it everywhere (e.g. when editing .gitignore files).
+(setq require-final-newline t)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;; Killing and yanking
+
+;;; Eliminate duplicates in the kill ring. That is, if you kill the same
+;;; thing twice, you won't have to use M-y twice to get past it to older
+;;; entries in the kill ring.
+(setq kill-do-not-save-duplicates t)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;; Searching
+
+;;; Eliminate the quarter-second delay before I-search matches are
+;;; highlighted, because delays suck.
+(setq lazy-highlight-initial-delay 0)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;; Windows
+
+(windmove-default-keybindings)
+
+(winner-mode 1)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;; ElDoc
+
+;;; Enable ElDoc when editing Lisps and using Lisp REPLs.
+
+(dolist (hook '(emacs-lisp-mode-hook
+                lisp-interaction-mode-hook))
+  (add-hook hook (lambda () (eldoc-mode 1))))
+
+(when (member 'clojure-mode radian-packages)
+  (add-hook 'clojure-mode-hook (lambda () (eldoc-mode 1))))
+
+(when (member 'cider radian-packages)
+  (add-hook 'cider-repl-mode-hook (lambda () (eldoc-mode 1))))
+
+;;; Turn off the delay before ElDoc messages are shown in the echo area.
+(setq eldoc-idle-delay 0)
+
+;;; Always truncate ElDoc messages to one line. This prevents the echo area from
+;;; resizing itself unexpectedly when point is on a Clojure variable with a
+;;; multiline docstring.
+(setq eldoc-echo-area-use-multiline-p nil)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;; Emacs Lisp
+
 ;;; Add a keybinding for reloading this file (init.el). This is useful
 ;;; for when you have several instances of Emacs open and you change
 ;;; something in your configuration, then later come back to an old

            (local-set-key (kbd "M-.")
                           'find-function-or-variable)))

;;;; OSX interop

;;; Add mouse support
;;; Based on http://stackoverflow.com/a/8859057/3538165
(unless (display-graphic-p)
  (xterm-mouse-mode t)
  ;; Enable scrolling.
  (global-set-key [mouse-4]
                  (lambda ()
                    (interactive)
                    (scroll-down 1)))
  (global-set-key [mouse-5]
                  (lambda ()
                    (interactive)
                    (scroll-up 1))))

;;; Add clipboard support
;;; Based on https://gist.github.com/the-kenny/267162
;;; Modified based on http://emacs.stackexchange.com/q/26471/12534

(setq last-paste-to-osx nil)

(defun copy-from-osx ()
  (let ((copied-text (shell-command-to-string "pbpaste")))
    (unless (string= copied-text last-paste-to-osx)
      copied-text)))

(defun paste-to-osx (text &optional push)
  (let ((process-connection-type nil))
    (let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
      (process-send-string proc text)
      (process-send-eof proc)))
  (setq last-paste-to-osx text))

(setq interprogram-cut-function 'paste-to-osx)
(setq interprogram-paste-function 'copy-from-osx)

;;; If you have something on the system clipboard, and then kill something in
;;; Emacs, then by default whatever you had on the system clipboard is gone
;;; and there is no way to get it back. Setting the following option makes it
;;; so that when you kill something in Emacs, whatever was previously on the
;;; system clipboard is pushed into the kill ring. This way, you can paste it
;;; by doing C-y M-y.
(setq save-interprogram-paste-before-kill t)

;;;; File saving and loading

;;; Put backup files in $HOME/.emacs-backups, rather than in the current
;;; directory.
(setq backup-directory-alist '(("." . "~/.emacs-backups")))

;;; Always use copying to make backup files. This prevents links from
;;; being made to point at the backup file rather than the original.
(setq backup-by-copying t)

;;; Keep multiple numbered backup files, rather than a single unnumbered
;;; backup file.
(setq version-control t)

;;; Delete old backups silently, instead of asking for confirmation.
(setq delete-old-versions t)

;;; Don't make autosave files.
(setq auto-save-default nil)

;;; Trim trailing whitespace on save. This will get rid of end-of-line
;;; whitespace, and reduce the number of blank lines at the end of the
;;; file to one.
(add-hook 'before-save-hook 'delete-trailing-whitespace)

;;; Add a trailing newline if there is not one already, when
;;; saving. This is enabled for default for certain modes, but we want
;;; it everywhere (e.g. when editing .gitignore files).
(setq require-final-newline t)

;;; Automatically reload files that were changed on disk, if they have
;;; not been modified in Emacs since the last time they were saved.
(global-auto-revert-mode 1)

;;; Turn the delay on auto-reloading from 5 seconds down to 1 second.
(setq auto-revert-interval 1)

;;; Follow symlinks without prompting. If this isn't done, then you will
;;; get a prompt every time you edit init.el with F9. (This is assuming
;;; that ~/.emacs.d/init.el is a symlink, which is how the setup script
;;; sets it up.)
(setq vc-follow-symlinks t)

;;; Suppress the 'ls does not support --dired' warning. Doing this instead
;;; of installing a dired-compatibile ls is much easier, although it may
;;; cause problems with e.g. filenames that have leading spaces. If you
;;; have a lot of filenames with leading spaces, though, you probably have
;;; bigger problems ;)
(setq dired-use-ls-dired nil)

;;;; Text format

;;; Don't use tabs for indentation, even in deeply indented lines. (Why
;;; would anyone want their editor to *sometimes* use tabs?)
(setq-default indent-tabs-mode nil)

;;; Sentences end with one space, not two. If you end sentences with
;;; one space, this has two concrete effects on filling with M-q.
;;; Firstly, it allows Emacs to break directly after a sentence.
;;; Secondly, consider the case when the end of a line has an
;;; end-of-sentence period followed by trailing whitespace and when at
;;; least the last word of the sentence is too long for the line. In
;;; that case, this option prevents filling from inserting two spaces
;;; after the period when it is wrapped to the next line.
(setq sentence-end-double-space nil)

;;;; Copying and pasting

;;; Eliminate duplicates in the kill ring. That is, if you kill the same
;;; thing twice, you won't have to use M-y twice to get past it to older
;;; entries in the kill ring.
(setq kill-do-not-save-duplicates t)

;;;; I-search

;;; Eliminate the quarter-second delay before I-search matches are
;;; highlighted, because delays suck.
(setq lazy-highlight-initial-delay 0)

;;;; Packages
;; Downloads any packages that are not included with Emacs 24 by default.
;; This allows Radian to run on other systems without any additional
;; setup (other than Emacs 24 being installed).
;;;;

;;; Based on http://batsov.com/articles/2012/02/19/package-management-in-emacs-the-good-the-bad-and-the-ugly/

;;; Initialize the package management system, before we start trying
;;; to add packages.
(require 'package)
(package-initialize)

;;; The default package repository in Emacs doesn't have a lot of the
;;; packages we need, such as Projectile. Therefore, add the melpa-stable

;;; Make the installed packages available.
(provide 'radian-packages)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; User-specific configuration (3 of 4)

(radian-load-user-config "init.post.local.el")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Package: Helm (and helm-projectile and helm-smex)

(when (member 'helm radian-packages)

