hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Cannot use SPC as a head ??

Open nobrowser opened this issue 4 years ago • 4 comments

I am a complete newbie with hydra, so I must be doing something wrong. Here is my definition:

(defhydra itz-move-hydra ()
  "move and select"
  ("SPC" set-mark-command)
  ("." forward-sentence)
  ("," backward-sentence)
  ("]" forward-sexp)
  ("[" backward-sexp)
  ("<return>" forward-paragraph)
  (";" backward-paragraph)
  ("b" backward-word)
  ("l" forward-char)
  ("h" backward-char)
  ("j" next-line)
  ("k" previous-line)
  ("n" forward-list)
  ("p" backward-list)
  ("u" backward-up-list)
  ("w" forward-word)
  ("x" exchange-point-and-mark)
  ("q" nil))

When I bind this to a key, everything works - except the SPC. Hitting space just inserts a space in the buffer and slays the hydra, as if the binding didn't exist.

I see that SPC is used in one of the examples, so it is at least expected to work ?!

nobrowser avatar Apr 04 '20 02:04 nobrowser

This works for me with <SPC>

DieracDelta avatar Apr 05 '20 18:04 DieracDelta

This works for me with <SPC>

What version of emacs, @DieracDelta ?

I think I tried <SPC> too ... and anyway, when I bind SPC to any other command, it works OK, so I suspect this is something special about set-mark-command.

nobrowser avatar Apr 05 '20 22:04 nobrowser

I'm on emacs 26.3. Turns out both SPC and <SPC> work for me. Not too sure where your problem lies. Maybe something else in your config is messing things up? I'm also drawing the package from ELPA on nixos.

DieracDelta avatar Apr 08 '20 01:04 DieracDelta

@nobrowser Your definition works as expected for me. It's likely a config issue.

You can test your hydra without config by doing:

git clone https://github.com/abo-abo/hydra/
cd hydra
make run

If it works, you can comment out parts of your config until it works as well.

abo-abo avatar Apr 30 '20 22:04 abo-abo