You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have different hydras using exactly same subset of heads. For example, for moving the point, both the vi-style navigation hydra and the rectangle operation hydra define h i j k heads to call same commands, respectively. Would it be possible to share these heads between the hydras?
An option is to define the common heads in a hydra and call it in bodies of vi-navigation and rect-ops. But that would require an extra pair of keys to enter and exit the sub-hydra.
I am thinking something like:
;; It could be implemented as a different function/macro if that would make more sense.
(defhydra common-heads ()
""
("h" backward-char)
...
("k" previous-line))
(defhydra vi-navigation ()
""
(hydra-import common-heads :hintt) ;; shown in hint
("a" beginning-of-line)
;; other heads
...)
(defhydra rect-operations ()
""
(hydra-import common-heads :hintnil) ;; hidden;; other heads
...)
The function/macro hydra-import (I am making up the name here) would somehow make the heads h j k l available directly in the calling hydras. The property :hint tells whether these heads should show up in the calling hydras. Having the :exit and :foreign-keys properties would be useful, too.
I have to admit that this is only a nice-to-have minor feature. It might not even get much use. I am just tossing some ideas.
The text was updated successfully, but these errors were encountered:
It's a good idea, but it might be too soon to do it. Myself, I have around 10 hydras total, with
little repetition. And once something gets re-used, a need for introspection arises: common-hydras
will need a variable, a docstring and location info, and metadata. All of this it doesn't have since
it's just a macro expansion.
This might get implemented in the future, but not very soon.
I have different hydras using exactly same subset of heads. For example, for moving the point, both the vi-style navigation hydra and the rectangle operation hydra define h i j k heads to call same commands, respectively. Would it be possible to share these heads between the hydras?
An option is to define the common heads in a hydra and call it in bodies of vi-navigation and rect-ops. But that would require an extra pair of keys to enter and exit the sub-hydra.
I am thinking something like:
The function/macro
hydra-import
(I am making up the name here) would somehow make the heads h j k l available directly in the calling hydras. The property :hint tells whether these heads should show up in the calling hydras. Having the :exit and :foreign-keys properties would be useful, too.I have to admit that this is only a nice-to-have minor feature. It might not even get much use. I am just tossing some ideas.
The text was updated successfully, but these errors were encountered: