abo-abo / hydra

make Emacs bindings that stick around

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Binding head does not work even though mentioned in README

mcp292 opened this issue · comments

This binding doesn't work even though there is mention of manually binding:

But then you would have to bind hydra-zoom/text-scale-increase and hydra-zoom/text-scale-decrease yourself.

But binding 'humb-jump-hydra/dumb-jump-go gives an error:

(defhydra dumb-jump-hydra (:color blue)
   "dumb jump"
   ("g" dumb-jump-go "go to declaration")
   ("b" dumb-jump-back "back"))
(global-set-key (kbd "C-M-g") 'dumb-jump-hydra/dumb-jump-go)

Error:

Wrong type argument: commandp, dumb-jump-hydra/dumb-jump-goWrong type argument: commandp, dumb-jump-hydra/dumb-jump-go

My expectation was that this would execute the command and leave the hydra state active.

For reference this achieved what I wanted, but it was hard tracking down documentation for :body-pre:

(defhydra dumb-jump-hydra (:body-pre (dumb-jump-go) :color blue)
   "dumb jump"
   ("g" dumb-jump-go "go to declaration")
   ("b" dumb-jump-back "back"))
(global-set-key (kbd "C-M-g") 'dumb-jump-hydra/body)