[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d678cc0 34/45: Work around `overriding-terminal-local-map'
From: |
Oleh Krehel |
Subject: |
[elpa] master d678cc0 34/45: Work around `overriding-terminal-local-map' being terminal-local |
Date: |
Thu, 16 Apr 2015 12:45:53 +0000 |
branch: master
commit d678cc06cc245d0fedc6242fe8ee1bed764477ac
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Work around `overriding-terminal-local-map' being terminal-local
* hydra.el (hydra-disable): Try to reset `overriding-terminal-local-map'
for each frame, so that it doesn't happen that the hydra is cancelled
in one frame, but not in the other. `hydra-curr-on-exit' is called in
the first frame for which there's a transient map.
(hydra--clearfun): Disable when `overriding-terminal-local-map' is nil.
Fixes #105
---
hydra.el | 37 ++++++++++++++++++++-----------------
1 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/hydra.el b/hydra.el
index fea8701..39c027c 100644
--- a/hydra.el
+++ b/hydra.el
@@ -107,27 +107,30 @@ 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."
- (if (memq this-command '(handle-switch-frame
- keyboard-quit))
- (hydra-disable)
- (unless (eq this-command
- (lookup-key hydra-curr-map (this-single-command-keys)))
- (unless (cl-case hydra-curr-foreign-keys
- (warn
- (setq this-command 'hydra-amaranth-warn))
- (run
- t)
- (t nil))
- (hydra-disable)))))
+ (when (or
+ (memq this-command '(handle-switch-frame keyboard-quit))
+ (null overriding-terminal-local-map)
+ (not (or (eq this-command
+ (lookup-key hydra-curr-map (this-single-command-keys)))
+ (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."
(remove-hook 'pre-command-hook 'hydra--clearfun)
- (internal-pop-keymap hydra-curr-map 'overriding-terminal-local-map)
- (when hydra-curr-on-exit
- (let ((on-exit hydra-curr-on-exit))
- (setq hydra-curr-on-exit nil)
- (funcall on-exit))))
+ (dolist (frame (frame-list))
+ (with-selected-frame frame
+ (when overriding-terminal-local-map
+ (internal-pop-keymap hydra-curr-map 'overriding-terminal-local-map)
+ (when hydra-curr-on-exit
+ (let ((on-exit hydra-curr-on-exit))
+ (setq hydra-curr-on-exit nil)
+ (funcall on-exit)))))))
(unless (fboundp 'internal-push-keymap)
(defun internal-push-keymap (keymap symbol)
- [elpa] master 88f14a0 30/45: hydra.el (hydra--head-color): Remove, (continued)
- [elpa] master 88f14a0 30/45: hydra.el (hydra--head-color): Remove, Oleh Krehel, 2015/04/16
- [elpa] master cb630df 16/45: Update the tests for the new `hydra-set-transient-map', Oleh Krehel, 2015/04/16
- [elpa] master 566aab7 31/45: Set `this-command' when appropriate, Oleh Krehel, 2015/04/16
- [elpa] master 19cc1be 21/45: Use `unwind-protect' for :after-exit, Oleh Krehel, 2015/04/16
- [elpa] master 986226f 18/45: Simplify `keyboard-quit', Oleh Krehel, 2015/04/16
- [elpa] master 51e7753 19/45: Alias :post to :before-exit, and add :after-exit, Oleh Krehel, 2015/04/16
- [elpa] master 3d7d8c7 20/45: Add basic error handling, Oleh Krehel, 2015/04/16
- [elpa] master 684f8a2 39/45: Add integration test for red hydras temporarily exiting, Oleh Krehel, 2015/04/16
- [elpa] master d3d435d 25/45: Finalize head inheritance, Oleh Krehel, 2015/04/16
- [elpa] master b2c9ea6 36/45: README.md: Update intro, Oleh Krehel, 2015/04/16
- [elpa] master d678cc0 34/45: Work around `overriding-terminal-local-map' being terminal-local,
Oleh Krehel <=
- [elpa] master d6e00ed 33/45: README.md: Add video demo link, Oleh Krehel, 2015/04/16
- [elpa] master 97c9b9b 32/45: Move `this-command' setter, Oleh Krehel, 2015/04/16
- [elpa] master 60ce256 41/45: Add an idle message timeout option, Oleh Krehel, 2015/04/16
- [elpa] master 99b2aea 35/45: hydra.el (hydra--format): Match alnum for the "_..._" syntax, Oleh Krehel, 2015/04/16
- [elpa] master f01c87e 38/45: Fix red heads not exiting temporarily, Oleh Krehel, 2015/04/16
- [elpa] master f972634 45/45: Merge commit '742d66a63e86ac740e610faa5abba97e7f8ad5c2' from hydra, Oleh Krehel, 2015/04/16
- [elpa] master aeaabd3 42/45: hydra.el (defhydra): Re-throw a caught error when debug-on-error, Oleh Krehel, 2015/04/16
- [elpa] master 742d66a 44/45: hydra.el: Bump version, Oleh Krehel, 2015/04/16
- [elpa] master 09b63b5 43/45: Don't re-activate key chords too early, Oleh Krehel, 2015/04/16
- [elpa] master cab5a73 37/45: README.md: Update `hydra-zoom/body', Oleh Krehel, 2015/04/16