mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 05:23:05 +00:00
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)) ```
This commit is contained in:
parent
ba5f035be3
commit
fd7b02f556
13
avy.el
13
avy.el
@ -455,6 +455,9 @@ KEYS is the path from the root of `avy-tree' to LEAF."
|
|||||||
(defvar avy-action nil
|
(defvar avy-action nil
|
||||||
"Function to call at the end of select.")
|
"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)
|
(defun avy-handler-default (char)
|
||||||
"The default handler for a bad CHAR."
|
"The default handler for a bad CHAR."
|
||||||
(let (dispatch)
|
(let (dispatch)
|
||||||
@ -890,10 +893,12 @@ multiple OVERLAY-FN invocations."
|
|||||||
(t
|
(t
|
||||||
(funcall avy-pre-action res)
|
(funcall avy-pre-action res)
|
||||||
(setq res (car res))
|
(setq res (car res))
|
||||||
(funcall (or avy-action 'avy-action-goto)
|
(let ((action (or avy-action avy-action-oneshot 'avy-action-goto)))
|
||||||
(if (consp res)
|
(setq avy-action-oneshot nil)
|
||||||
(car res)
|
(funcall action
|
||||||
res))
|
(if (consp res)
|
||||||
|
(car res)
|
||||||
|
res)))
|
||||||
res))))
|
res))))
|
||||||
|
|
||||||
(define-obsolete-function-alias 'avy--process 'avy-process
|
(define-obsolete-function-alias 'avy--process 'avy-process
|
||||||
|
Loading…
x
Reference in New Issue
Block a user