Skip to content

Commit 72129a6

Browse files
committed
Use avy-with in motion definitions, closes #37
1 parent eb1433a commit 72129a6

File tree

1 file changed

+28
-26
lines changed

1 file changed

+28
-26
lines changed

evil-easymotion.el

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -179,20 +179,21 @@
179179
'evil-define-command
180180
'evil-define-motion)
181181
,name (&optional _count)
182-
(evil-without-repeat
183-
(setq evil-this-type 'inclusive)
184-
(cl-letf* ,bind
185-
,(when pre-hook `(funcall ,(if (functionp pre-hook)
186-
pre-hook
187-
`(lambda () ,pre-hook))))
188-
(evilem--jump (evilem--collect ,funcs
189-
,scope
190-
,all-windows
191-
,initial-point
192-
,collect-postprocess))
193-
,(when post-hook `(funcall ,(if (functionp post-hook)
194-
post-hook
195-
`(lambda () ,post-hook))))))))
182+
(avy-with ,name
183+
(evil-without-repeat
184+
(setq evil-this-type 'inclusive)
185+
(cl-letf* ,bind
186+
,(when pre-hook `(funcall ,(if (functionp pre-hook)
187+
pre-hook
188+
`(lambda () ,pre-hook))))
189+
(evilem--jump (evilem--collect ,funcs
190+
,scope
191+
,all-windows
192+
,initial-point
193+
,collect-postprocess))
194+
,(when post-hook `(funcall ,(if (functionp post-hook)
195+
post-hook
196+
`(lambda () ,post-hook)))))))))
196197

197198
(cl-defmacro evilem-make-motion-plain (name
198199
funcs
@@ -207,18 +208,19 @@
207208
"Automatically define a plain easymotion for `func', naming it `name'"
208209
`(defun ,name ()
209210
(interactive)
210-
(cl-letf* ,bind
211-
,(when pre-hook `(funcall ,(if (functionp pre-hook)
212-
pre-hook
213-
`(lambda () ,pre-hook))))
214-
(evilem--jump (evilem--collect ,funcs
215-
,scope
216-
,all-windows
217-
,initial-point
218-
,collect-postprocess))
219-
,(when post-hook `(funcall ,(if (functionp post-hook)
220-
post-hook
221-
`(lambda () ,post-hook)))))))
211+
(avy-with ,name
212+
(cl-letf* ,bind
213+
,(when pre-hook `(funcall ,(if (functionp pre-hook)
214+
pre-hook
215+
`(lambda () ,pre-hook))))
216+
(evilem--jump (evilem--collect ,funcs
217+
,scope
218+
,all-windows
219+
,initial-point
220+
,collect-postprocess))
221+
,(when post-hook `(funcall ,(if (functionp post-hook)
222+
post-hook
223+
`(lambda () ,post-hook))))))))
222224

223225
(cl-defmacro evilem-create (motions
224226
&key

0 commit comments

Comments
 (0)