hydra
hydra copied to clipboard
Hydra doesn't exit when minibuffer closes
I have a hydra which controls git-timemachine. Everything works well except when I happen to close the minibuffer while perusing the timemachine buffer. One way to this is by calling delete-other-windows in the git-timemachine window. In this case :post is not invoked. The only recovery that I've found is to M-x git-timemachine-quit in the timemachine window.
Is this something that hydra should handle, or lacking that, any ideas on how to fix this would be appreciated.
Here is the use-package config I'm using:
(defvar git-timemachine-mode-map (make-sparse-keymap))
(use-package git-timemachine
:commands ( hydra-timemachine/body )
:init
;; evil-motion-state when in timemachine mode
(add-hook 'git-timemachine-mode-hook (lambda ()
(when (fboundp 'evil-motion-state)
(evil-motion-state))))
:config
(eval '(defhydra hydra-timemachine
(:hint nil
:post (progn (message "in post") (git-timemachine-quit))
:body-pre (git-timemachine)
:foreign-keys run )
"Time machine"
("<up>" #'git-timemachine-show-previous-revision "Previous revision" :column "Navigation")
("<down>" #'git-timemachine-show-next-revision "Next revision")
("C-c h" #'git-timemachine-show-current-revision "Current revision")
("C-c C-c" "Quit" :color blue )
("C-c b" #'git-timemachine-blame "Show culprits" :column "Operations")
("C-c r" #'git-timemachine-kill-revision "Yank revision")
("C-c s" #'git-timemachine-kill-abbreviated-revision "Yank abbreviated revision")))
:general
(:keymaps 'global :prefix "<f9>" "t" #'hydra-timemachine/body)
:diminish "🕓")
Please list a more detailed list of steps to reproduce the issue.
- add above config with use-package configured. I have
setq use-package-always-ensure t
in my config, so you may need to add:ensure t
if this is not the case in yours. - open any text file which is under git control
- F9 t or M-x hydra-timemachine/body so now viewing git-timemachine buffer with active hydra.
- M-x delete-other-windows.
Hydra visually goes away and doesn't exit, or if it does, the :post
function doesn't run. Run M-x git-timemachine-quit
in the buffer to get rid of the timemachine buffer.