* hydra.el (hydra--format): Update regex. Make sure that there's a
proper amount of escapes for %, since:
- it first gets evaled via `hydra-test/hint'
- it gets passed to `lv-message'
So to get 1 in the end, the initial amount can be 4.
* hydra-test.el (hydra-format-7): Add tests.
* hydra.el (hydra-pause-resume): New command.
(hydra-pause-ring): New defvar. Stores the paused hydras.
(hydra-keyboard-quit): Set `hydra-curr-map' to nil, so it's possible to
determine if any hydra is active.
(hydra--clearfun): Ignore `hydra-pause-resume', since the hydra needs to
be active for `hydra-pause-resume'.
Fixes#135
* hydra.el (hydra-curr-body-fn): New defvar.
(hydra--make-defun): All hydra heads will set `hydra-curr-body-fn' to
their respective "hydra.../body" function.
Users may read `hydra-curr-body-fn' from any head.
Re #127
* hydra.el (hydra-deactivate): Fix doc.
(hydra--ignore): Fix doc.
(hydra-amaranth-warn): Add doc.
(hydra--work-around-dedicated): Fix doc.
(hydra--hint): Work around a key being "%".
(hydra--strip-align-markers): New defun.
(hydra--format): Use `hydra--strip-align-markers'.
Fixes#126
* hydra.el (hydra--input-method-function): Move before first use.
(hydra--imf): New function.
(hydra-default-pre, hydra-disable): Use add/remove-function.
* hydra.el (hydra-fontify-head-default): Use head-exit. The heads have
been pre-processed to have it always set.
* hydra-test.el (hydra-format-4): Update test. The heads are passed to
`hydra--format' in the pre-processed state now (color and hint expanded).
* lv.el (lv-window): Prevent `balance-windows' and the like from messing
things up.
(lv-message): Bind `window-size-fixed' to nil for
`fit-window-to-buffer'.
Fixes#64
* lv.el (lv-use-separator): New option.
(lv-separator): New face.
(lv): New custom group.
(lv-message): Respect lv-use-separator using lv-separator.
Re #122
* hydra.el (hydra-keyboard-quit): Don't clear the message when
`hydra--ignore' is t.
* lv.el (lv-force-update): New defvar.
(lv-message): Refresh the window unless both the window contents haven't
changed and `lv-force-update' is nil.
Fixes#121
* hydra.el (hydra--format): Since the key spec is non-greedy, the width
spec should be non-greedy too.
Otherwise, the following will match more than _1_:
_1_: h1 _2_: h2
Fixes#117
* hydra.el (hydra-deactivate): New defvar.
(hydra-set-transient-map): When `hydra-deactivate' is set, quit.
(hydra-disable): Make sure that `hydra-deactivate' is reset back to nil.
Fixes#115
Example: zoom in at most 5 times, then quit.
(defvar hydra-zoom-amount 1)
(defhydra hydra-zoom (global-map "<f2>")
"zoom"
("g"
(if (>= hydra-zoom-amount 5)
(progn
(setq hydra-zoom-amount 1)
(setq hydra-deactivate t))
(cl-incf hydra-zoom-amount)
(call-interactively 'text-scale-increase))
"in")
("l" text-scale-decrease "out"))
* hydra.el (hydra-keyboard-quit): Update.
(hydra--make-defun): Update.
(hydra-timeout-timer): Rename from `hydra-timer'.
(hydra-message-timer): New defvar.
(hydra-idle-message): New defun.
(hydra-timeout): Update.
Small example:
(defhydra hydra-zoom (:idle 1.0)
"zoom"
("g" text-scale-increase "in")
("l" text-scale-decrease "out"))
(global-set-key (kbd "<f2> g") 'hydra-zoom/body)
With this code, `hydra-zoom/body' will display the hint not immediately
but after 1.0 seconds. If you manage to exit the hydra by then, the hint
will not be displayed. Other functions will display the hint
immediately.
Fixes#108
* hydra.el (hydra-disable): Try to reset `overriding-terminal-local-map'
for each frame, so that it doesn't happen that the hydra is cancelled
in one frame, but not in the other. `hydra-curr-on-exit' is called in
the first frame for which there's a transient map.
(hydra--clearfun): Disable when `overriding-terminal-local-map' is nil.
Fixes#105
* hydra.el (hydra-face-red):
(hydra-face-blue):
(hydra-face-amaranth):
(hydra-face-pink):
(hydra-face-teal): Improve docstrings.
(hydra--head-color): Simplify.
(defhydra): Use copy-sequence on inherited heads. Move :cmd-name setting
to the very end, when :exit is already set.
* hydra-test.el: Update tests.