hydra 0.15.0 is out
18 May 2019This release consists of 45 commits done over the course of the last 2 years. With this version, I have introduced a Changelog.org, similar to what ivy and avy have.
Highlights
Display hints using posframe
A new defcustom hydra-hint-display-type
was introduced that can be either lv
(the default),
message
, or posframe
.
Posframe is a package that leverages a new feature in Emacs 26.1: the ability to display child frames. The advantage of using child frames is that you can easily position them anywhere within your frame area. For example, the default setting is to put it in the center of the current window, which is closer to where your eyes are focused than the minibuffer. Child frames don't interfere with the content of the buffers which they overlap. Finally, you can select a different font for the child frame.
Less boilerplate in defhydra
You no longer have to add :hint nil
, and you can skip the docstring as well:
(defhydra hydra-clock (:exit t)
("q" nil "quit" :column "Clock")
("c" org-clock-cancel "cancel" :column "Do" :exit nil)
("d" org-clock-display "display")
("e" org-clock-modify-effort-estimate "effort")
("i" org-clock-in "in")
("j" org-clock-goto "jump")
("o" org-clock-out "out")
("r" org-clock-report "report"))
Add heads to an existing hydra
You can now add heads to an existing hydra like this:
(defhydra hydra-extendable ()
"extendable"
("j" next-line "down"))
(defhydra+ hydra-extendable ()
("k" previous-line "up"))
The new macro defhydra+
takes the same arguments as defhydra
, so it's quite easy to split up or
join your hydras.
The use case of defhydra+
is when you have many packages that want to add heads to an existing
hydra. Some of them may be optional or loaded lazily.
You can now have a base defhydra
, and then use defhydra+
to add heads to it when a new package
is loaded. Example:
(defhydra hydra-toggle ()
("q" nil "quit" :column "Exit")
("w" whitespace-mode
(format "whitespace-mode: %S" whitespace-mode)
:column "Toggles"))
(use-package org
:config
(defhydra+ hydra-toggle ()
("l" org-toggle-link-display
(format "org link display: %S" org-descriptive-links))))
Outro
Big thanks to all contributors, and I hope you enjoy the new release. Happy hacking!
PS. Thanks to everyone who supports me on Liberapay and Patreon!