avy.el (avy-resume): Add

Holds last command avy command after user input. This is a quick way to
bring back the same markers after a jump.

Fixes #157
This commit is contained in:
justbur 2016-06-20 15:17:28 -04:00 committed by Oleh Krehel
parent 05a5003c2b
commit b522bfe320

8
avy.el
View File

@ -475,6 +475,10 @@ multiple DISPLAY-FN invokations."
(unless (memq major-mode avy-ignored-modes) (unless (memq major-mode avy-ignored-modes)
,@body))))) ,@body)))))
(defun avy-resume ()
"Stub to hold last avy command.
Commands using `avy-with' macro can be resumed.")
(defmacro avy-with (command &rest body) (defmacro avy-with (command &rest body)
"Set `avy-keys' according to COMMAND and execute BODY. "Set `avy-keys' according to COMMAND and execute BODY.
Set `avy-style' according to COMMMAND as well." Set `avy-style' according to COMMMAND as well."
@ -485,6 +489,10 @@ Set `avy-style' according to COMMMAND as well."
(avy-style (or (cdr (assq ',command avy-styles-alist)) (avy-style (or (cdr (assq ',command avy-styles-alist))
avy-style))) avy-style)))
(setq avy-action nil) (setq avy-action nil)
(setf (symbol-function 'avy-resume)
(lambda ()
(interactive)
,@body))
,@body)) ,@body))
(defun avy-action-goto (pt) (defun avy-action-goto (pt)