[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/avy fd7b02f556 28/31: Add `avy-action-oneshot` variable
From: |
ELPA Syncer |
Subject: |
[elpa] externals/avy fd7b02f556 28/31: Add `avy-action-oneshot` variable to redefine avy-action locally |
Date: |
Mon, 13 Feb 2023 21:57:28 -0500 (EST) |
branch: externals/avy
commit fd7b02f556041c883bad66517ff2ea6fff3113e8
Author: aragaer <aragaer@gmail.com>
Commit: aragaer <aragaer@gmail.com>
Add `avy-action-oneshot` variable to redefine avy-action locally
Could be used this way:
```elisp
(let ((avy-action-oneshot #'push-button))
(avy-goto-char-timer))
```
---
avy.el | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/avy.el b/avy.el
index 5d0bc9ebb9..9e411f57f6 100644
--- a/avy.el
+++ b/avy.el
@@ -455,6 +455,9 @@ KEYS is the path from the root of `avy-tree' to LEAF."
(defvar avy-action nil
"Function to call at the end of select.")
+(defvar avy-action-oneshot nil
+ "Function to call once at the end of select.")
+
(defun avy-handler-default (char)
"The default handler for a bad CHAR."
(let (dispatch)
@@ -890,10 +893,12 @@ multiple OVERLAY-FN invocations."
(t
(funcall avy-pre-action res)
(setq res (car res))
- (funcall (or avy-action 'avy-action-goto)
- (if (consp res)
- (car res)
- res))
+ (let ((action (or avy-action avy-action-oneshot 'avy-action-goto)))
+ (setq avy-action-oneshot nil)
+ (funcall action
+ (if (consp res)
+ (car res)
+ res)))
res))))
(define-obsolete-function-alias 'avy--process 'avy-process
- [elpa] externals/avy f34ff764aa 22/31: avy.el (avy-escape-chars): Add defcustom, (continued)
- [elpa] externals/avy f34ff764aa 22/31: avy.el (avy-escape-chars): Add defcustom, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 2dde8b71a0 23/31: avy.el (avy-process): Add autoload, ELPA Syncer, 2023/02/13
- [elpa] externals/avy e92cb37457 25/31: avy.el (avy-transpose-lines-in-region): Add, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 6b53033883 26/31: Add GNU ELPA badge to README.md, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 955c8dedd6 30/31: avy.el (avy--overlay): Avoid error on empty string, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 9b1f0bc427 31/31: Merge remote-tracking branch 'refs/remotes/upstream/avy/main' into elpa--merge/avy, ELPA Syncer, 2023/02/13
- [elpa] externals/avy aadca9308a 03/31: avy.el (avy-resume): Work better for avy-goto-timer, ELPA Syncer, 2023/02/13
- [elpa] externals/avy ba5f035be3 27/31: Fix two byte-compiler warnings, ELPA Syncer, 2023/02/13
- [elpa] externals/avy acf553cae2 20/31: avy.el (avy--overlay-pre): Fix conflict with visual-line-mode, ELPA Syncer, 2023/02/13
- [elpa] externals/avy 36a48baa2c 21/31: avy.el (avy-goto-char-2): Allow backspace, ELPA Syncer, 2023/02/13
- [elpa] externals/avy fd7b02f556 28/31: Add `avy-action-oneshot` variable to redefine avy-action locally,
ELPA Syncer <=
- [elpa] externals/avy 6f9eefadc9 29/31: avy.el (avy-process): Assume avy-action-oneshot will be let-bound, ELPA Syncer, 2023/02/13