emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil-escape 95cd06f3c5 029/133: Fix regression with term b


From: ELPA Syncer
Subject: [nongnu] elpa/evil-escape 95cd06f3c5 029/133: Fix regression with term buffers
Date: Wed, 3 Jan 2024 21:59:50 -0500 (EST)

branch: elpa/evil-escape
commit 95cd06f3c546983f18dd7758386ca6820c01ca45
Author: sbenner <sylvain.benner@gmail.com>
Commit: sbenner <sylvain.benner@gmail.com>

    Fix regression with term buffers
---
 evil-escape.el | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/evil-escape.el b/evil-escape.el
index 3bd585fc07..79c946fa6a 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.03
+;; Version: 2.04
 ;; Package-Requires: ((emacs "24") (evil "1.0.9"))
 ;; URL: https://github.com/syl20bnr/evil-escape
 
@@ -80,7 +80,7 @@
     :group 'evil-escape))
 
 (defvar evil-escape-motion-state-shadowed-func nil
-  "Original function of `evil-motion-state' shadowed by `evil-escape'.
+  "Original function of `evil-motion-state' shadowed by `evil-espace'.
 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.")
@@ -93,7 +93,7 @@ mode is disabled.")
 
 ;;;###autoload
 (define-minor-mode evil-escape-mode
-  "Buffer-local minor mode to escape insert state and everything else
+  "Buffer-local minor mode to escape insert state and everythin else
 with a key sequence."
   :lighter (:eval (concat " " evil-escape-key-sequence))
   :group 'evil
@@ -152,9 +152,13 @@ with a key sequence."
         (lookup-key evil-motion-state-map (evil-escape--first-key)))
   ;; evil states
   ;; insert state
-  (eval `(evil-escape-define-escape "insert-state" evil-insert-state-map 
evil-normal-state
-                                    :insert-func 
evil-escape--default-insert-func
-                                    :delete-func 
evil-escape--default-delete-func))
+  (let ((insert-func (lambda (key) (interactive)
+                       (cond ((eq 'term-mode major-mode)
+                              (call-interactively 'term-send-raw))
+                             (t (evil-escape--default-insert-func key))))))
+    (eval `(evil-escape-define-escape "insert-state" evil-insert-state-map 
evil-normal-state
+                                      :insert-func ,insert-func
+                                      :delete-func 
evil-escape--default-delete-func)))
   ;; emacs state
   (let ((exit-func (lambda () (interactive)
                      (cond ((string-match "magit" (symbol-name major-mode))
@@ -244,6 +248,10 @@ with a key sequence."
   "Send `q' key press event to exit from a buffer."
   (setq unread-command-events (listify-key-sequence "q")))
 
+(defun evil-escape--term-insert-func (key)
+  "Insert KEY in current term buffer."
+  (term-send-raw))
+
 (defun evil-escape--execute-shadowed-func (func)
   "Execute the passed FUNC if the context allows it."
   (unless (or (null func)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]