[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-escape f8657037f4 042/133: Add new custom variable `e
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-escape f8657037f4 042/133: Add new custom variable `evil-escape-excluded-major-modes` |
Date: |
Wed, 3 Jan 2024 21:59:51 -0500 (EST) |
branch: elpa/evil-escape
commit f8657037f4f276aff03f3abb472bf21d6133ccc0
Author: syl20bnr <sylvain.benner@gmail.com>
Commit: syl20bnr <sylvain.benner@gmail.com>
Add new custom variable `evil-escape-excluded-major-modes`
Fixes #16
---
README.md | 5 +++++
evil-escape.el | 50 ++++++++++++++++++++++++++++++++++----------------
2 files changed, 39 insertions(+), 16 deletions(-)
diff --git a/README.md b/README.md
index 070786ba93..4eb9817f69 100644
--- a/README.md
+++ b/README.md
@@ -87,6 +87,11 @@ composed with the two same characters it is recommended to
set the delay to
**Note:** The variable `evil-escape-delay` must be set before requiring
`evil-escape`.
+### Excluding a major mode
+
+A major mode can be excluded by adding it to the list
+`evil-escape-excluded-major-modes`.
+
## Limitations
### Macro
diff --git a/evil-escape.el b/evil-escape.el
index 07ece6271e..99d24680ac 100644
--- a/evil-escape.el
+++ b/evil-escape.el
@@ -5,7 +5,7 @@
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; Keywords: convenience editing evil
;; Created: 22 Oct 2014
-;; Version: 2.13
+;; Version: 2.14
;; Package-Requires: ((emacs "24") (evil "1.0.9"))
;; URL: https://github.com/syl20bnr/evil-escape
@@ -56,6 +56,9 @@
;; the variable `evil-escape-delay'. Default is `0.1'.
;; It must be set before requiring evil-escape.
+;; A major mode can be excluded by adding it to the list
+;; `evil-escape-excluded-major-modes'.
+
;; More information in the readme of the repository:
;; https://github.com/syl20bnr/evil-escape
@@ -86,7 +89,13 @@
(defcustom evil-escape-delay 0.1
"Max time delay between the two key press to be considered successful."
:type 'number
- :group 'evil-escape))
+ :group 'evil-escape)
+
+ (defcustom evil-escape-excluded-major-modes '()
+ "Excluded major modes where escape sequences has no effect."
+ :type 'sexp
+ :group 'evil-escape)
+)
(defvar evil-escape-motion-state-shadowed-func nil
"Original function of `evil-motion-state' shadowed by `evil-espace'.
@@ -153,20 +162,27 @@ with a key sequence."
(evil-define-motion ,(evil-escape--escape-function-symbol from)
(count)
,@evil-func-props
- ;; called by the user
- (if (called-interactively-p 'interactive)
- (evil-escape--escape ,evil-escape-key-sequence
- ',command
- ',shadowed-func
- ',insert-func
- ',delete-func)
- ;; not called by the user, i.e. called by a keyboard macro
- (cond
- ((fboundp ',insert-func)
- (funcall ',insert-func ,(evil-escape--first-key)))
- ((fboundp ',shadowed-func)
- (evil-escape--setup-emacs-state-passthrough)
- (evil-escape--execute-shadowed-func ',shadowed-func)))))))))
+ (if (memq major-mode evil-escape-excluded-major-modes)
+ (progn
+ ;; excluded major mode, passthrough
+ (when (fboundp ',insert-func)
+ (funcall ',insert-func ,(evil-escape--first-key)))
+ (when (fboundp ',shadowed-func)
+ (evil-escape--execute-shadowed-func ',shadowed-func)))
+ (if (called-interactively-p 'interactive)
+ ;; called by the user
+ (evil-escape--escape ,evil-escape-key-sequence
+ ',command
+ ',shadowed-func
+ ',insert-func
+ ',delete-func)
+ (cond
+ ;; not called by the user, i.e. called by a keyboard macro
+ ((fboundp ',insert-func)
+ (funcall ',insert-func ,(evil-escape--first-key)))
+ ((fboundp ',shadowed-func)
+ (evil-escape--setup-emacs-state-passthrough)
+ (evil-escape--execute-shadowed-func ',shadowed-func))))))))))
(defun evil-escape--define-keys ()
"Set the key bindings to escape _everything!_"
@@ -365,3 +381,5 @@ DELETE-FUNC when calling CALLBACK. "
(evil-escape--execute-shadowed-func shadowed-func))))))
(provide 'evil-escape)
+
+;;; evil-escape.el ends here
- [nongnu] elpa/evil-escape 4779435d94 001/133: Initial commit, (continued)
- [nongnu] elpa/evil-escape 4779435d94 001/133: Initial commit, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 0fbedcbd86 016/133: Version 1.5.0, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape ca4c6f6065 017/133: Correctly restore bindings when the mode is disabled, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 3e3920f524 008/133: Version 1.01, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 2def4a3b54 006/133: Merge pull request #1 from purcell/patch-1, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape f85416cc7c 015/133: Escape apropos buffers, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 177eccdd92 022/133: Fix byte-compilation error: void function evil-escape--first-key, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 773e7144e2 003/133: Version 1.0, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 95cd06f3c5 029/133: Fix regression with term buffers, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 09b6486054 038/133: Add limitation in macro in README, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape f8657037f4 042/133: Add new custom variable `evil-escape-excluded-major-modes`,
ELPA Syncer <=
- [nongnu] elpa/evil-escape 1d7052cebc 039/133: Bump to version 2.11, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 7067e1b84d 034/133: Fix escape sequence for evil-lisp-state, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape c410d7e977 044/133: Fixes #18 Leaves first key in multi-term, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape f59790846c 062/133: Add evil-escape-inhibit variable, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 0e1996ec55 060/133: Fix Symbol's value as variable is void: hl-line-mode, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 6634eff564 032/133: Fix `fd` not working in some case when in `emacs state`, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 526de681d3 047/133: Fix multiple `isearch-abort`, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 64c65a4e96 053/133: Remove company support, bump version to 2.21, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 0326241bcd 048/133: Bump to version 2.18, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 1271af99ac 064/133: Rewrite of evil-escape (v3.0), ELPA Syncer, 2024/01/03