5

I'm trying to use a hydra to dispatch among a selection of motions. See this minimal example:

(defhydra hydra/test (:color blue)
  "This is a test hydra"
  ("n" evil-next-line))

(evil-define-motion hydra/test/motion-proxy (&rest args)
  (hydra/test/body))

(global-set-key (kbd "M-RET") #'hydra/test/motion-proxy)

Unfortunately, this motion does not compose with evil operators. For example, d M-RET n does move to the next line, but does not delete any text.

How can I work around this?

PythonNut
  • 10,243
  • 2
  • 29
  • 75
  • 5
    This question should be upvoted if only for the title :-) – NickD Jan 09 '18 at 03:28
  • If you are interested, the [key-guide](https://github.com/dalanicolai/emacs-key-guide) library can be used to list available options after pressing some `evil operator key`. Unfortunately, I did not find time to add more explanations after (partly) creating the 'development notes' (i.e. the github README). The difference with which-key is that you can custom 'design' the pop-up. A difference with hydra is that hydra uses its own keymap. – dalanicolai Apr 13 '23 at 18:22

1 Answers1

0

unfortunately i think this cannot work. evil commands like d (evil-delete) manually read a key sequence to obtain a motion, bypassing emacs' normal key maps.