 (defun smex-convert-for-ido (command-items)
   (mapcar (lambda (command-item)
             (let* ((command (car command-item))
-                   (keybinding (smex-find-keybinding command))
-                   (command-name (symbol-name command)))
+                   (command-name (symbol-name command))
+                   (keybinding
+                    (gethash command smex-command-keybindings)))
               (if keybinding
                   (format "%s (%s)" command-name keybinding)
                 command-name)))

  (smex-detect-new-commands)
  (smex-rebuild-cache)
  (add-hook 'kill-emacs-hook 'smex-save-to-file)
  (setq smex-initialized-p t))

(defun smex-initialize-ido ()

    (unless (= i smex-command-count)
      (setq smex-command-count i))))

(defun smex-background-update ()
  "Update Smex when Emacs has been idle for 20 seconds."
  (run-with-idle-timer 20 t
                       '(lambda () (when (smex-detect-new-commands)
                                     (smex-update-command-keybindings)
                                     (smex-update)))))

;;;###autoload
(defun smex-initialize ()
