-;;; smex.el --- M-x interface with Ido-style fuzzy matching.
+;;; smex.el --- M-x interface with Ido-style fuzzy matching. -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2009-2014 Cornelius Mika and contributors
 ;;

(defun smex-sort-item-at (n)
  "Sorts item at position N in `smex-cache'."
  (let* ((command-cell (nthcdr n smex-cache))
         (command-item (car command-cell))
         (command-count (cdr command-item)))
    (let ((insert-at (smex-detect-position
                      command-cell
                      (lambda (cell)


(defun smex-initialize-ido ()
  "Sets up a minimal Ido environment for `ido-completing-read'."
  (with-no-warnings ; `ido-init-completion-maps' is deprecated in Emacs 25
    (ido-init-completion-maps))
  (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup))

(defsubst smex-save-file-not-empty-p ()
  (string-match-p "\[^[:space:]\]" (buffer-string)))

(defun smex-load-save-file ()
  "Loads `smex-history' and `smex-data' from `smex-save-file'"
