If a hydra is opened, how do we check programmatically that it is actually open and displaying?
-
Can you please elaborate a bit, to make your question clearer to more people who might be able to help?– DrewDec 18, 2020 at 19:22
-
I want to check for a flag determining the status of a hydra. I'm not sure how to do it.– zcaudateDec 18, 2020 at 19:42
-
Please put any such clarifications into the question itself. Comments can be deleted at any time. Thx.– DrewDec 18, 2020 at 21:21
1 Answer
It's possible to check for a variable hydra-curr-map
. This will return nil
if the hydra is hidden or the keymap that it's using given by <hydra>/keymap
.
ie.
;; define hydra
(defhydra test-hydra ....)
;; open test-hydra
(test-hydra/body)
(eq hydra-curr-map test-hydra/keymap)
=> t
-
-
1@itirazimvar I wanted to make a toggle (1. if A is off and A is pressed, close A, 2. if A is on and A is pressed, open A, 3. if A is on and B is pressed, close A and open B)– zcaudateJan 20, 2021 at 2:13