 ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
 ;; Keywords: convenience editing evil smartparens lisp mnemonic
 ;; Created: 9 Oct 2014
-;; Version: 6.3
+;; Version: 6.4
 ;; Package-Requires: ((evil "1.0.9") (evil-leader "0.4.3") (smartparens "1.6.1"))
 ;; URL: https://github.com/syl20bnr/evil-lisp-state
 

(define-key evil-lisp-state-map "l" 'evil-forward-char)
;; leader
(define-key evil-lisp-state-map (kbd evil-leader/leader) evil-leader--default-map)
;; commands that wont switch to lisp state
(dolist (mm evil-lisp-state-major-modes)
  (evil-leader/set-key-for-mode mm "me$" 'lisp-state-eval-sexp-end-of-line)
  (evil-leader/set-key-for-mode mm "mee" 'eval-last-sexp)
  (evil-leader/set-key-for-mode mm "mef" 'eval-defun)
  (evil-leader/set-key-for-mode mm "mgg" 'elisp-slime-nav-find-elisp-thing-at-point)
  (evil-leader/set-key-for-mode mm "mhh" 'elisp-slime-nav-describe-elisp-thing-at-point)
  (evil-leader/set-key-for-mode mm "m,"  'lisp-state-toggle-lisp-state)
  (evil-leader/set-key-for-mode mm "mtb" 'spacemacs/ert-run-tests-buffer)
  (evil-leader/set-key-for-mode mm "mtq" 'ert))

;; auto-switch to lisp state commands
(defconst evil-lisp-state-commands

    (eval
     `(progn
        (define-key evil-lisp-state-map ,(kbd key) ',cmd)
        (if evil-lisp-state-global
            (evil-leader/set-key
              ,(kbd (concat evil-lisp-state-leader-prefix key))
              (evil-lisp-state-enter-command ,cmd))
          (dolist (mm evil-lisp-state-major-modes)
            (evil-leader/set-key-for-mode mm
              ,(kbd (concat evil-lisp-state-leader-prefix key))
              (evil-lisp-state-enter-command ,cmd))))))))

(defun lisp-state-toggle-lisp-state ()
  "Toggle the lisp state."
