[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-lisp-state 13fc1def92 112/125: Add variable evil-lisp
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-lisp-state 13fc1def92 112/125: Add variable evil-lisp-state-enter-lisp-state-on-command |
Date: |
Thu, 6 Jan 2022 04:58:45 -0500 (EST) |
branch: elpa/evil-lisp-state
commit 13fc1def920ac8e816549e380656614fe92fd113
Author: syl20bnr <sylvain.benner@gmail.com>
Commit: syl20bnr <sylvain.benner@gmail.com>
Add variable evil-lisp-state-enter-lisp-state-on-command
---
README.md | 6 +++++-
evil-lisp-state.el | 27 +++++++++++++++++++--------
2 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index fdf9f6d2d4..e3426b6f5c 100644
--- a/README.md
+++ b/README.md
@@ -44,7 +44,7 @@ both `evil`, `bind-map` and `smartparens` to be installed.
To execute a command while in normal state, a leader key is used.
By default, the leader for each command is `SPC l`.
-Any command when executed sets the current state to `lisp state`.
+By default any command when executed sets the current state to `lisp state`.
Examples:
@@ -119,6 +119,10 @@ effect.
The leader key is `SPC l` by default, it is possible to change it with the
variable `evil-lisp-state-leader'.
+If you don't want commands to enter in `lisp state` by default set the variable
+`evil-lisp-state-enter-lisp-state-on-command` to nil. Then use the
+<kbd>,,</kbd> to enter manually in `lisp state`
+
[evil-link]: https://gitorious.org/evil/pages/Home
[smartparens-link]: https://github.com/Fuco1/smartparens/wiki
[melpa-link]: http://melpa.org/
diff --git a/evil-lisp-state.el b/evil-lisp-state.el
index bcc8023481..ffedf1d648 100644
--- a/evil-lisp-state.el
+++ b/evil-lisp-state.el
@@ -34,7 +34,8 @@
;; To execute a command while in normal state, a leader is used.
;; By default, the leader for each command is `SPC l`.
-;; Any command when executed sets the current state to `lisp state`.
+;; By default, any command when executed sets the current state to
+;; `lisp state`.
;; By example, to slurp three times while in normal state:
;; <leader> 3 s
@@ -101,6 +102,10 @@
;; The leader key is `SPC l' by default, it is possible to
;; change it with the variable `evil-lisp-state-leader'.
+;; If you don't want commands to enter in `lisp state' by default
+;; set the variable `evil-lisp-state-enter-lisp-state-on-command'
+;; to nil. Then use the `,,' to enter manually in `lisp state'
+
;;; Code:
(require 'evil)
@@ -134,6 +139,11 @@
(defcustom evil-lisp-state-major-modes '(emacs-lisp-mode)
"Major modes where evil leader key bindings are defined.
If `evil-lisp-state-global' is non nil then this variable has no effect."
+ :type 'sexp
+ :group 'evil-lisp-state)
+
+ (defcustom evil-lisp-state-enter-lisp-state-on-command nil
+ "If non nil, enter evil-lisp-state before executing command."
:type 'sexp
:group 'evil-lisp-state))
@@ -146,7 +156,8 @@ If `evil-lisp-state-global' is non nil then this variable
has no effect."
`(progn
(defun ,funcname ()
(interactive)
- (evil-lisp-state)
+ (when evil-lisp-state-enter-lisp-state-on-command
+ (evil-lisp-state))
(call-interactively ',command))
',funcname)))
@@ -241,17 +252,17 @@ If `evil-lisp-state-global' is non nil then this variable
has no effect."
(eval
`(progn
(if evil-lisp-state-global
- (define-key evil-lisp-state-map ,(kbd key) ',cmd)
- (define-key evil-lisp-state-major-mode-map ,(kbd key) ',cmd))))))
+ (define-key evil-lisp-state-map ,(kbd key)
+ (evil-lisp-state-enter-command ,cmd))
+ (define-key evil-lisp-state-major-mode-map ,(kbd key)
+ (evil-lisp-state-enter-command ,cmd)))))))
(defun lisp-state-toggle-lisp-state ()
"Toggle the lisp state."
(interactive)
+ (message "state: %s" evil-state)
(if (eq 'lisp evil-state)
- (progn
- (message "state: lisp -> normal")
- (evil-normal-state))
- (message "state: %s -> lisp" evil-state)
+ (evil-normal-state)
(evil-lisp-state)))
(defun lisp-state-wrap (&optional arg)
- [nongnu] elpa/evil-lisp-state 483e20ff97 073/125: Regular evil `o` and `O` command, (continued)
- [nongnu] elpa/evil-lisp-state 483e20ff97 073/125: Regular evil `o` and `O` command, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state e1cf52572a 077/125: Remove expand-region dependency, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 383de2fdd3 082/125: Remove warning in readme, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state c0b43aa30e 087/125: Add `Shift-Return` to insert new line and switch to insert state, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 7bd49350df 090/125: Change sp-absorb-sexp binding to `B`, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 575de5d980 093/125: Missing autoload on defcustom, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state cff8cfa8a1 095/125: Add MELPA badge, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 701fccf899 097/125: Minor README changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state fc34826f18 099/125: Default behavior for hjkl, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 96d21715bd 106/125: Fix typo, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 13fc1def92 112/125: Add variable evil-lisp-state-enter-lisp-state-on-command,
ELPA Syncer <=
- [nongnu] elpa/evil-lisp-state ca3fe14475 115/125: Change switch to lisp state from <leader> , , to <leader> ., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state f4da219005 120/125: Remove default key binding and inform user to explicity define one., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 7499dc3bd3 039/125: Version 1.2, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 6c41877161 047/125: Add evil-delete-line with key binding `D`, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 09b5bb43ed 052/125: Version 1.5.3, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 41b73ab51f 053/125: Fix insert of left parenthesis, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 4441fb049c 048/125: Update readme, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 33602d3edc 063/125: Typo in readme, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 10e001ab8c 079/125: Minor change in readme, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 1df2f73902 088/125: Fix Symbol's value as variable is void: evil-lisp-state-backward-prefix, ELPA Syncer, 2022/01/06