[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-escape 5c5b1a655c 076/133: Add new defcustom evil-esc
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-escape 5c5b1a655c 076/133: Add new defcustom evil-escape-enable-only-for-major-modes |
Date: |
Wed, 3 Jan 2024 21:59:54 -0500 (EST) |
branch: elpa/evil-escape
commit 5c5b1a655cf8600af9fd8dea8f60763474c82b45
Author: syl20bnr <sylvain.benner@gmail.com>
Commit: syl20bnr <sylvain.benner@gmail.com>
Add new defcustom evil-escape-enable-only-for-major-modes
Fixes #36
---
README.md | 11 ++++++++++-
evil-escape.el | 16 ++++++++++++++--
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 9808d7cea3..75a5011b58 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[![MELPA](http://melpa.org/packages/evil-escape-badge.svg)](http://melpa.org/#/evil-escape)
[![MELPA
Stable](http://stable.melpa.org/packages/evil-escape-badge.svg)](http://stable.melpa.org/#/evil-escape)
-<!-- markdown-toc start - Don't edit this section. Run M-x
markdown-toc/generate-toc again -->
+<!-- markdown-toc start - Don't edit this section. Run M-x
markdown-toc-generate-toc again -->
**Table of Contents**
- [evil-escape](#evil-escape)
@@ -11,6 +11,8 @@
- [Customization](#customization)
- [Key sequence](#key-sequence)
- [Delay between keys](#delay-between-keys)
+ - [Excluding a major mode](#excluding-a-major-mode)
+ - [Enable only for a list of major
modes](#enable-only-for-a-list-of-major-modes)
<!-- markdown-toc end -->
@@ -88,4 +90,11 @@ composed with the two same characters it is recommended to
set the delay to
A major mode can be excluded by adding it to the list
`evil-escape-excluded-major-modes`.
+### Enable only for a list of major modes
+
+It is also possible to provide an inclusive list of major modes
+with the variable `evil-escape-enable-only-for-major-modes`. When this list
+non-nil then evil-escape is enabled only for the major-modes contained in the
+list.
+
[MELPA]: http://melpa.org/
diff --git a/evil-escape.el b/evil-escape.el
index 442a4b6ac0..4d6a88903e 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: 3.03
+;; Version: 3.04
;; Package-Requires: ((emacs "24") (evil "1.0.9"))
;; URL: https://github.com/syl20bnr/evil-escape
@@ -58,6 +58,11 @@
;; A major mode can be excluded by adding it to the list
;; `evil-escape-excluded-major-modes'.
+;; It is also possible to provide an inclusive list of major modes
+;; with the variable `evil-escape-enable-only-for-major-modes'. When this list
+;; non-nil then evil-escape is enabled only for the major-modes contained in
the
+;; list.
+
;; More information in the readme of the repository:
;; https://github.com/syl20bnr/evil-escape
@@ -80,11 +85,16 @@
:type 'number
:group 'evil-escape)
-(defcustom evil-escape-excluded-major-modes '()
+(defcustom evil-escape-excluded-major-modes nil
"Excluded major modes where escape sequences has no effect."
:type 'sexp
:group 'evil-escape)
+(defcustom evil-escape-enable-only-for-major-modes nil
+ "List of major modes where evil-escape is enabled."
+ :type 'sexp
+ :group 'evil-escape)
+
;;;###autoload
(define-minor-mode evil-escape-mode
"Buffer-local minor mode to escape insert state and everythin else
@@ -120,6 +130,8 @@ with a key sequence."
(and (fboundp 'helm-alive-p) (helm-alive-p))
(not (eq evil-state 'normal)))
(not (memq major-mode evil-escape-excluded-major-modes))
+ (or (not evil-escape-enable-only-for-major-modes)
+ (memq major-mode evil-escape-enable-only-for-major-modes))
(equal (this-command-keys) (evil-escape--first-key))))
(defun evil-escape--escape ()
- [nongnu] elpa/evil-escape 457386c7bc 043/133: Generalize passthrough, (continued)
- [nongnu] elpa/evil-escape 457386c7bc 043/133: Generalize passthrough, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 6c6379c19b 065/133: Update README for 3.0, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape bc054dbe1e 059/133: Add documentation to generated wrapper functions, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 1488a2c9c3 037/133: When replaying macro, pass shadow func, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape f8fe5c98d2 083/133: Add `evil-escape-inhibit-functions`, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape b0d033794c 089/133: Fix typo in docstring of evil-escape-mode, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 1c4b0efc06 100/133: Allow evil-escape in normal state if it makes sense, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape bb6f6c254a 069/133: Fix isearch support, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape bf41c9e797 068/133: Fix typo in docstring (thanks to person808), ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 6790f87d87 081/133: Fix unexpected escape when unordered-key-sequence is non nil, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 5c5b1a655c 076/133: Add new defcustom evil-escape-enable-only-for-major-modes,
ELPA Syncer <=
- [nongnu] elpa/evil-escape 17023f4ce4 072/133: Correctly revert modified status of the buffer, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape fbf7e6ee35 113/133: Add support for evil-multiedit, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 6a9d60c733 087/133: Update README TOC, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape fccebfe601 098/133: Add support for emoji-cheat-sheet-plus-buffer, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 09e0622e16 109/133: Add support for image-mode, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape af1a6eb532 110/133: Fix display flickering when using 'global-hl-line-mode', ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 9328f25199 122/133: Fix docstrings, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 8f5b4ccc81 094/133: Revert insert/delete functions, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 9257ed0427 130/133: Don't redisplay and font locking while doing evil-escape, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 80029c6892 108/133: Add support for evil-magit, ELPA Syncer, 2024/01/03