branch: master commit b522bfe320ac71d50baa075ae8be7e06c6594816 Author: justbur <jus...@burkett.cc> Commit: Oleh Krehel <ohwoeo...@gmail.com>
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 --- avy.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/avy.el b/avy.el index 3f0bef0..e076e1c 100644 --- a/avy.el +++ b/avy.el @@ -475,6 +475,10 @@ multiple DISPLAY-FN invokations." (unless (memq major-mode avy-ignored-modes) ,@body))))) +(defun avy-resume () + "Stub to hold last avy command. +Commands using `avy-with' macro can be resumed.") + (defmacro avy-with (command &rest body) "Set `avy-keys' according to COMMAND and execute BODY. 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))) (setq avy-action nil) + (setf (symbol-function 'avy-resume) + (lambda () + (interactive) + ,@body)) ,@body)) (defun avy-action-goto (pt)