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
|
||||
"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
|
||||
|
Loading…
x
Reference in New Issue
Block a user