branch: master
commit fa5643f318539a800f93e9cb5b574b24c8d3879d
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
Quit Hydra for `handle-switch-frame'
* hydra.el (hydra--clearfun): Update.
(hydra-base-map): Update.
(hydra--handle-switch-frame): Remove.
Re #90, #73.
---
hydra.el | 27 +++++++++++----------------
1 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/hydra.el b/hydra.el
index 1234cac..d302de8 100644
--- a/hydra.el
+++ b/hydra.el
@@ -107,15 +107,17 @@ warn: keep KEYMAP and issue a warning instead of running
the command."
(defun hydra--clearfun ()
"Disable the current Hydra unless `this-command' is a head."
- (unless (eq this-command
- (lookup-key hydra-curr-map (this-command-keys-vector)))
- (unless (cl-case hydra-curr-foreign-keys
- (warn
- (setq this-command 'hydra-amaranth-warn))
- (run
- t)
- (t nil))
- (hydra-disable))))
+ (if (eq this-command 'handle-switch-frame)
+ (hydra-disable)
+ (unless (eq this-command
+ (lookup-key hydra-curr-map (this-command-keys-vector)))
+ (unless (cl-case hydra-curr-foreign-keys
+ (warn
+ (setq this-command 'hydra-amaranth-warn))
+ (run
+ t)
+ (t nil))
+ (hydra-disable)))))
(defun hydra-disable ()
"Disable the current Hydra."
@@ -240,16 +242,9 @@ Vanquishable only through a blue head.")
(define-key map [kp-8] 'hydra--digit-argument)
(define-key map [kp-9] 'hydra--digit-argument)
(define-key map [kp-subtract] 'hydra--negative-argument)
- (define-key map [switch-frame] 'hydra--handle-switch-frame)
map)
"Keymap that all Hydras inherit. See `universal-argument-map'.")
-(defun hydra--handle-switch-frame (evt)
- "Quit hydra and call old switch-frame event handler for EVT."
- (interactive "e")
- (hydra-keyboard-quit)
- (funcall (lookup-key (current-global-map) [switch-frame]) evt))
-
(defun hydra--universal-argument (arg)
"Forward to (`universal-argument' ARG)."
(interactive "P")