Since HEADS arg will be modified by adding various properties, make a
deep copy of it (`copy-sequence' is not enough).
This solves the problem of using the same heads list for two different
hydras, in a macro or otherwise.
Fixes#230
Table doctrings generated from :column algorithm no longer have trailing
whitespace
Test hydra-column-1 modified accordingly
Trimming whitespace in hydra-test.el no longer breaks non-regression
This is a first rough implementation to gather early reviews
diff with code snippet from #147:
- Dash dependencies removed
- slight refactoring
Add basic column integration test.
Fixes#220
* hydra.el (hydra--make-defun): Rewrite `hydra-show-hint' arglist. The
hydra name should also be passed.
(hydra-set-property): New defun.
(hydra-show-hint): Add `caller' arg - the name of the hydra. It can be
used as a key in `hydra-props-alist'.
(hydra-idle-message): Add arg.
* hydra-test.el: Update tests.
* hydra-test.el: Update tests.
There should be no change in the behavior, but now the code that shows
the hint is all conveniently in a single defun, instead of separately in
each hydra's each head.
It's not necessary, and sometimes not even appropriate to `eval' the
head's hint. For instance, the hint may assume being in some particular
state, like `org-agenda-mode' etc.
* hydra-examples.el (hydra-org-agenda-view): New example.
* hydra.el (hydra--format): Revert to the old behavior for (:hint nil).
Turn off the bottom hint completely for (:hint none).
Fixes#190
* hydra.el (hydra--format): When body's :hint is nil /and/ the docstring
starts with a newline, set the output of `hydra--hint' to "".
This is necessary for the ?x? syntax.
* hydra-test.el (hydra-format-8): Add test.
Fixes#190
* hydra.el (hydra-docstring-keys-translate-alist): New defvar.
(hydra--format): Add "↑" to the regex, modify the head accordingly for
the `hydra-fontify-head' call.
Re #186
* hydra.el (hydra-disable): Move the action calling code out
of (frame-list) loop.
The (frame-list) loop was added to fix#105 to restor the
terminal-local-map in all frames. There's no reason for action-calling
code to be in that loop.
Fixes#169.
Instead of only a string like before, the head-hint can be anything that
evaluates to a string.
Example:
(defhydra hydra-test (:columns 2)
"Test"
("j" next-line (format-time-string "%H:%M:%S" (current-time)))
("k" previous-line (format-time-string "%H:%M:%S" (current-time)))
("h" backward-char (format-time-string "%H:%M:%S" (current-time)))
("l" forward-char (format-time-string "%H:%M:%S" (current-time))))
Pressing "hjkl" will refresh the hint, and thus update the current time.
Note that the hint needs to evaluate to a string at both compile-time
and run-time. The column formatting depends on the compile-time result.
Fixes#160
* hydra.el (hydra-disable): Deactivate key-chord advice even if
`overriding-terminal-local-map' is nil. This situation can happen with
`multiple-cursors', since it calls `hydra-disable' multiple times, and
`hydra-default-pre' is called multiple times as well.
Fixes#163