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
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