The :post handler is called by el:hydra-keyboard-quit, which calls el:hydra-disable, and
then sets el:hydra-curr-map to nil.
This is fine if there's only one hydra. However, for nesting hydras like yours this
happens:
- hydra-b sets el:hydra-curr-map to map-b
- el:hydra-keyboard-quit calls the :post handler and sets it to map-a
- el:hydra-keyboard-quit then sets it to nil
The fix is to set `hydra-curr-map' in `hydra-disable' before :post is called.
Fixes#375
If you want Hydra to use `message' instead of `lv-message' (the default):
(setq hydra-hint-display-type 'message)
If you want only a specific hydra to use `message':
(hydra-set-property 'hydra-test :verbosity 1)
Remember to add a delay if a head uses `message' too, otherwise the
hydra hint will erase it:
(defhydra hydra-test ()
("t" (progn
(message "time %S" (current-time))
(sit-for 0.8)) "test"))
Re #313
* hydra.el (hydra--hint): Don't add an extra newline.
* hydra-test.el (hydra-column-order): One newline less in expected string.
Also, re-indent the test code.
Fixes#303
When a user compiles hydras in a personal config file, it may be the case that
hydra is available at compilation time but has not been loaded when the file is
reloaded.
Before this commit every head has the same first line for its docstring. The
distinguishing line is last. This change makes the distinguishing line appear
first in the docstring along with some minor wording changes.
For an application, see https://github.com/justbur/emacs-which-key/issues/185#issuecomment-361944776
* hydra.el (hydra--doc): Reword docstring.
(hydra--make-defun): Say which head is called in the first line.
When initiating `complete-symbol' while inside a `defhydra', a
`macroexpand' will be called by elisp-mode.el. This is problematic,
since macroexpand is being called on incomplete code.
Attempt to detect this. See `elisp--local-variables-completion-table',
`elisp--local-variables'.
Fixes#255