Skip to content

hydra 0.6.1

Compare
Choose a tag to compare
@abo-abo abo-abo released this 03 Feb 16:17
· 354 commits to master since this release

New features

This release adds the digit-argument and universal-argument machinery to Hydras. Now, each Hydra will automatically bind: 0 - 9, - and C-u. Note that digits can be used plainly, i.e. not as M-2 or C-2, but as 2.

This also means that you should try not to use the above keys as prefixes for Hydra heads.

Fixes

The heads calling hydra-disable were finally fixed for Emacs 24.4.1, thanks @bcarell.
This was hard to do, because three different Emacs versions needed three different approaches to do this.

Just a reminder:

(global-set-key
 (kbd "C-c C-v")
 (defhydra toggle (:color blue)
   "toggle"
   ("a" abbrev-mode "abbrev")
   ("d" toggle-debug-on-error "debug")
   ("f" auto-fill-mode "fill")
   ("t" toggle-truncate-lines "truncate")
   ("w" whitespace-mode "whitespace")
   ("q" nil "cancel")))

Here, all heads will call hydra-disable since they are all blue (because the body :color is blue).

Even if the body :color was red, q would still call hydra-disable, because q has nil instead of a function name.