hydra.el (hydra-disable): Deactivate key-chord advice more

* hydra.el (hydra-disable): Deactivate key-chord advice even if
  `overriding-terminal-local-map' is nil. This situation can happen with
  `multiple-cursors', since it calls `hydra-disable' multiple times, and
  `hydra-default-pre' is called multiple times as well.

Fixes #163
master
Oleh Krehel 11 years ago
parent ea36afcc59
commit 39eed63d6c
  1. 10
      hydra.el

@ -141,16 +141,16 @@ warn: keep KEYMAP and issue a warning instead of running the command."
"Disable the current Hydra."
(setq hydra-deactivate nil)
(remove-hook 'pre-command-hook 'hydra--clearfun)
(if (fboundp 'remove-function)
(remove-function input-method-function #'hydra--imf)
(when hydra--input-method-function
(setq input-method-function hydra--input-method-function)
(setq hydra--input-method-function nil)))
(dolist (frame (frame-list))
(with-selected-frame frame
(when overriding-terminal-local-map
(internal-pop-keymap hydra-curr-map 'overriding-terminal-local-map)
(unless hydra--ignore
(if (fboundp 'remove-function)
(remove-function input-method-function #'hydra--imf)
(when hydra--input-method-function
(setq input-method-function hydra--input-method-function)
(setq hydra--input-method-function nil)))
(when hydra-curr-on-exit
(let ((on-exit hydra-curr-on-exit))
(setq hydra-curr-on-exit nil)

Loading…
Cancel
Save