 ;; Used only for its faces (for color-theme).
 (require 'font-lock)
 
+(defgroup lusty-explorer nil
+  "Quickly open new files or switch among open buffers."
+  :group 'extensions
+  :group 'convenience
+  :version "23")
+
+(defcustom lusty-setup-hook nil
+  "Hook run after the lusty keymap has been setup.
+Additional keys can be defined in `lusty-mode-map'."
+  :type 'hook
+  :group 'lusty-explorer)
+
 (defvar lusty-match-face font-lock-function-name-face)
 (defvar lusty-directory-face font-lock-type-face)
 (defvar lusty-slash-face font-lock-keyword-face)

(defvar lusty-truncated-string
  (propertize "-- TRUNCATED --" 'face 'font-lock-comment-face))

(defvar lusty-mode-map
  ;; STEVE also func ala iswitchb-define-mode-map ?
  (let ((map (make-sparse-keymap)))
    (set-keymap-parent map minibuffer-local-map)
    (define-key map "\C-n" 'lusty-highlight-next)
    (define-key map "\C-p" 'lusty-highlight-previous)
    (define-key map "\t" 'lusty-select-entry)
    (define-key map (kbd "RET") 'lusty-select-entry)
    ;; STEVE: perhaps RET should be:
    ;; - if buffer explorer, same as \t
    ;; - if file explorer, opens current name (or recurses if existing dir)
    map)
  "Minibuffer keymap for `lusty-file-explorer' and `lusty-buffer-explorer'.")

;;;###autoload
(defun lusty-file-explorer ()
  "Launch the file/directory mode of LustyExplorer."
  (interactive)
  (let* ((lusty--active-mode :file-explorer)
         (lusty--ignored-extensions
          (mapcar (lambda (ext) (concat (regexp-quote ext) "$"))

    (setq lusty--highlighted-index 0))
  (lusty-refresh-matches-buffer))

;;;###autoload
(defun lusty-select-entry ()
  "Select the highlighted entry in *Lusty-Matches*."
  (interactive)
