[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-escape 07c6c1b4da 007/133: Fixes #2 Symbol's value as
|
From: |
ELPA Syncer |
|
Subject: |
[nongnu] elpa/evil-escape 07c6c1b4da 007/133: Fixes #2 Symbol's value as variable is void: isearch-abort |
|
Date: |
Wed, 3 Jan 2024 21:59:48 -0500 (EST) |
branch: elpa/evil-escape
commit 07c6c1b4da02b6ab154d1bbd5ae50e9ae4a85ef8
Author: sbenner <sylvain.benner@gmail.com>
Commit: sbenner <sylvain.benner@gmail.com>
Fixes #2 Symbol's value as variable is void: isearch-abort
---
evil-escape.el | 81 +++++++++++++++++++++++++++++-----------------------------
1 file changed, 41 insertions(+), 40 deletions(-)
diff --git a/evil-escape.el b/evil-escape.el
index e296996e9b..98f919c197 100644
--- a/evil-escape.el
+++ b/evil-escape.el
@@ -53,6 +53,7 @@
:prefix "evil-escape-"
:group 'evil)
+;;;###autoload
(defcustom evil-escape-key-sequence (kbd "fd")
"Two keys sequence to escape from insert state."
:type 'key-sequence
@@ -73,6 +74,46 @@ with a key sequence."
evil-escape-key-sequence))
(evil-escape--undefine-keys)))
+(defmacro evil-escape-define-escape (map command &rest properties)
+ "Define an escape in MAP keymap by executing COMMAND.
+
+`:insert BOOL'
+ If BOOL is not nil the first character of the escape sequence is inserted
+ in the buffer using `:insert-func' if the buffer is not read-only.
+
+`:delete BOOL'
+ If BOOL is not nil the first character is deleted using `:delete-func' if
+ the escape sequence succeeded.
+
+`:shadowed BOOL'
+ BOOL not nil indicates that the first key of the sequence shadows a
+ function. This function is looked-up from `evil-motion-state-map'.
+ Whenever the escape sequence does not succeed and BOOL is not nil
+ the shadowed function is called.
+
+`:insert-func FUNCTION'
+ Specify the insert function to call when inserting the first key.
+
+`:delete-func FUNCTION'
+ Specify the delete function to call when deleting the first key."
+ (let* ((first-key (elt evil-escape-key-sequence 0))
+ (fkeystr (char-to-string first-key))
+ (insertp (plist-get properties :insert))
+ (deletep (plist-get properties :delete))
+ (insert-func (plist-get properties :insert-func))
+ (delete-func (plist-get properties :delete-func)))
+ `(progn
+ (define-key ,map ,fkeystr
+ (lambda () (interactive)
+ (evil-escape--escape
+ ,evil-escape-key-sequence
+ ',(if (plist-get properties :shadowed) (lookup-key
evil-motion-state-map fkeystr))
+ ,insertp
+ ,deletep
+ ',command
+ ',insert-func
+ ',delete-func))))))
+
(defun evil-escape--define-keys ()
"Set the key bindings to escape _everything!_"
;; use key-chord whenever it is possible
@@ -119,46 +160,6 @@ with a key sequence."
;; isearch
(define-key isearch-mode-map (kbd "f") 'isearch-printing-char))
-(defmacro evil-escape-define-escape (map command &rest properties)
- "Define an escape in MAP keymap by executing COMMAND.
-
-`:insert BOOL'
- If BOOL is not nil the first character of the escape sequence is inserted
- in the buffer using `:insert-func' if the buffer is not read-only.
-
-`:delete BOOL'
- If BOOL is not nil the first character is deleted using `:delete-func' if
- the escape sequence succeeded.
-
-`:shadowed BOOL'
- BOOL not nil indicates that the first key of the sequence shadows a
- function. This function is looked-up from `evil-motion-state-map'.
- Whenever the escape sequence does not succeed and BOOL is not nil
- the shadowed function is called.
-
-`:insert-func FUNCTION'
- Specify the insert function to call when inserting the first key.
-
-`:delete-func FUNCTION'
- Specify the delete function to call when deleting the first key."
- (let* ((first-key (elt evil-escape-key-sequence 0))
- (fkeystr (char-to-string first-key))
- (insertp (plist-get properties :insert))
- (deletep (plist-get properties :delete))
- (insert-func (plist-get properties :insert-func))
- (delete-func (plist-get properties :delete-func)))
- `(progn
- (define-key ,map ,fkeystr
- (lambda () (interactive)
- (evil-escape--escape
- ,evil-escape-key-sequence
- ',(if (plist-get properties :shadowed) (lookup-key
evil-motion-state-map fkeystr))
- ,insertp
- ,deletep
- ',command
- ',insert-func
- ',delete-func))))))
-
(defun evil-escape--default-insert-func (key)
"Insert KEY in current buffer if not read only."
(let* ((insertp (not buffer-read-only)))
- [nongnu] elpa/evil-escape b09500cc4e 002/133: Update readme, (continued)
- [nongnu] elpa/evil-escape b09500cc4e 002/133: Update readme, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 8af69d73f8 020/133: Fixes #10 deleting with `df)` does not include `)`, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 9dd9cccf32 027/133: Add pass through functionality, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 0da35398ed 058/133: Fix support for operators, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 0346740ff1 031/133: Correctly handle the evil function properties, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 37c227e4df 018/133: Version 1.5.1, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 05709479ed 010/133: Add badge for melpa stable, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 1fe3759ab4 014/133: Fix 'commandp is nil` when search for `f` in isearch, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 5da641b6e6 019/133: Quit ert buffers, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape fe21e8f256 004/133: Fix error in readme, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 07c6c1b4da 007/133: Fixes #2 Symbol's value as variable is void: isearch-abort,
ELPA Syncer <=
- [nongnu] elpa/evil-escape 1d09324c72 011/133: Fix byte-compilation and defcustom, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 7aa2bb2155 024/133: Suppress key-chord dependency (v2.0), ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 2e7bf1e62e 021/133: Support undo-tree, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape e0a0c9a9ee 023/133: Add support for paradox and gist-list menu, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 0b62cb6637 025/133: Fix multiple inserted occurrences of `f` in isearch and ex-command context, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 6cb4fa408a 026/133: Add evil-iedit-state, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 6d46b81bbc 030/133: Fix regression for evil-iedit-state, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape 3637f13210 055/133: Correctly handle iedit-state, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape da5498d25e 035/133: Correctly restore evil-lisp-state shadowed function by evil-escape, ELPA Syncer, 2024/01/03
- [nongnu] elpa/evil-escape cf3e18673d 051/133: Undefine mapping on first key when evil-escape is disabled, ELPA Syncer, 2024/01/03