[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-escape f59790846c 062/133: Add evil-escape-inhibit va
|
From: |
ELPA Syncer |
|
Subject: |
[nongnu] elpa/evil-escape f59790846c 062/133: Add evil-escape-inhibit variable |
|
Date: |
Wed, 3 Jan 2024 21:59:53 -0500 (EST) |
branch: elpa/evil-escape
commit f59790846c55c0ddc3d95b79b7b9c5315cb537e0
Author: syl20bnr <sylvain.benner@gmail.com>
Commit: syl20bnr <sylvain.benner@gmail.com>
Add evil-escape-inhibit variable
Useful in wrapper functions around evil-escape's own wrappers.
---
evil-escape.el | 63 ++++++++++++++++++++++++++++++++--------------------------
1 file changed, 35 insertions(+), 28 deletions(-)
diff --git a/evil-escape.el b/evil-escape.el
index 0b1e2767bb..c6249e7ba7 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.27
+;; Version: 2.28
;; Package-Requires: ((emacs "24") (evil "1.0.9"))
;; URL: https://github.com/syl20bnr/evil-escape
@@ -128,6 +128,10 @@ This variable is used to restore the original function
bound to the
first key of the escape key sequence when `evil-escape'
mode is disabled.")
+(defvar evil-escape-inhibit nil
+ "If non nil then evil-escape does nothing. This variable is used to
+support functions which wrap evil-escape.")
+
;;;###autoload
(define-minor-mode evil-escape-mode
"Buffer-local minor mode to escape insert state and everythin else
@@ -379,6 +383,7 @@ from the `post-command-hook'."
(setq evil-escape--first-pass nil))
;; second pass
(evil-escape--define-keys)
+ (setq evil-escape-inhibit nil)
(remove-hook 'post-command-hook passthrough)))
(defun evil-escape--setup-passthrough (from map &optional shadowed-func)
@@ -391,7 +396,8 @@ from the `post-command-hook'."
,map
',shadowed-func
',passthrough)))
- (setq evil-escape--first-pass t)
+ (setq evil-escape--first-pass t
+ evil-escape-inhibit t)
(add-hook 'post-command-hook passthrough)
(unless (or (bound-and-true-p isearch-mode) (minibufferp))
(setq unread-command-events
@@ -417,32 +423,33 @@ DELETE-FUNC when calling CALLBACK. "
(fkeystr (char-to-string fkey))
(skey (elt keys 1))
(hl-line-mode-before (when (boundp 'hl-line-mode) hl-line-mode)))
- (if insert-func (funcall insert-func fkey))
- ;; global-hl-line-mode seems to be deactivated when `read-event' so we
- ;; temporarily force line-mode locally to prevent flicker
- (when (or (bound-and-true-p global-hl-line-mode)
- (bound-and-true-p hl-line-mode))
- (hl-line-mode))
- (let* ((evt (read-event nil nil evil-escape-delay)))
- (unless hl-line-mode-before (hl-line-mode -1))
- (cond
- ((null evt)
- (unless insert-func
- (evil-escape--setup-passthrough from map shadowed-func)))
- ((and (integerp evt)
- (char-equal evt skey))
- ;; remove the f character
- (if delete-func (funcall delete-func))
- (set-buffer-modified-p modified)
- ;; disable running transient map
- (unless (equal "isearch" from)
- (setq overriding-terminal-local-map nil))
- (call-interactively callback))
- (t ; otherwise
- (unless insert-func
- (evil-escape--setup-passthrough from map shadowed-func))
- (setq unread-command-events
- (append unread-command-events (list evt))))))))
+ (unless evil-escape-inhibit
+ (if insert-func (funcall insert-func fkey))
+ ;; global-hl-line-mode seems to be deactivated when `read-event' so we
+ ;; temporarily force line-mode locally to prevent flicker
+ (when (or (bound-and-true-p global-hl-line-mode)
+ (bound-and-true-p hl-line-mode))
+ (hl-line-mode))
+ (let* ((evt (read-event nil nil evil-escape-delay)))
+ (unless hl-line-mode-before (hl-line-mode -1))
+ (cond
+ ((null evt)
+ (unless insert-func
+ (evil-escape--setup-passthrough from map shadowed-func)))
+ ((and (integerp evt)
+ (char-equal evt skey))
+ ;; remove the f character
+ (if delete-func (funcall delete-func))
+ (set-buffer-modified-p modified)
+ ;; disable running transient map
+ (unless (equal "isearch" from)
+ (setq overriding-terminal-local-map nil))
+ (call-interactively callback))
+ (t ; otherwise
+ (unless insert-func
+ (evil-escape--setup-passthrough from map shadowed-func))
+ (setq unread-command-events
+ (append unread-command-events (list evt)))))))))
(provide 'evil-escape)
- [nongnu] elpa/evil-escape 2def4a3b54 006/133: Merge pull request #1 from purcell/patch-1, (continued)
- [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, 2024/01/03
- [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 <=
- [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
- [nongnu] elpa/evil-escape e297938f32 050/133: Remove message when the mode is enabled, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 7fd1902fac 033/133: Fix regression in visual block, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 0e95e20437 040/133: Prevent infinite recursion if evil-escape.el is evaluated twice, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 7600904462 045/133: Fix double insert of first key in some cases, ELPA Syncer, 2024/01/03