(or emacs irrelevant)

Hydra 0.10.0 is out

As usual, I'll just re-state the release notes, while maybe adding a bit of flavor.

New features

Define Hydra heads that don't show up in the hint at all

This can be done by setting the head's hint explicitly to nil, instead of the usual string. For instance, if you always tend to bind the arrows to hjkl, there's no point to show a hint for them.

Use a dedicated window for Hydra hints

Since version 0.10.0, setting hydra-lv to t (the default setting) will make it use a dedicated window right above the Echo Area for hints. This has the advantage that you can immediately see any message output from the functions that you call, since Hydra no longer uses message to display the hint. You can still have the old behavior by setting hydra-lv to nil.

How it looks like:

hydra-lv

Here, an error was triggered by previous-line and the message is displayed without interrupting the hint.

Allow duplicate functions in heads

Duplicate functions will be concatenated in the hint. This was already covered in yesterday's post

Add option to font-lock defhydra

If you want to nicely font-lock your defhydra statements, just add this to your config:

(require 'hydra)
(hydra-add-font-lock)

Additionally, defhydra is now to be indented as a defun, so it will be indented like this:

(defhydra hydra-goto-line (global-map "M-g"
                           :pre (linum-mode 1)
                           :post (linum-mode -1)
                           :color blue)
  ("g" goto-line "line")
  ("c" goto-char "char"))

Note that the indentation of the body argument is as if it was data and not code, i.e. the proper one. As you see, I even added defhydra to the blog's Pygments list for Elisp.

Incompatible changes

The macro hydra-create, as well as the variables that were supposed to be used with it (hydra-example-text-scale, hydra-example-move-window-splitter, hydra-example-goto-error, hydra-example-windmove) were removed. All the functionality is still there in hydra-examples.el with the better defhydra macro.

Outro

I hope that you like the new changes. And if you're byte-compiling your code that uses defhydra, don't forget to re-compile. Also, the latest version of ace-window will ignore *LV* buffer while switching, as it did for *Calc Trail* before.